@sqb/sqljs 4.0.1-beta.5 → 4.0.1-beta.52
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/dist/SqljsAdapter.js +1 -1
- package/dist/SqljsConnection.js +4 -4
- package/dist/index.js +1 -1
- package/package.json +6 -6
package/dist/SqljsAdapter.js
CHANGED
|
@@ -26,7 +26,7 @@ class SqljsAdapter {
|
|
|
26
26
|
if (dbCache[filename])
|
|
27
27
|
return new SqljsConnection_1.SqljsConnection(dbCache[filename]);
|
|
28
28
|
const filebuffer = fs_1.default.readFileSync(filename);
|
|
29
|
-
const SQL = await sql_js_1.default();
|
|
29
|
+
const SQL = await (0, sql_js_1.default)();
|
|
30
30
|
const db = new SQL.Database(filebuffer);
|
|
31
31
|
dbCache[filename] = db;
|
|
32
32
|
return new SqljsConnection_1.SqljsConnection(db);
|
package/dist/SqljsConnection.js
CHANGED
|
@@ -20,7 +20,7 @@ class SqljsConnection {
|
|
|
20
20
|
this.intlcon.exec('BEGIN TRANSACTION;');
|
|
21
21
|
}
|
|
22
22
|
catch (e) {
|
|
23
|
-
if (e.message.match(/within a transaction/))
|
|
23
|
+
if (e instanceof Error && e.message.match(/within a transaction/))
|
|
24
24
|
return;
|
|
25
25
|
throw e;
|
|
26
26
|
}
|
|
@@ -30,7 +30,7 @@ class SqljsConnection {
|
|
|
30
30
|
this.intlcon.exec('COMMIT;');
|
|
31
31
|
}
|
|
32
32
|
catch (e) {
|
|
33
|
-
if (e.message.match(/no transaction/))
|
|
33
|
+
if (e instanceof Error && e.message.match(/no transaction/))
|
|
34
34
|
return;
|
|
35
35
|
throw e;
|
|
36
36
|
}
|
|
@@ -40,7 +40,7 @@ class SqljsConnection {
|
|
|
40
40
|
this.intlcon.exec('ROLLBACK;');
|
|
41
41
|
}
|
|
42
42
|
catch (e) {
|
|
43
|
-
if (e.message.match(/no transaction/))
|
|
43
|
+
if (e instanceof Error && e.message.match(/no transaction/))
|
|
44
44
|
return;
|
|
45
45
|
throw e;
|
|
46
46
|
}
|
|
@@ -85,7 +85,7 @@ class SqljsConnection {
|
|
|
85
85
|
// Emulate update ... returning
|
|
86
86
|
if (m[1].toLowerCase() === 'update') {
|
|
87
87
|
const m2 = query.sql.match(/where (.+)/);
|
|
88
|
-
query =
|
|
88
|
+
query = { ...query };
|
|
89
89
|
query.sql = sql + (m2 ? ' where ' + m2[1] : '');
|
|
90
90
|
}
|
|
91
91
|
else
|
package/dist/index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const connect_1 = require("@sqb/connect");
|
|
4
4
|
const SqljsAdapter_1 = require("./SqljsAdapter");
|
|
5
|
-
connect_1.registerAdapter(new SqljsAdapter_1.SqljsAdapter());
|
|
5
|
+
(0, connect_1.registerAdapter)(new SqljsAdapter_1.SqljsAdapter());
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sqb/sqljs",
|
|
3
3
|
"description": "SQB serialization extension for sql.js driver",
|
|
4
|
-
"version": "4.0.1-beta.
|
|
4
|
+
"version": "4.0.1-beta.52",
|
|
5
5
|
"author": "Panates Ltd.",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Eray Hanoglu <e.hanoglu@panates.com>"
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"database"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"putil-promisify": "^1.8.
|
|
26
|
+
"putil-promisify": "^1.8.5"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/sql.js": "^1.
|
|
30
|
-
"sql.js": "^1.
|
|
29
|
+
"@types/sql.js": "^1.4.2",
|
|
30
|
+
"sql.js": "^1.5.0"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
33
|
"sql.js": "^1.4.0"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"main": "dist/index.js",
|
|
36
36
|
"types": "dist/index.d.ts",
|
|
37
37
|
"engines": {
|
|
38
|
-
"node": ">=
|
|
38
|
+
"node": ">= 14.0"
|
|
39
39
|
},
|
|
40
40
|
"directories": {
|
|
41
41
|
"lib": "dist",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"temp-dir": "./coverage/.nyc_output"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
|
-
"test": "ts-
|
|
53
|
+
"test": "TS_NODE_PROJECT='./test/tsconfig.json' mocha -r ts-node/register -r tsconfig-paths/register --reporter spec test/**/*.spec.ts",
|
|
54
54
|
"cover": "nyc --reporter=cobertura --reporter html --reporter text npm run test",
|
|
55
55
|
"build": "tsc -b tsconfig-build.json",
|
|
56
56
|
"compile": "tsc -b tsconfig.json",
|