@mikro-orm/better-sqlite 6.0.0-rc.2 → 6.0.0
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/BetterSqliteMikroORM.d.ts +6 -5
- package/BetterSqliteSchemaHelper.d.ts +2 -0
- package/BetterSqliteSchemaHelper.js +8 -1
- package/README.md +1 -0
- package/index.mjs +3 -1
- package/package.json +5 -5
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { MikroORM, type Options, type IDatabaseDriver } from '@mikro-orm/core';
|
|
1
|
+
import { MikroORM, type Options, type IDatabaseDriver, type EntityManager, type EntityManagerType } from '@mikro-orm/core';
|
|
2
2
|
import { BetterSqliteDriver } from './BetterSqliteDriver';
|
|
3
|
+
import type { SqlEntityManager } from '@mikro-orm/knex';
|
|
3
4
|
/**
|
|
4
5
|
* @inheritDoc
|
|
5
6
|
*/
|
|
6
|
-
export declare class BetterSqliteMikroORM extends MikroORM<BetterSqliteDriver> {
|
|
7
|
+
export declare class BetterSqliteMikroORM<EM extends EntityManager = SqlEntityManager> extends MikroORM<BetterSqliteDriver, EM> {
|
|
7
8
|
private static DRIVER;
|
|
8
9
|
/**
|
|
9
10
|
* @inheritDoc
|
|
10
11
|
*/
|
|
11
|
-
static init<D extends IDatabaseDriver = BetterSqliteDriver>(options?: Options<D>): Promise<MikroORM<D>>;
|
|
12
|
+
static init<D extends IDatabaseDriver = BetterSqliteDriver, EM extends EntityManager = D[typeof EntityManagerType] & EntityManager>(options?: Options<D, EM>): Promise<MikroORM<D, EM>>;
|
|
12
13
|
/**
|
|
13
14
|
* @inheritDoc
|
|
14
15
|
*/
|
|
15
|
-
static initSync<D extends IDatabaseDriver = BetterSqliteDriver>(options: Options<D>): MikroORM<D>;
|
|
16
|
+
static initSync<D extends IDatabaseDriver = BetterSqliteDriver, EM extends EntityManager = D[typeof EntityManagerType] & EntityManager>(options: Options<D, EM>): MikroORM<D, EM>;
|
|
16
17
|
}
|
|
17
18
|
export type BetterSqliteOptions = Options<BetterSqliteDriver>;
|
|
18
|
-
export declare function defineBetterSqliteConfig(options: BetterSqliteOptions): Options<BetterSqliteDriver
|
|
19
|
+
export declare function defineBetterSqliteConfig(options: BetterSqliteOptions): Options<BetterSqliteDriver, SqlEntityManager<BetterSqliteDriver> & EntityManager<IDatabaseDriver<import("@mikro-orm/core").Connection>>>;
|
|
@@ -13,6 +13,8 @@ export declare class BetterSqliteSchemaHelper extends SchemaHelper {
|
|
|
13
13
|
getChecks(connection: AbstractSqlConnection, tableName: string, schemaName?: string): Promise<CheckDef[]>;
|
|
14
14
|
getForeignKeysSQL(tableName: string): string;
|
|
15
15
|
mapForeignKeys(fks: any[], tableName: string): Dictionary;
|
|
16
|
+
getManagementDbName(): string;
|
|
17
|
+
getCreateDatabaseSQL(name: string): string;
|
|
16
18
|
databaseExists(connection: Connection, name: string): Promise<boolean>;
|
|
17
19
|
/**
|
|
18
20
|
* Implicit indexes will be ignored when diffing
|
|
@@ -136,8 +136,15 @@ class BetterSqliteSchemaHelper extends knex_1.SchemaHelper {
|
|
|
136
136
|
return ret;
|
|
137
137
|
}, {});
|
|
138
138
|
}
|
|
139
|
+
getManagementDbName() {
|
|
140
|
+
return '';
|
|
141
|
+
}
|
|
142
|
+
getCreateDatabaseSQL(name) {
|
|
143
|
+
return '';
|
|
144
|
+
}
|
|
139
145
|
async databaseExists(connection, name) {
|
|
140
|
-
|
|
146
|
+
const tables = await connection.execute(this.getListTablesSQL());
|
|
147
|
+
return tables.length > 0;
|
|
141
148
|
}
|
|
142
149
|
/**
|
|
143
150
|
* Implicit indexes will be ignored when diffing
|
package/README.md
CHANGED
|
@@ -161,6 +161,7 @@ You can find example integrations for some popular frameworks in the [`mikro-orm
|
|
|
161
161
|
- [GraphQL + PostgreSQL](https://github.com/driescroons/mikro-orm-graphql-example)
|
|
162
162
|
- [Inversify + PostgreSQL](https://github.com/PodaruDragos/inversify-example-app)
|
|
163
163
|
- [NextJS + MySQL](https://github.com/jonahallibone/mikro-orm-nextjs)
|
|
164
|
+
- [Accounts.js REST and GraphQL authentication + SQLite](https://github.com/darkbasic/mikro-orm-accounts-example)
|
|
164
165
|
|
|
165
166
|
### JavaScript Examples
|
|
166
167
|
|
package/index.mjs
CHANGED
|
@@ -38,6 +38,7 @@ export const Check = mod.Check;
|
|
|
38
38
|
export const CheckConstraintViolationException = mod.CheckConstraintViolationException;
|
|
39
39
|
export const Collection = mod.Collection;
|
|
40
40
|
export const CommitOrderCalculator = mod.CommitOrderCalculator;
|
|
41
|
+
export const Config = mod.Config;
|
|
41
42
|
export const Configuration = mod.Configuration;
|
|
42
43
|
export const ConfigurationLoader = mod.ConfigurationLoader;
|
|
43
44
|
export const Connection = mod.Connection;
|
|
@@ -52,7 +53,7 @@ export const DatabaseObjectExistsException = mod.DatabaseObjectExistsException;
|
|
|
52
53
|
export const DatabaseObjectNotFoundException = mod.DatabaseObjectNotFoundException;
|
|
53
54
|
export const DatabaseSchema = mod.DatabaseSchema;
|
|
54
55
|
export const DatabaseTable = mod.DatabaseTable;
|
|
55
|
-
export const
|
|
56
|
+
export const DataloaderType = mod.DataloaderType;
|
|
56
57
|
export const DataloaderUtils = mod.DataloaderUtils;
|
|
57
58
|
export const DateTimeType = mod.DateTimeType;
|
|
58
59
|
export const DateType = mod.DateType;
|
|
@@ -199,6 +200,7 @@ export const compareArrays = mod.compareArrays;
|
|
|
199
200
|
export const compareBooleans = mod.compareBooleans;
|
|
200
201
|
export const compareBuffers = mod.compareBuffers;
|
|
201
202
|
export const compareObjects = mod.compareObjects;
|
|
203
|
+
export const createSqlFunction = mod.createSqlFunction;
|
|
202
204
|
export const defineConfig = mod.defineConfig;
|
|
203
205
|
export const equals = mod.equals;
|
|
204
206
|
export const getOnConflictFields = mod.getOnConflictFields;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mikro-orm/better-sqlite",
|
|
3
|
-
"version": "6.0.0
|
|
3
|
+
"version": "6.0.0",
|
|
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,15 +58,15 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@mikro-orm/knex": "6.0.0
|
|
61
|
+
"@mikro-orm/knex": "6.0.0",
|
|
62
62
|
"better-sqlite3": "8.7.0",
|
|
63
|
-
"fs-extra": "11.
|
|
63
|
+
"fs-extra": "11.2.0",
|
|
64
64
|
"sqlstring-sqlite": "0.1.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@mikro-orm/core": "^
|
|
67
|
+
"@mikro-orm/core": "^6.0.0"
|
|
68
68
|
},
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@mikro-orm/core": "
|
|
70
|
+
"@mikro-orm/core": "^5.0.0"
|
|
71
71
|
}
|
|
72
72
|
}
|