@mikro-orm/pglite 7.2.0-dev.5 → 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/PgliteConnection.d.ts +7 -0
- package/PgliteConnection.js +10 -2
- package/package.json +3 -3
package/PgliteConnection.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PGlite } from '@electric-sql/pglite';
|
|
1
2
|
import { PGliteDialect } from 'kysely';
|
|
2
3
|
import { AbstractSqlConnection, type Dictionary } from '@mikro-orm/sql';
|
|
3
4
|
/**
|
|
@@ -17,6 +18,12 @@ export declare class PgliteConnection extends AbstractSqlConnection {
|
|
|
17
18
|
#private;
|
|
18
19
|
createKyselyDialect(overrides: Dictionary): PGliteDialect;
|
|
19
20
|
close(force?: boolean): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the underlying `PGlite` instance, for APIs we don't wrap (e.g. `pgDump`
|
|
23
|
+
* from `@electric-sql/pglite-tools`, extensions, or `dumpDataDir`). Closing it is
|
|
24
|
+
* still `orm.close()`'s job unless you supplied it via `driverOptions.pglite`.
|
|
25
|
+
*/
|
|
26
|
+
getNativeClient(): Promise<PGlite>;
|
|
20
27
|
/** PGlite supports multi-statement scripts via `exec()`, which is what schema dumps need. */
|
|
21
28
|
executeDump(source: string): Promise<void>;
|
|
22
29
|
}
|
package/PgliteConnection.js
CHANGED
|
@@ -97,10 +97,18 @@ export class PgliteConnection extends AbstractSqlConnection {
|
|
|
97
97
|
this.#pglite = undefined;
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* Returns the underlying `PGlite` instance, for APIs we don't wrap (e.g. `pgDump`
|
|
102
|
+
* from `@electric-sql/pglite-tools`, extensions, or `dumpDataDir`). Closing it is
|
|
103
|
+
* still `orm.close()`'s job unless you supplied it via `driverOptions.pglite`.
|
|
104
|
+
*/
|
|
105
|
+
async getNativeClient() {
|
|
106
|
+
await this.ensureConnection();
|
|
107
|
+
return this.#pglite;
|
|
108
|
+
}
|
|
100
109
|
/** PGlite supports multi-statement scripts via `exec()`, which is what schema dumps need. */
|
|
101
110
|
async executeDump(source) {
|
|
102
|
-
await this.
|
|
103
|
-
const pglite = await this.#pglite;
|
|
111
|
+
const pglite = await this.getNativeClient();
|
|
104
112
|
await pglite.exec(source);
|
|
105
113
|
}
|
|
106
114
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/pglite",
|
|
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",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@electric-sql/pglite": "0.5.4",
|
|
52
|
-
"@mikro-orm/sql": "7.2.0-dev.
|
|
52
|
+
"@mikro-orm/sql": "7.2.0-dev.6",
|
|
53
53
|
"kysely": "0.29.4",
|
|
54
54
|
"postgres-array": "3.0.4",
|
|
55
55
|
"postgres-date": "2.1.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"@mikro-orm/core": "^7.1.11"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"@mikro-orm/core": "7.2.0-dev.
|
|
62
|
+
"@mikro-orm/core": "7.2.0-dev.6"
|
|
63
63
|
},
|
|
64
64
|
"engines": {
|
|
65
65
|
"node": ">= 22.17.0"
|