neosqlite 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neosqlite",
3
3
  "description": "A lightweight wrapper around better-sqlite3 that adds developer-friendly features like job scheduling, migrations, error handling, query logging, SQL utilities, and more",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "main": "lib/src/index.js",
6
6
  "scripts": {
7
7
  "build": "tsc",
@@ -6,6 +6,13 @@ const parseQuery = (params) => {
6
6
  if (typeof params === "string") {
7
7
  return { sql: params, args: {} };
8
8
  }
9
+ const args = params.args ?? {};
10
+ // SQLite doesnt accept booleans, so convert them to integers
11
+ for (const [key, value] of Object.entries(args)) {
12
+ if (typeof value === "boolean") {
13
+ args[key] = value ? 1 : 0;
14
+ }
15
+ }
9
16
  return params;
10
17
  };
11
18
  exports.parseQuery = parseQuery;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "neosqlite",
3
3
  "description": "A lightweight wrapper around better-sqlite3 that adds developer-friendly features like job scheduling, migrations, error handling, query logging, SQL utilities, and more",
4
- "version": "1.0.5",
4
+ "version": "1.0.6",
5
5
  "main": "lib/src/index.js",
6
6
  "scripts": {
7
7
  "build": "tsc",
@@ -7,6 +7,15 @@ export const parseQuery = (params: ExecuteQueryParams) => {
7
7
  return { sql: params, args: {} };
8
8
  }
9
9
 
10
+ const args = params.args ?? {};
11
+
12
+ // SQLite doesnt accept booleans, so convert them to integers
13
+ for (const [key, value] of Object.entries(args)) {
14
+ if (typeof value === "boolean") {
15
+ args[key] = value ? 1 : 0;
16
+ }
17
+ }
18
+
10
19
  return params;
11
20
  };
12
21