@mikro-orm/libsql 7.0.0-dev.76 → 7.0.0-dev.77
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/LibSqlConnection.js +1 -1
- package/LibSqlDialect.js +4 -4
- package/package.json +3 -3
package/LibSqlConnection.js
CHANGED
|
@@ -24,7 +24,7 @@ export class LibSqlConnection extends BaseSqliteConnection {
|
|
|
24
24
|
onCreateConnection: this.options.onCreateConnection ?? this.config.get('onCreateConnection'),
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
/* v8 ignore next
|
|
27
|
+
/* v8 ignore next */
|
|
28
28
|
async loadFile(path) {
|
|
29
29
|
await this.ensureConnection();
|
|
30
30
|
this.database.exec((await readFile(path)).toString());
|
package/LibSqlDialect.js
CHANGED
|
@@ -36,7 +36,7 @@ class LibSqlConnection {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
const query = sql.trim().toLowerCase();
|
|
39
|
-
/* v8 ignore next
|
|
39
|
+
/* v8 ignore next */
|
|
40
40
|
if (query.startsWith('select') || ((query.startsWith('insert into') || query.startsWith('update ')) && query.includes(' returning '))) {
|
|
41
41
|
return {
|
|
42
42
|
rows: stmt.all(parameters),
|
|
@@ -49,10 +49,10 @@ class LibSqlConnection {
|
|
|
49
49
|
rows: [],
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
/* v8 ignore start */
|
|
53
52
|
async *streamQuery(compiledQuery) {
|
|
54
53
|
const { sql, parameters } = compiledQuery;
|
|
55
54
|
const stmt = this.db.prepare(sql);
|
|
55
|
+
/* v8 ignore next */
|
|
56
56
|
if (!sql.toLowerCase().startsWith('select')) {
|
|
57
57
|
throw new Error('Sqlite driver only supports streaming of select queries');
|
|
58
58
|
}
|
|
@@ -75,14 +75,14 @@ class LibSqlKyselyDriver extends SqliteDriver {
|
|
|
75
75
|
async init() {
|
|
76
76
|
this.db = await this.config.database();
|
|
77
77
|
this.connection = new LibSqlConnection(this.db);
|
|
78
|
-
/* v8 ignore next
|
|
78
|
+
/* v8 ignore next */
|
|
79
79
|
if (this.config.onCreateConnection) {
|
|
80
80
|
await this.config.onCreateConnection(this.connection);
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
async acquireConnection() {
|
|
84
84
|
await this.connectionMutex.lock();
|
|
85
|
-
/* v8 ignore next
|
|
85
|
+
/* v8 ignore next */
|
|
86
86
|
if (!this.connection.isValid()) {
|
|
87
87
|
await this.destroy();
|
|
88
88
|
await this.init();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/libsql",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "7.0.0-dev.
|
|
4
|
+
"version": "7.0.0-dev.77",
|
|
5
5
|
"description": "TypeScript ORM for Node.js based on Data Mapper, Unit of Work and Identity Map patterns. Supports MongoDB, MySQL, PostgreSQL and SQLite databases as well as usage with vanilla JavaScript.",
|
|
6
6
|
"exports": {
|
|
7
7
|
"./package.json": "./package.json",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"access": "public"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@mikro-orm/knex": "7.0.0-dev.
|
|
53
|
+
"@mikro-orm/knex": "7.0.0-dev.77",
|
|
54
54
|
"libsql": "0.5.22",
|
|
55
55
|
"sqlstring-sqlite": "0.1.1"
|
|
56
56
|
},
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"kysely": "0.28.8"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@mikro-orm/core": "7.0.0-dev.
|
|
62
|
+
"@mikro-orm/core": "7.0.0-dev.77",
|
|
63
63
|
"kysely": "*"
|
|
64
64
|
}
|
|
65
65
|
}
|