From 8e1bcd5a3714f5dc53ddd930c6796618d305ad15 Mon Sep 17 00:00:00 2001 From: Rajaneesh R <75080457+R-Rajaneesh@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:52:58 +0530 Subject: [PATCH 1/3] Update sqlite.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ➕ Added a `fileMustExist` in the database options --- src/js/bun/sqlite.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/bun/sqlite.ts b/src/js/bun/sqlite.ts index af23482fc5ad4..c116e2802e3db 100644 --- a/src/js/bun/sqlite.ts +++ b/src/js/bun/sqlite.ts @@ -187,6 +187,12 @@ class Database { if (typeof options === "object" && options) { flags = 0; + if(!options.fileMustExist) { + options.create = true; + } else { + options.create = false; + } + if (options.readonly) { flags = constants.SQLITE_OPEN_READONLY; } From 94402b998d918b3fc8856d276714e19c70469059 Mon Sep 17 00:00:00 2001 From: Rajaneesh R <75080457+R-Rajaneesh@users.noreply.github.com> Date: Wed, 13 Mar 2024 08:41:52 +0530 Subject: [PATCH 2/3] Update src/js/bun/sqlite.ts Committing suggestion. Co-authored-by: Jarred Sumner --- src/js/bun/sqlite.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/js/bun/sqlite.ts b/src/js/bun/sqlite.ts index c116e2802e3db..9a5471ffd6b0b 100644 --- a/src/js/bun/sqlite.ts +++ b/src/js/bun/sqlite.ts @@ -187,10 +187,8 @@ class Database { if (typeof options === "object" && options) { flags = 0; - if(!options.fileMustExist) { - options.create = true; - } else { - options.create = false; + if(typeof options.fileMustExist === "boolean") { + options.create = !options.fileMustExist; } if (options.readonly) { From a5e75a53c9d5bef6bae2c50cdc14fb26b6f47118 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 13 Mar 2024 21:56:33 +0000 Subject: [PATCH 3/3] [autofix.ci] apply automated fixes --- src/js/bun/sqlite.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/bun/sqlite.ts b/src/js/bun/sqlite.ts index 9a5471ffd6b0b..2d3ce2e1fe275 100644 --- a/src/js/bun/sqlite.ts +++ b/src/js/bun/sqlite.ts @@ -187,10 +187,10 @@ class Database { if (typeof options === "object" && options) { flags = 0; - if(typeof options.fileMustExist === "boolean") { - options.create = !options.fileMustExist; + if (typeof options.fileMustExist === "boolean") { + options.create = !options.fileMustExist; } - + if (options.readonly) { flags = constants.SQLITE_OPEN_READONLY; }