@ghom/orm 1.8.7 → 1.8.8
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/dist/app/orm.d.ts +2 -2
- package/dist/app/orm.js +7 -2
- package/dist/app/table.d.ts +1 -1
- package/package.json +2 -2
package/dist/app/orm.d.ts
CHANGED
|
@@ -46,9 +46,9 @@ export interface ORMConfig {
|
|
|
46
46
|
export declare class ORM {
|
|
47
47
|
config: ORMConfig;
|
|
48
48
|
private _ready;
|
|
49
|
-
database: Knex
|
|
49
|
+
database: Knex<any, unknown[]>;
|
|
50
50
|
handler: Handler<Table<any>>;
|
|
51
|
-
_rawCache: ResponseCache<[
|
|
51
|
+
_rawCache: ResponseCache<[raw: string], Knex.Raw<any>>;
|
|
52
52
|
constructor(config: ORMConfig);
|
|
53
53
|
get cachedTables(): Table<any>[];
|
|
54
54
|
get cachedTableNames(): string[];
|
package/dist/app/orm.js
CHANGED
|
@@ -21,8 +21,13 @@ export class ORM {
|
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
this.handler = new Handler(config.tableLocation, {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
pattern: /\.[jt]s$/,
|
|
25
|
+
loader: async (filepath) => {
|
|
26
|
+
const file = await import(isCJS ? filepath : url.pathToFileURL(filepath).href);
|
|
27
|
+
if (file.default instanceof Table)
|
|
28
|
+
return file.default;
|
|
29
|
+
throw new Error(`${filepath}: default export must be a Table instance`);
|
|
30
|
+
},
|
|
26
31
|
});
|
|
27
32
|
this._rawCache = new ResponseCache((raw) => this.raw(raw), config.caching ?? Infinity);
|
|
28
33
|
}
|
package/dist/app/table.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare class Table<Type extends object = object> {
|
|
|
28
28
|
], unknown>;
|
|
29
29
|
_countCache?: ResponseCache<[where: string | null], Promise<number>>;
|
|
30
30
|
constructor(options: TableOptions<Type>);
|
|
31
|
-
get db(): Knex<any,
|
|
31
|
+
get db(): Knex<any, unknown[]>;
|
|
32
32
|
get query(): Knex.QueryBuilder<Type, {
|
|
33
33
|
_base: Type;
|
|
34
34
|
_hasSelection: false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ghom/orm",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.8",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"sqlite3": "^5.1.6"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ghom/handler": "^
|
|
34
|
+
"@ghom/handler": "^3.1.0",
|
|
35
35
|
"csv-parser": "^3.0.0",
|
|
36
36
|
"json-2-csv": "^5.5.6",
|
|
37
37
|
"knex": "^3.0.1"
|