@nocobase/database 1.2.21-alpha → 1.2.22-alpha
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/lib/database.d.ts
CHANGED
|
@@ -15,7 +15,6 @@ import { ModelStatic, Options, QueryInterfaceDropAllTablesOptions, QueryOptions,
|
|
|
15
15
|
import { Umzug } from 'umzug';
|
|
16
16
|
import { Collection, CollectionOptions, RepositoryType } from './collection';
|
|
17
17
|
import { CollectionFactory } from './collection-factory';
|
|
18
|
-
import { CollectionGroupManager } from './collection-group-manager';
|
|
19
18
|
import { ImportFileExtension } from './collection-importer';
|
|
20
19
|
import DatabaseUtils from './database-utils';
|
|
21
20
|
import ReferencesMap from './features/references-map';
|
|
@@ -110,7 +109,6 @@ export declare class Database extends EventEmitter implements AsyncEmitter {
|
|
|
110
109
|
mergeOptions?: any;
|
|
111
110
|
}[]>;
|
|
112
111
|
logger: Logger;
|
|
113
|
-
collectionGroupManager: CollectionGroupManager;
|
|
114
112
|
interfaceManager: InterfaceManager;
|
|
115
113
|
collectionFactory: CollectionFactory;
|
|
116
114
|
emitAsync: (event: string | symbol, ...args: any[]) => Promise<boolean>;
|
package/lib/database.js
CHANGED
|
@@ -59,7 +59,6 @@ var import_semver = __toESM(require("semver"));
|
|
|
59
59
|
var import_sequelize = require("sequelize");
|
|
60
60
|
var import_umzug = require("umzug");
|
|
61
61
|
var import_collection_factory = require("./collection-factory");
|
|
62
|
-
var import_collection_group_manager = require("./collection-group-manager");
|
|
63
62
|
var import_collection_importer = require("./collection-importer");
|
|
64
63
|
var import_database_utils = __toESM(require("./database-utils"));
|
|
65
64
|
var import_references_map = __toESM(require("./features/references-map"));
|
|
@@ -128,7 +127,6 @@ const _Database = class _Database extends import_events.EventEmitter {
|
|
|
128
127
|
modelHook;
|
|
129
128
|
delayCollectionExtend = /* @__PURE__ */ new Map();
|
|
130
129
|
logger;
|
|
131
|
-
collectionGroupManager = new import_collection_group_manager.CollectionGroupManager(this);
|
|
132
130
|
interfaceManager = new import_interface_manager.InterfaceManager(this);
|
|
133
131
|
collectionFactory = new import_collection_factory.CollectionFactory(this);
|
|
134
132
|
constructor(options) {
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -53,6 +53,7 @@ __export(src_exports, {
|
|
|
53
53
|
ValidationError: () => import_sequelize.ValidationError,
|
|
54
54
|
ValidationErrorItem: () => import_sequelize.ValidationErrorItem,
|
|
55
55
|
default: () => import_database.Database,
|
|
56
|
+
fieldTypeMap: () => import_field_type_map.default,
|
|
56
57
|
fn: () => import_sequelize.fn,
|
|
57
58
|
literal: () => import_sequelize.literal,
|
|
58
59
|
snakeCase: () => import_utils.snakeCase,
|
|
@@ -89,6 +90,7 @@ __reExport(src_exports, require("./view/view-inference"), module.exports);
|
|
|
89
90
|
__reExport(src_exports, require("./helpers"), module.exports);
|
|
90
91
|
var import_sql_parser = __toESM(require("./sql-parser"));
|
|
91
92
|
__reExport(src_exports, require("./interfaces"), module.exports);
|
|
93
|
+
var import_field_type_map = __toESM(require("./view/field-type-map"));
|
|
92
94
|
// Annotate the CommonJS export names for ESM import in node:
|
|
93
95
|
0 && (module.exports = {
|
|
94
96
|
BaseError,
|
|
@@ -106,6 +108,7 @@ __reExport(src_exports, require("./interfaces"), module.exports);
|
|
|
106
108
|
UniqueConstraintError,
|
|
107
109
|
ValidationError,
|
|
108
110
|
ValidationErrorItem,
|
|
111
|
+
fieldTypeMap,
|
|
109
112
|
fn,
|
|
110
113
|
literal,
|
|
111
114
|
snakeCase,
|
|
@@ -50,6 +50,10 @@ function buildQueryInterface(db) {
|
|
|
50
50
|
postgres: import_postgres_query_interface.default,
|
|
51
51
|
sqlite: import_sqlite_query_interface.default
|
|
52
52
|
};
|
|
53
|
+
const dialect = db.options.dialect;
|
|
54
|
+
if (!map[dialect]) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
53
57
|
return new map[db.options.dialect](db);
|
|
54
58
|
}
|
|
55
59
|
__name(buildQueryInterface, "buildQueryInterface");
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
-
declare const
|
|
9
|
+
declare const fieldTypeMap: {
|
|
10
10
|
postgres: {
|
|
11
11
|
'character varying': string[];
|
|
12
12
|
varchar: string[];
|
|
@@ -106,4 +106,4 @@ declare const _default: {
|
|
|
106
106
|
enum: string;
|
|
107
107
|
};
|
|
108
108
|
};
|
|
109
|
-
export default
|
|
109
|
+
export default fieldTypeMap;
|
|
@@ -98,4 +98,5 @@ const sqlite = {
|
|
|
98
98
|
numeric: "decimal",
|
|
99
99
|
json: ["json", "array"]
|
|
100
100
|
};
|
|
101
|
-
|
|
101
|
+
const fieldTypeMap = { postgres, mysql, sqlite, mariadb: mysql };
|
|
102
|
+
var field_type_map_default = fieldTypeMap;
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/database",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.22-alpha",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
7
7
|
"license": "AGPL-3.0",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@nocobase/logger": "1.2.
|
|
10
|
-
"@nocobase/utils": "1.2.
|
|
9
|
+
"@nocobase/logger": "1.2.22-alpha",
|
|
10
|
+
"@nocobase/utils": "1.2.22-alpha",
|
|
11
11
|
"async-mutex": "^0.3.2",
|
|
12
12
|
"chalk": "^4.1.1",
|
|
13
13
|
"cron-parser": "4.4.0",
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
39
39
|
"directory": "packages/database"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "f7d4b5b0555f9ce8e8db8076172d8fea4d99c4a1"
|
|
42
42
|
}
|