@mikro-orm/libsql 7.2.0-dev.4 → 7.2.0-dev.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/LibSqlConnection.d.ts +6 -1
- package/LibSqlConnection.js +8 -0
- package/package.json +3 -3
package/LibSqlConnection.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseSqliteConnection, type Dictionary } from '@mikro-orm/sql';
|
|
2
|
-
import { type Options } from 'libsql';
|
|
2
|
+
import Database, { type Options } from 'libsql';
|
|
3
3
|
import type { Routine, Transaction } from '@mikro-orm/core';
|
|
4
4
|
import { LibSqlDialect } from './LibSqlDialect.js';
|
|
5
5
|
/** libSQL database connection supporting both local and remote databases. */
|
|
@@ -15,5 +15,10 @@ export declare class LibSqlConnection extends BaseSqliteConnection {
|
|
|
15
15
|
callRoutine<T>(routine: Routine, _args?: Record<string, unknown>, _ctx?: Transaction): Promise<T>;
|
|
16
16
|
/** @inheritDoc */
|
|
17
17
|
executeDump(source: string): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Returns the `libsql` database backing this connection. Remote/replica connections are
|
|
20
|
+
* recycled, so re-read it rather than holding on to the returned handle.
|
|
21
|
+
*/
|
|
22
|
+
getNativeClient(): Promise<Database.Database>;
|
|
18
23
|
private validateAttachSupport;
|
|
19
24
|
}
|
package/LibSqlConnection.js
CHANGED
|
@@ -36,6 +36,14 @@ export class LibSqlConnection extends BaseSqliteConnection {
|
|
|
36
36
|
await this.ensureConnection();
|
|
37
37
|
this.database.exec(source);
|
|
38
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Returns the `libsql` database backing this connection. Remote/replica connections are
|
|
41
|
+
* recycled, so re-read it rather than holding on to the returned handle.
|
|
42
|
+
*/
|
|
43
|
+
async getNativeClient() {
|
|
44
|
+
await this.ensureConnection();
|
|
45
|
+
return this.requireNativeClient(this.database);
|
|
46
|
+
}
|
|
39
47
|
validateAttachSupport() {
|
|
40
48
|
const attachDatabases = this.config.get('attachDatabases');
|
|
41
49
|
if (!attachDatabases?.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/libsql",
|
|
3
|
-
"version": "7.2.0-dev.
|
|
3
|
+
"version": "7.2.0-dev.6",
|
|
4
4
|
"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.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"data-mapper",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"copy": "node ../../scripts/copy.mjs"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@mikro-orm/sql": "7.2.0-dev.
|
|
50
|
+
"@mikro-orm/sql": "7.2.0-dev.6",
|
|
51
51
|
"kysely": "0.29.4",
|
|
52
52
|
"libsql": "0.5.29"
|
|
53
53
|
},
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@mikro-orm/core": "^7.1.11"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@mikro-orm/core": "7.2.0-dev.
|
|
58
|
+
"@mikro-orm/core": "7.2.0-dev.6"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
61
|
"node": ">= 22.17.0"
|