neosqlite 1.0.4 → 1.0.5
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 +1 -1
- package/lib/src/client/index.js +3 -4
- package/package.json +1 -1
- package/src/client/index.ts +3 -5
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.
|
|
4
|
+
"version": "1.0.5",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
package/lib/src/client/index.js
CHANGED
|
@@ -10,11 +10,10 @@ function createClient(config) {
|
|
|
10
10
|
const { file } = config;
|
|
11
11
|
const db = new better_sqlite3_1.default(file);
|
|
12
12
|
const transaction = (fn) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
result = fn();
|
|
13
|
+
const result = db.transaction(() => {
|
|
14
|
+
return fn();
|
|
16
15
|
});
|
|
17
|
-
return result;
|
|
16
|
+
return result();
|
|
18
17
|
};
|
|
19
18
|
/**
|
|
20
19
|
* Read data from the database, returns all matching rows
|
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.
|
|
4
|
+
"version": "1.0.5",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
package/src/client/index.ts
CHANGED
|
@@ -9,13 +9,11 @@ export function createClient(config: NeosqliteConfig): NeosqliteClient {
|
|
|
9
9
|
const db = new Database(file);
|
|
10
10
|
|
|
11
11
|
const transaction = <T = void>(fn: () => T): T => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
db.transaction(() => {
|
|
15
|
-
result = fn();
|
|
12
|
+
const result = db.transaction(() => {
|
|
13
|
+
return fn();
|
|
16
14
|
});
|
|
17
15
|
|
|
18
|
-
return result;
|
|
16
|
+
return result();
|
|
19
17
|
};
|
|
20
18
|
|
|
21
19
|
/**
|