vona-module-a-ormdialect 5.0.20 → 5.0.22
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.
|
@@ -6,7 +6,7 @@ export interface IDatabaseDialectOptionsBetterSqlite3 extends IDecoratorDatabase
|
|
|
6
6
|
}
|
|
7
7
|
export declare class DatabaseDialectBetterSqlite3 extends BeanDatabaseDialectBase {
|
|
8
8
|
protected _capabilities: IDatabaseDialectCapabilities;
|
|
9
|
-
|
|
9
|
+
protected _configBase?: Partial<ConfigDatabaseClient>;
|
|
10
10
|
fetchDatabases(_schemaBuilder: Knex.SchemaBuilder, databasePrefix: string): Promise<IFetchDatabasesResultItem[]>;
|
|
11
11
|
createDatabase(_schemaBuilder: Knex.SchemaBuilder, databaseName: string): Promise<string>;
|
|
12
12
|
dropDatabase(_schemaBuilder: Knex.SchemaBuilder, databaseName: string): Promise<void>;
|
|
@@ -6,7 +6,7 @@ export interface IDatabaseDialectOptionsMysql extends IDecoratorDatabaseDialectO
|
|
|
6
6
|
}
|
|
7
7
|
export declare class DatabaseDialectMysql extends BeanDatabaseDialectBase {
|
|
8
8
|
protected _capabilities: IDatabaseDialectCapabilities;
|
|
9
|
-
|
|
9
|
+
protected _configBase?: Partial<ConfigDatabaseClient>;
|
|
10
10
|
fetchDatabases(schemaBuilder: Knex.SchemaBuilder, databasePrefix: string): Promise<IFetchDatabasesResultItem[]>;
|
|
11
11
|
createDatabase(schemaBuilder: Knex.SchemaBuilder, databaseName: string): Promise<string>;
|
|
12
12
|
dropDatabase(schemaBuilder: Knex.SchemaBuilder, databaseName: string): Promise<void>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IDecoratorDatabaseDialectOptions } from 'vona-module-a-orm';
|
|
2
2
|
import { DatabaseDialectMysql } from './databaseDialect.mysql.ts';
|
|
3
3
|
export interface IDatabaseDialectOptionsMysql3 extends IDecoratorDatabaseDialectOptions {
|
|
4
4
|
}
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
declare const DatabaseDialectMysql3_base: import("vona").Constructable<DatabaseDialectMysql>;
|
|
6
|
+
export declare class DatabaseDialectMysql3 extends DatabaseDialectMysql3_base {
|
|
7
7
|
}
|
|
8
|
+
export {};
|
|
@@ -6,7 +6,7 @@ export interface IDatabaseDialectOptionsPg extends IDecoratorDatabaseDialectOpti
|
|
|
6
6
|
}
|
|
7
7
|
export declare class DatabaseDialectPg extends BeanDatabaseDialectBase {
|
|
8
8
|
protected _capabilities: IDatabaseDialectCapabilities;
|
|
9
|
-
|
|
9
|
+
protected _configBase?: Partial<ConfigDatabaseClient>;
|
|
10
10
|
fetchDatabases(schemaBuilder: Knex.SchemaBuilder, databasePrefix: string): Promise<IFetchDatabasesResultItem[]>;
|
|
11
11
|
createDatabase(schemaBuilder: Knex.SchemaBuilder, databaseName: string): Promise<string>;
|
|
12
12
|
dropDatabase(schemaBuilder: Knex.SchemaBuilder, databaseName: string): Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BeanInfo, Virtual, BeanScopeBase } from 'vona';
|
|
1
|
+
import { BeanInfo, Virtual, $Class, BeanScopeBase } from 'vona';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { ensureDir, remove } from 'fs-extra';
|
|
4
4
|
import { globby } from 'globby';
|
|
@@ -16,9 +16,8 @@ let DatabaseDialectBetterSqlite3 = (_dec$4 = DatabaseDialect(), _dec2$4 = BeanIn
|
|
|
16
16
|
ilike: false,
|
|
17
17
|
level: false
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return {
|
|
19
|
+
this._configBase = {
|
|
20
|
+
useNullAsDefault: true,
|
|
22
21
|
pool: {
|
|
23
22
|
afterCreate(conn, done) {
|
|
24
23
|
sqlite3_afterCreate(conn).then(done).catch(done);
|
|
@@ -88,9 +87,7 @@ let DatabaseDialectMysql = (_dec$3 = DatabaseDialect(), _dec2$3 = BeanInfo({
|
|
|
88
87
|
ilike: false,
|
|
89
88
|
level: true
|
|
90
89
|
};
|
|
91
|
-
|
|
92
|
-
getConfigBase() {
|
|
93
|
-
return {
|
|
90
|
+
this._configBase = {
|
|
94
91
|
pool: {
|
|
95
92
|
afterCreate(conn, done) {
|
|
96
93
|
mysql_afterCreate(conn).then(done).catch(done);
|
|
@@ -162,22 +159,7 @@ async function _executeQuery(conn, sql) {
|
|
|
162
159
|
var _dec$2, _dec2$2, _dec3, _class$2;
|
|
163
160
|
let DatabaseDialectMysql3 = (_dec$2 = DatabaseDialect(), _dec2$2 = Virtual(), _dec3 = BeanInfo({
|
|
164
161
|
module: "a-ormdialect"
|
|
165
|
-
}), _dec$2(_class$2 = _dec2$2(_class$2 = _dec3(_class$2 = class DatabaseDialectMysql3 extends DatabaseDialectMysql {
|
|
166
|
-
getConfigBase() {
|
|
167
|
-
return super.getConfigBase();
|
|
168
|
-
// const configBase = super.getConfigBase();
|
|
169
|
-
// return Object.assign({}, configBase, {
|
|
170
|
-
// connection: {
|
|
171
|
-
// // typeCast(field, next) {
|
|
172
|
-
// // if (field.type === 'JSON') {
|
|
173
|
-
// // return field.string('utf-8'); // utf8 https://github.com/sidorares/node-mysql2/pull/1662
|
|
174
|
-
// // }
|
|
175
|
-
// // return next();
|
|
176
|
-
// // },
|
|
177
|
-
// },
|
|
178
|
-
// });
|
|
179
|
-
}
|
|
180
|
-
}) || _class$2) || _class$2) || _class$2);
|
|
162
|
+
}), _dec$2(_class$2 = _dec2$2(_class$2 = _dec3(_class$2 = class DatabaseDialectMysql3 extends $Class.extend(DatabaseDialectMysql) {}) || _class$2) || _class$2) || _class$2);
|
|
181
163
|
|
|
182
164
|
var _dec$1, _dec2$1, _class$1;
|
|
183
165
|
let DatabaseDialectPg = (_dec$1 = DatabaseDialect(), _dec2$1 = BeanInfo({
|
|
@@ -189,18 +171,7 @@ let DatabaseDialectPg = (_dec$1 = DatabaseDialect(), _dec2$1 = BeanInfo({
|
|
|
189
171
|
ilike: true,
|
|
190
172
|
level: true
|
|
191
173
|
};
|
|
192
|
-
|
|
193
|
-
getConfigBase() {
|
|
194
|
-
return {
|
|
195
|
-
connection: {
|
|
196
|
-
// types: {
|
|
197
|
-
// getTypeParser: (oid: number, format: string): any => {
|
|
198
|
-
// if (oid === 114) return pgTypes.getTypeParser(25, 'text');
|
|
199
|
-
// return pgTypes.getTypeParser(oid, cast(format));
|
|
200
|
-
// },
|
|
201
|
-
// },
|
|
202
|
-
}
|
|
203
|
-
};
|
|
174
|
+
this._configBase = undefined;
|
|
204
175
|
}
|
|
205
176
|
async fetchDatabases(schemaBuilder, databasePrefix) {
|
|
206
177
|
const res = await schemaBuilder.raw(`select datname from pg_database where datname like '${databasePrefix}%'`);
|