@mikro-orm/better-sqlite 6.0.0-dev.47 → 6.0.0-dev.49
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/BetterSqliteConnection.d.ts +1 -0
- package/BetterSqliteConnection.js +6 -3
- package/index.mjs +1 -0
- package/package.json +3 -3
|
@@ -3,6 +3,7 @@ import { AbstractSqlConnection } from '@mikro-orm/knex';
|
|
|
3
3
|
export declare class BetterSqliteConnection extends AbstractSqlConnection {
|
|
4
4
|
static readonly RUN_QUERY_RE: RegExp;
|
|
5
5
|
static readonly RUN_QUERY_RETURNING: RegExp;
|
|
6
|
+
createKnex(): void;
|
|
6
7
|
connect(): Promise<void>;
|
|
7
8
|
getDefaultClientUrl(): string;
|
|
8
9
|
getClientUrl(): string;
|
|
@@ -6,13 +6,16 @@ const path_1 = require("path");
|
|
|
6
6
|
const knex_1 = require("@mikro-orm/knex");
|
|
7
7
|
const core_1 = require("@mikro-orm/core");
|
|
8
8
|
class BetterSqliteConnection extends knex_1.AbstractSqlConnection {
|
|
9
|
-
|
|
10
|
-
await (0, fs_extra_1.ensureDir)((0, path_1.dirname)(this.config.get('dbName')));
|
|
9
|
+
createKnex() {
|
|
11
10
|
this.getPatchedDialect();
|
|
12
11
|
this.client = this.createKnexClient('better-sqlite3');
|
|
13
|
-
await this.client.raw('pragma foreign_keys = on');
|
|
14
12
|
this.connected = true;
|
|
15
13
|
}
|
|
14
|
+
async connect() {
|
|
15
|
+
this.createKnex();
|
|
16
|
+
await (0, fs_extra_1.ensureDir)((0, path_1.dirname)(this.config.get('dbName')));
|
|
17
|
+
await this.client.raw('pragma foreign_keys = on');
|
|
18
|
+
}
|
|
16
19
|
getDefaultClientUrl() {
|
|
17
20
|
return '';
|
|
18
21
|
}
|
package/index.mjs
CHANGED
|
@@ -89,6 +89,7 @@ export const FloatType = mod.FloatType;
|
|
|
89
89
|
export const FlushMode = mod.FlushMode;
|
|
90
90
|
export const ForeignKeyConstraintViolationException = mod.ForeignKeyConstraintViolationException;
|
|
91
91
|
export const Formula = mod.Formula;
|
|
92
|
+
export const GeneratedCacheAdapter = mod.GeneratedCacheAdapter;
|
|
92
93
|
export const GroupOperator = mod.GroupOperator;
|
|
93
94
|
export const Hydrator = mod.Hydrator;
|
|
94
95
|
export const IdentityMap = mod.IdentityMap;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/better-sqlite",
|
|
3
|
-
"version": "6.0.0-dev.
|
|
3
|
+
"version": "6.0.0-dev.49",
|
|
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
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/knex": "~6.0.0-dev.
|
|
61
|
+
"@mikro-orm/knex": "~6.0.0-dev.49",
|
|
62
62
|
"better-sqlite3": "8.2.0",
|
|
63
63
|
"fs-extra": "11.1.0",
|
|
64
64
|
"sqlstring-sqlite": "0.1.1"
|
|
@@ -67,6 +67,6 @@
|
|
|
67
67
|
"@mikro-orm/core": "^5.6.15"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@mikro-orm/core": "~6.0.0-dev.
|
|
70
|
+
"@mikro-orm/core": "~6.0.0-dev.49"
|
|
71
71
|
}
|
|
72
72
|
}
|