fib-orm 1.4.2 → 2.1.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/License +1 -1
- package/README.md +53 -0
- package/lib/cli/commands/ddlFrom.d.ts +2 -0
- package/lib/cli/commands/ddlFrom.js +75 -0
- package/lib/cli/commands/dumpModel.d.ts +2 -0
- package/lib/cli/commands/dumpModel.js +107 -0
- package/lib/cli/commands/escape.d.ts +2 -0
- package/lib/cli/commands/escape.js +69 -0
- package/lib/cli/commands/spinner.d.ts +2 -0
- package/lib/cli/commands/spinner.js +37 -0
- package/lib/cli/commands/upgrade.d.ts +2 -0
- package/lib/cli/commands/upgrade.js +66 -0
- package/lib/cli/helpers/ddl.d.ts +17 -0
- package/lib/cli/helpers/ddl.js +55 -0
- package/lib/cli/helpers/package.d.ts +25 -0
- package/lib/cli/helpers/package.js +56 -0
- package/lib/cli/index.d.ts +2 -0
- package/lib/cli/index.js +19 -0
- package/lib/codepoints-map.json +762 -0
- package/lib/db-driver/Typo.d.ts +111 -0
- package/lib/db-driver/Typo.js +2 -0
- package/lib/db-driver/built-ins/base.class.d.ts +91 -0
- package/lib/db-driver/built-ins/base.class.js +187 -0
- package/lib/db-driver/built-ins/driver-dm.d.ts +17 -0
- package/lib/db-driver/built-ins/driver-dm.js +54 -0
- package/lib/db-driver/built-ins/driver-mongodb.d.ts +23 -0
- package/lib/db-driver/built-ins/driver-mongodb.js +47 -0
- package/lib/db-driver/built-ins/driver-mysql.d.ts +17 -0
- package/lib/db-driver/built-ins/driver-mysql.js +38 -0
- package/lib/db-driver/built-ins/driver-postgresql.d.ts +21 -0
- package/lib/db-driver/built-ins/driver-postgresql.js +77 -0
- package/lib/db-driver/built-ins/driver-redis.d.ts +11 -0
- package/lib/db-driver/built-ins/driver-redis.js +36 -0
- package/lib/db-driver/built-ins/driver-sqlite.d.ts +16 -0
- package/lib/db-driver/built-ins/driver-sqlite.js +35 -0
- package/lib/db-driver/index.d.ts +3 -0
- package/lib/db-driver/index.js +5 -0
- package/lib/db-driver/utils.d.ts +14 -0
- package/lib/db-driver/utils.js +187 -0
- package/lib/knex/deps/tarn/dist/PendingOperation.d.ts +12 -0
- package/lib/knex/deps/tarn/dist/PendingOperation.js +48 -0
- package/lib/knex/deps/tarn/dist/Pool.d.ts +97 -0
- package/lib/knex/deps/tarn/dist/Pool.js +516 -0
- package/lib/knex/deps/tarn/dist/PromiseInspection.d.ts +16 -0
- package/lib/knex/deps/tarn/dist/PromiseInspection.js +21 -0
- package/lib/knex/deps/tarn/dist/Resource.d.ts +9 -0
- package/lib/knex/deps/tarn/dist/Resource.js +19 -0
- package/lib/knex/deps/tarn/dist/TimeoutError.d.ts +2 -0
- package/lib/knex/deps/tarn/dist/TimeoutError.js +5 -0
- package/lib/knex/deps/tarn/dist/tarn.d.ts +3 -0
- package/lib/knex/deps/tarn/dist/tarn.js +10 -0
- package/lib/knex/deps/tarn/dist/utils.d.ts +14 -0
- package/lib/knex/deps/tarn/dist/utils.js +60 -0
- package/lib/knex/knex.d.ts +2 -0
- package/lib/knex/knex.js +4 -0
- package/lib/knex/sandbox.d.ts +4 -0
- package/lib/knex/sandbox.js +23 -0
- package/lib/orm/Adapters.d.ts +3 -0
- package/lib/orm/Adapters.js +44 -0
- package/lib/orm/AggregateFunctions.d.ts +3 -0
- package/lib/orm/AggregateFunctions.js +177 -0
- package/lib/orm/Associations/Extend.d.ts +22 -0
- package/lib/orm/Associations/Extend.js +274 -0
- package/lib/orm/Associations/Many.d.ts +16 -0
- package/lib/orm/Associations/Many.js +569 -0
- package/lib/orm/Associations/One.d.ts +16 -0
- package/lib/orm/Associations/One.js +310 -0
- package/lib/orm/Associations/_utils.d.ts +14 -0
- package/lib/orm/Associations/_utils.js +53 -0
- package/lib/orm/ChainFind.d.ts +3 -0
- package/lib/orm/ChainFind.js +328 -0
- package/lib/orm/ChainInstance.d.ts +6 -0
- package/lib/orm/ChainInstance.js +74 -0
- package/lib/orm/Debug.d.ts +2 -0
- package/lib/orm/Debug.js +17 -0
- package/lib/orm/Drivers/DB/base.d.ts +2 -0
- package/lib/orm/Drivers/DB/base.js +4 -0
- package/lib/orm/Drivers/DB/dm.d.ts +9 -0
- package/lib/orm/Drivers/DB/dm.js +24 -0
- package/lib/orm/Drivers/DB/mysql.d.ts +9 -0
- package/lib/orm/Drivers/DB/mysql.js +24 -0
- package/lib/orm/Drivers/DB/postgres.d.ts +9 -0
- package/lib/orm/Drivers/DB/postgres.js +23 -0
- package/lib/orm/Drivers/DB/sqlite3.d.ts +14 -0
- package/lib/orm/Drivers/DB/sqlite3.js +40 -0
- package/lib/orm/Drivers/DML/_ddl-sql.d.ts +3 -0
- package/lib/orm/Drivers/DML/_ddl-sql.js +52 -0
- package/lib/orm/Drivers/DML/_dml-helpers.d.ts +19 -0
- package/lib/orm/Drivers/DML/_dml-helpers.js +51 -0
- package/lib/orm/Drivers/DML/_shared.d.ts +9 -0
- package/lib/orm/Drivers/DML/_shared.js +39 -0
- package/lib/orm/Drivers/DML/_utils.d.ts +8 -0
- package/lib/orm/Drivers/DML/_utils.js +67 -0
- package/lib/orm/Drivers/DML/constants.d.ts +3 -0
- package/lib/orm/Drivers/DML/constants.js +3 -0
- package/lib/orm/Drivers/DML/dm.d.ts +2 -0
- package/lib/orm/Drivers/DML/dm.js +294 -0
- package/lib/orm/Drivers/DML/index.d.ts +4 -0
- package/lib/orm/Drivers/DML/index.js +7 -0
- package/lib/orm/Drivers/DML/mysql.d.ts +2 -0
- package/lib/orm/Drivers/DML/mysql.js +252 -0
- package/lib/orm/Drivers/DML/postgres.d.ts +2 -0
- package/lib/orm/Drivers/DML/postgres.js +277 -0
- package/lib/orm/Drivers/DML/sqlite.d.ts +2 -0
- package/lib/orm/Drivers/DML/sqlite.js +267 -0
- package/lib/orm/Error.d.ts +11 -0
- package/lib/orm/Error.js +41 -0
- package/lib/orm/Helpers.d.ts +35 -0
- package/lib/orm/Helpers.js +234 -0
- package/lib/orm/Hook.d.ts +13 -0
- package/lib/orm/Hook.js +100 -0
- package/lib/orm/Instance.d.ts +2 -0
- package/lib/orm/Instance.js +698 -0
- package/lib/orm/LazyLoad.d.ts +4 -0
- package/lib/orm/LazyLoad.js +76 -0
- package/lib/orm/Model.d.ts +6 -0
- package/lib/orm/Model.js +974 -0
- package/lib/orm/ORM.d.ts +37 -0
- package/lib/orm/ORM.js +242 -0
- package/lib/orm/Patch/fib-cache.d.ts +39 -0
- package/lib/orm/Patch/fib-cache.js +2 -0
- package/lib/orm/Patch/plugin.d.ts +4 -0
- package/lib/orm/Patch/plugin.js +14 -0
- package/lib/orm/Property.d.ts +9 -0
- package/lib/orm/Property.js +71 -0
- package/lib/orm/Settings.d.ts +42 -0
- package/lib/orm/Settings.js +120 -0
- package/lib/orm/Singleton.d.ts +5 -0
- package/lib/orm/Singleton.js +73 -0
- package/lib/orm/Typo/Adapter.d.ts +5 -0
- package/lib/orm/Typo/Adapter.js +2 -0
- package/lib/orm/Typo/DMLDriver.d.ts +209 -0
- package/lib/orm/Typo/DMLDriver.js +2 -0
- package/lib/orm/Typo/Db.d.ts +35 -0
- package/lib/orm/Typo/Db.js +2 -0
- package/lib/orm/Typo/Error.d.ts +29 -0
- package/lib/orm/Typo/Error.js +2 -0
- package/lib/orm/Typo/ORM.d.ts +231 -0
- package/lib/orm/Typo/ORM.js +4 -0
- package/lib/orm/Typo/Validators.d.ts +31 -0
- package/lib/orm/Typo/Validators.js +3 -0
- package/lib/orm/Typo/_common.d.ts +37 -0
- package/lib/orm/Typo/_common.js +2 -0
- package/lib/orm/Typo/assoc.d.ts +221 -0
- package/lib/orm/Typo/assoc.js +2 -0
- package/lib/orm/Typo/hook.d.ts +42 -0
- package/lib/orm/Typo/hook.js +2 -0
- package/lib/orm/Typo/instance.d.ts +156 -0
- package/lib/orm/Typo/instance.js +2 -0
- package/lib/orm/Typo/model.d.ts +311 -0
- package/lib/orm/Typo/model.js +7 -0
- package/lib/orm/Typo/patch.d.ts +31 -0
- package/lib/orm/Typo/patch.js +2 -0
- package/lib/orm/Typo/property.d.ts +57 -0
- package/lib/orm/Typo/property.js +2 -0
- package/lib/orm/Typo/query.d.ts +216 -0
- package/lib/orm/Typo/query.js +2 -0
- package/lib/orm/Typo/settings.d.ts +35 -0
- package/lib/orm/Typo/settings.js +6 -0
- package/lib/orm/Typo/synchronous.d.ts +47 -0
- package/lib/orm/Typo/synchronous.js +2 -0
- package/lib/orm/Utilities.d.ts +178 -0
- package/lib/orm/Utilities.js +975 -0
- package/lib/orm/Validators.d.ts +33 -0
- package/lib/orm/Validators.js +101 -0
- package/lib/orm/Where/common.d.ts +1 -0
- package/lib/orm/Where/common.js +7 -0
- package/lib/orm/Where/filterDate.d.ts +11 -0
- package/lib/orm/Where/filterDate.js +58 -0
- package/lib/orm/index.d.ts +67 -0
- package/lib/orm/index.js +158 -0
- package/lib/orm-core/callback.d.ts +12 -0
- package/lib/orm-core/callback.js +2 -0
- package/lib/orm-core/dialect.d.ts +80 -0
- package/lib/orm-core/dialect.js +2 -0
- package/lib/orm-core/error.d.ts +16 -0
- package/lib/orm-core/error.js +29 -0
- package/lib/orm-core/index.d.ts +6 -0
- package/lib/orm-core/index.js +7 -0
- package/lib/orm-core/sync.d.ts +12 -0
- package/lib/orm-core/sync.js +2 -0
- package/lib/orm-core/utils.d.ts +1 -0
- package/lib/orm-core/utils.js +6 -0
- package/lib/orm-property/Property.d.ts +78 -0
- package/lib/orm-property/Property.js +2 -0
- package/lib/orm-property/Utils.d.ts +9 -0
- package/lib/orm-property/Utils.js +13 -0
- package/lib/orm-property/customTypes.d.ts +2 -0
- package/lib/orm-property/customTypes.js +13 -0
- package/lib/orm-property/index.d.ts +10 -0
- package/lib/orm-property/index.js +23 -0
- package/lib/orm-property/transformer.d.ts +5 -0
- package/lib/orm-property/transformer.js +10 -0
- package/lib/orm-property/transformers/dm.d.ts +29 -0
- package/lib/orm-property/transformers/dm.js +238 -0
- package/lib/orm-property/transformers/index.d.ts +4 -0
- package/lib/orm-property/transformers/index.js +6 -0
- package/lib/orm-property/transformers/mysql.d.ts +101 -0
- package/lib/orm-property/transformers/mysql.js +262 -0
- package/lib/orm-property/transformers/postgresql.d.ts +54 -0
- package/lib/orm-property/transformers/postgresql.js +190 -0
- package/lib/orm-property/transformers/sqlite.d.ts +19 -0
- package/lib/orm-property/transformers/sqlite.js +172 -0
- package/lib/sql-ddl-sync/Dialects/dm.d.ts +39 -0
- package/lib/sql-ddl-sync/Dialects/dm.js +297 -0
- package/lib/sql-ddl-sync/Dialects/index.d.ts +6 -0
- package/lib/sql-ddl-sync/Dialects/index.js +8 -0
- package/lib/sql-ddl-sync/Dialects/mysql.d.ts +38 -0
- package/lib/sql-ddl-sync/Dialects/mysql.js +241 -0
- package/lib/sql-ddl-sync/Dialects/postgresql.d.ts +39 -0
- package/lib/sql-ddl-sync/Dialects/postgresql.js +287 -0
- package/lib/sql-ddl-sync/Dialects/sqlite.d.ts +43 -0
- package/lib/sql-ddl-sync/Dialects/sqlite.js +257 -0
- package/lib/sql-ddl-sync/SQL.d.ts +12 -0
- package/lib/sql-ddl-sync/SQL.js +108 -0
- package/lib/sql-ddl-sync/Typo/Collection.d.ts +13 -0
- package/lib/sql-ddl-sync/Typo/Collection.js +2 -0
- package/lib/sql-ddl-sync/Typo/DbIndex.d.ts +13 -0
- package/lib/sql-ddl-sync/Typo/DbIndex.js +2 -0
- package/lib/sql-ddl-sync/Typo/Dialect.d.ts +81 -0
- package/lib/sql-ddl-sync/Typo/Dialect.js +2 -0
- package/lib/sql-ddl-sync/Typo/Driver.d.ts +53 -0
- package/lib/sql-ddl-sync/Typo/Driver.js +2 -0
- package/lib/sql-ddl-sync/Typo/Query.d.ts +7 -0
- package/lib/sql-ddl-sync/Typo/Query.js +2 -0
- package/lib/sql-ddl-sync/Typo/SQL.d.ts +31 -0
- package/lib/sql-ddl-sync/Typo/SQL.js +2 -0
- package/lib/sql-ddl-sync/Typo/_common.d.ts +29 -0
- package/lib/sql-ddl-sync/Typo/_common.js +2 -0
- package/lib/sql-ddl-sync/Utils.d.ts +39 -0
- package/lib/sql-ddl-sync/Utils.js +217 -0
- package/lib/sql-ddl-sync/index.d.ts +87 -0
- package/lib/sql-ddl-sync/index.js +372 -0
- package/lib/sql-query/Comparators.d.ts +3 -0
- package/lib/sql-query/Comparators.js +95 -0
- package/lib/sql-query/Create.d.ts +35 -0
- package/lib/sql-query/Create.js +78 -0
- package/lib/sql-query/Dialects/dm.d.ts +3 -0
- package/lib/sql-query/Dialects/dm.js +75 -0
- package/lib/sql-query/Dialects/index.d.ts +10 -0
- package/lib/sql-query/Dialects/index.js +13 -0
- package/lib/sql-query/Dialects/mssql.d.ts +3 -0
- package/lib/sql-query/Dialects/mssql.js +74 -0
- package/lib/sql-query/Dialects/mysql.d.ts +3 -0
- package/lib/sql-query/Dialects/mysql.js +101 -0
- package/lib/sql-query/Dialects/postgresql.d.ts +3 -0
- package/lib/sql-query/Dialects/postgresql.js +77 -0
- package/lib/sql-query/Dialects/sqlite.d.ts +3 -0
- package/lib/sql-query/Dialects/sqlite.js +62 -0
- package/lib/sql-query/Helpers.d.ts +37 -0
- package/lib/sql-query/Helpers.js +260 -0
- package/lib/sql-query/Insert.d.ts +12 -0
- package/lib/sql-query/Insert.js +34 -0
- package/lib/sql-query/Query.d.ts +28 -0
- package/lib/sql-query/Query.js +120 -0
- package/lib/sql-query/Remove.d.ts +16 -0
- package/lib/sql-query/Remove.js +94 -0
- package/lib/sql-query/Select.d.ts +62 -0
- package/lib/sql-query/Select.js +534 -0
- package/lib/sql-query/Set.d.ts +4 -0
- package/lib/sql-query/Set.js +16 -0
- package/lib/sql-query/Typo/Aggregation.d.ts +32 -0
- package/lib/sql-query/Typo/Aggregation.js +2 -0
- package/lib/sql-query/Typo/Comparators.d.ts +140 -0
- package/lib/sql-query/Typo/Comparators.js +2 -0
- package/lib/sql-query/Typo/Dialect.d.ts +39 -0
- package/lib/sql-query/Typo/Dialect.js +2 -0
- package/lib/sql-query/Typo/Field.d.ts +8 -0
- package/lib/sql-query/Typo/Field.js +2 -0
- package/lib/sql-query/Typo/Helper.d.ts +4 -0
- package/lib/sql-query/Typo/Helper.js +2 -0
- package/lib/sql-query/Typo/Query-ChainBuilder.d.ts +80 -0
- package/lib/sql-query/Typo/Query-ChainBuilder.js +2 -0
- package/lib/sql-query/Typo/Query.d.ts +34 -0
- package/lib/sql-query/Typo/Query.js +17 -0
- package/lib/sql-query/Typo/Sql.d.ts +143 -0
- package/lib/sql-query/Typo/Sql.js +2 -0
- package/lib/sql-query/Typo/SubQuery.d.ts +39 -0
- package/lib/sql-query/Typo/SubQuery.js +2 -0
- package/lib/sql-query/Typo/index.d.ts +9 -0
- package/lib/sql-query/Typo/index.js +2 -0
- package/lib/sql-query/Update.d.ts +15 -0
- package/lib/sql-query/Update.js +39 -0
- package/lib/sql-query/Where.d.ts +4 -0
- package/lib/sql-query/Where.js +280 -0
- package/package.json +71 -36
- package/.travis.yml +0 -14
- package/@types/index.d.ts +0 -254
- package/@types/orm_mirror/orm.d.ts +0 -275
- package/@types/orm_mirror/sql-query.d.ts +0 -79
- package/Readme.md +0 -843
- package/lib/index.js +0 -13
- package/lib/modules/mysql.js +0 -35
- package/lib/modules/sqlite3.js +0 -27
- package/lib/patch.js +0 -271
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
export type __StringType<ENUM_T = string> = string | ENUM_T;
|
|
2
|
+
export type ColumnType = __StringType;
|
|
3
|
+
export interface IProperty {
|
|
4
|
+
type: __StringType<PropertyType>;
|
|
5
|
+
key?: boolean;
|
|
6
|
+
mapsTo?: string;
|
|
7
|
+
unique?: boolean | string | string[];
|
|
8
|
+
index?: boolean | string | string[];
|
|
9
|
+
serial?: boolean;
|
|
10
|
+
unsigned?: boolean;
|
|
11
|
+
primary?: boolean;
|
|
12
|
+
required?: boolean;
|
|
13
|
+
defaultValue?: ((ctx?: ITransformCtx) => any) | any;
|
|
14
|
+
size?: number | string;
|
|
15
|
+
rational?: boolean;
|
|
16
|
+
time?: boolean;
|
|
17
|
+
big?: boolean;
|
|
18
|
+
values?: any[];
|
|
19
|
+
/**
|
|
20
|
+
* @description for some db backends, comment is the description of the column
|
|
21
|
+
*/
|
|
22
|
+
comment?: string;
|
|
23
|
+
[ext_k: string]: any;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* @description
|
|
27
|
+
* all standard property types should be supported by transformer
|
|
28
|
+
*/
|
|
29
|
+
export type PropertyType = 'text' | 'integer' | 'number' | 'serial' | 'boolean' | 'date' | 'binary' | 'object' | 'enum' | 'point';
|
|
30
|
+
export type ICustomPropertyType = {
|
|
31
|
+
datastoreType(prop: IProperty, ctx: ITransformCtx): string;
|
|
32
|
+
};
|
|
33
|
+
export type ITransformCtx = {
|
|
34
|
+
/**
|
|
35
|
+
* @description database's type
|
|
36
|
+
*/
|
|
37
|
+
type?: string;
|
|
38
|
+
/**
|
|
39
|
+
* @description database's version
|
|
40
|
+
*/
|
|
41
|
+
version?: string;
|
|
42
|
+
/**
|
|
43
|
+
* @description collection name
|
|
44
|
+
*/
|
|
45
|
+
collection?: string;
|
|
46
|
+
userOptions?: Record<string, any>;
|
|
47
|
+
};
|
|
48
|
+
export interface IPropTransformer<TCol extends object> {
|
|
49
|
+
/**
|
|
50
|
+
* @description filter column information, some input data would be dirty.
|
|
51
|
+
*
|
|
52
|
+
* e.g. the type of field in TCol is Class_Buffer, we need to convert it to string.
|
|
53
|
+
*
|
|
54
|
+
*/
|
|
55
|
+
filterRawColumns?(column: TCol): TCol;
|
|
56
|
+
/**
|
|
57
|
+
* @description transform database's type raw information to property
|
|
58
|
+
*/
|
|
59
|
+
rawToProperty(column: TCol, ctx?: ITransformCtx): {
|
|
60
|
+
raw: TCol;
|
|
61
|
+
property: IProperty;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* @description transform property to database's type
|
|
65
|
+
*/
|
|
66
|
+
toStorageType(property: IProperty, ctx: ITransformCtx & {
|
|
67
|
+
/**
|
|
68
|
+
* @description custom types
|
|
69
|
+
*/
|
|
70
|
+
customTypes?: Record<string, ICustomPropertyType>;
|
|
71
|
+
escapeVal(val: any): string;
|
|
72
|
+
}): {
|
|
73
|
+
isCustom: boolean;
|
|
74
|
+
property: IProperty;
|
|
75
|
+
typeValue: string;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export type ExtractColumnInfo<T extends any> = T extends IPropTransformer<infer U> ? U : never;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IProperty, ITransformCtx } from "./Property";
|
|
2
|
+
export declare function filterPropertyDefaultValue(property: IProperty, ctx: ITransformCtx): any;
|
|
3
|
+
export declare const enum COLUMN_NUMER_TYPE_IDX {
|
|
4
|
+
SHORT = 2,
|
|
5
|
+
INTEGER = 4,
|
|
6
|
+
LONG = 8,
|
|
7
|
+
FLOAT = 4,
|
|
8
|
+
DOUBLE = 8
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterPropertyDefaultValue = filterPropertyDefaultValue;
|
|
4
|
+
function filterPropertyDefaultValue(property, ctx) {
|
|
5
|
+
let _dftValue;
|
|
6
|
+
if (property.hasOwnProperty('defaultValue'))
|
|
7
|
+
if (typeof property.defaultValue === 'function') {
|
|
8
|
+
_dftValue = property.defaultValue(ctx);
|
|
9
|
+
}
|
|
10
|
+
else
|
|
11
|
+
_dftValue = property.defaultValue;
|
|
12
|
+
return _dftValue;
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineCustomType = defineCustomType;
|
|
4
|
+
const DEFAULT_DATASTORE_TYPE = function (prop, ctx) {
|
|
5
|
+
return prop.type.toUpperCase();
|
|
6
|
+
};
|
|
7
|
+
function defineCustomType(opts) {
|
|
8
|
+
opts = Object.assign({}, opts);
|
|
9
|
+
if (typeof opts.datastoreType !== 'function') {
|
|
10
|
+
opts.datastoreType = DEFAULT_DATASTORE_TYPE.bind(null);
|
|
11
|
+
}
|
|
12
|
+
return opts;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as Transformers from './transformers';
|
|
2
|
+
export { Transformers };
|
|
3
|
+
export type { IProperty } from './Property';
|
|
4
|
+
export declare function transformer(type: 'mysql'): typeof Transformers['mysql'];
|
|
5
|
+
export declare function transformer(type: 'psql'): typeof Transformers['postgresql'];
|
|
6
|
+
export declare function transformer(type: 'postgresql'): typeof Transformers['postgresql'];
|
|
7
|
+
export declare function transformer(type: 'sqlite'): typeof Transformers['sqlite'];
|
|
8
|
+
export declare function transformer(type: 'dm'): typeof Transformers['dm'];
|
|
9
|
+
export { defineCustomType } from './customTypes';
|
|
10
|
+
export { ExtractColumnInfo } from './Property';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineCustomType = exports.Transformers = void 0;
|
|
4
|
+
exports.transformer = transformer;
|
|
5
|
+
const Transformers = require("./transformers");
|
|
6
|
+
exports.Transformers = Transformers;
|
|
7
|
+
function transformer(type) {
|
|
8
|
+
switch (type) {
|
|
9
|
+
case 'psql':
|
|
10
|
+
case 'postgres':
|
|
11
|
+
return Transformers['postgresql'];
|
|
12
|
+
case 'dm':
|
|
13
|
+
return Transformers['dm'];
|
|
14
|
+
case 'postgresql':
|
|
15
|
+
case 'mysql':
|
|
16
|
+
case 'sqlite':
|
|
17
|
+
return Transformers[type];
|
|
18
|
+
default:
|
|
19
|
+
throw new Error('Unknown database type');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
var customTypes_1 = require("./customTypes");
|
|
23
|
+
Object.defineProperty(exports, "defineCustomType", { enumerable: true, get: function () { return customTypes_1.defineCustomType; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineTransformer = defineTransformer;
|
|
4
|
+
function defineTransformer(opts) {
|
|
5
|
+
const { rawToProperty, toStorageType, } = opts;
|
|
6
|
+
return {
|
|
7
|
+
rawToProperty,
|
|
8
|
+
toStorageType,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { IPropTransformer, PropertyType, __StringType } from "../Property";
|
|
2
|
+
export type ColumnType_DM = PropertyType;
|
|
3
|
+
export interface ColumnInfoDM {
|
|
4
|
+
COLUMN_NAME?: string;
|
|
5
|
+
DATA_TYPE?: string;
|
|
6
|
+
DATA_LENGTH?: number | string;
|
|
7
|
+
DATA_PRECISION?: number | string;
|
|
8
|
+
DATA_SCALE?: number | string;
|
|
9
|
+
NULLABLE?: __StringType<'Y' | 'N' | 'YES' | 'NO'>;
|
|
10
|
+
DATA_DEFAULT?: any;
|
|
11
|
+
CHAR_LENGTH?: number | string;
|
|
12
|
+
IDENTITY_COLUMN?: __StringType<'YES' | 'NO' | 'Y' | 'N'>;
|
|
13
|
+
IS_IDENTITY?: __StringType<'YES' | 'NO' | 'Y' | 'N'>;
|
|
14
|
+
COMMENT?: string;
|
|
15
|
+
column_name?: string;
|
|
16
|
+
data_type?: string;
|
|
17
|
+
data_length?: number | string;
|
|
18
|
+
data_precision?: number | string;
|
|
19
|
+
data_scale?: number | string;
|
|
20
|
+
nullable?: __StringType<'Y' | 'N' | 'YES' | 'NO'>;
|
|
21
|
+
data_default?: any;
|
|
22
|
+
char_length?: number | string;
|
|
23
|
+
identity_column?: __StringType<'YES' | 'NO' | 'Y' | 'N'>;
|
|
24
|
+
is_identity?: __StringType<'YES' | 'NO' | 'Y' | 'N'>;
|
|
25
|
+
comment?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const rawToProperty: IPropTransformer<ColumnInfoDM>['rawToProperty'];
|
|
28
|
+
export declare const toStorageType: IPropTransformer<ColumnInfoDM>['toStorageType'];
|
|
29
|
+
export declare const filterRawColumns: IPropTransformer<ColumnInfoDM>['filterRawColumns'];
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.filterRawColumns = exports.toStorageType = exports.rawToProperty = void 0;
|
|
4
|
+
const Utils_1 = require("../Utils");
|
|
5
|
+
const columnSizes = {
|
|
6
|
+
integer: {
|
|
7
|
+
[2 /* COLUMN_NUMER_TYPE_IDX.SHORT */]: 'SMALLINT',
|
|
8
|
+
[4 /* COLUMN_NUMER_TYPE_IDX.INTEGER */]: 'INTEGER',
|
|
9
|
+
[8 /* COLUMN_NUMER_TYPE_IDX.LONG */]: 'BIGINT'
|
|
10
|
+
},
|
|
11
|
+
floating: {
|
|
12
|
+
[4 /* COLUMN_NUMER_TYPE_IDX.FLOAT */]: 'FLOAT',
|
|
13
|
+
[8 /* COLUMN_NUMER_TYPE_IDX.DOUBLE */]: 'DOUBLE'
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
function normalizeColInfo(colInfo) {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
18
|
+
const normalized = Object.assign({}, colInfo);
|
|
19
|
+
normalized.COLUMN_NAME = ((_a = normalized.COLUMN_NAME) !== null && _a !== void 0 ? _a : normalized.column_name);
|
|
20
|
+
normalized.DATA_TYPE = ((_b = normalized.DATA_TYPE) !== null && _b !== void 0 ? _b : normalized.data_type);
|
|
21
|
+
normalized.DATA_LENGTH = ((_c = normalized.DATA_LENGTH) !== null && _c !== void 0 ? _c : normalized.data_length);
|
|
22
|
+
normalized.DATA_PRECISION = ((_d = normalized.DATA_PRECISION) !== null && _d !== void 0 ? _d : normalized.data_precision);
|
|
23
|
+
normalized.DATA_SCALE = ((_e = normalized.DATA_SCALE) !== null && _e !== void 0 ? _e : normalized.data_scale);
|
|
24
|
+
normalized.NULLABLE = ((_f = normalized.NULLABLE) !== null && _f !== void 0 ? _f : normalized.nullable);
|
|
25
|
+
normalized.DATA_DEFAULT = ((_g = normalized.DATA_DEFAULT) !== null && _g !== void 0 ? _g : normalized.data_default);
|
|
26
|
+
normalized.CHAR_LENGTH = ((_h = normalized.CHAR_LENGTH) !== null && _h !== void 0 ? _h : normalized.char_length);
|
|
27
|
+
normalized.IDENTITY_COLUMN = ((_l = (_k = (_j = normalized.IDENTITY_COLUMN) !== null && _j !== void 0 ? _j : normalized.identity_column) !== null && _k !== void 0 ? _k : normalized.IS_IDENTITY) !== null && _l !== void 0 ? _l : normalized.is_identity);
|
|
28
|
+
normalized.COMMENT = ((_p = (_o = (_m = normalized.COMMENT) !== null && _m !== void 0 ? _m : normalized.comment) !== null && _o !== void 0 ? _o : normalized.COMMENTS) !== null && _p !== void 0 ? _p : normalized.comments);
|
|
29
|
+
normalized.COLUMN_NAME = normalized.COLUMN_NAME ? normalized.COLUMN_NAME.toString() : '';
|
|
30
|
+
normalized.DATA_TYPE = normalized.DATA_TYPE ? normalized.DATA_TYPE.toString() : '';
|
|
31
|
+
normalized.DATA_LENGTH = normalized.DATA_LENGTH ? normalized.DATA_LENGTH.toString() : '';
|
|
32
|
+
normalized.DATA_PRECISION = normalized.DATA_PRECISION ? normalized.DATA_PRECISION.toString() : '';
|
|
33
|
+
normalized.DATA_SCALE = normalized.DATA_SCALE ? normalized.DATA_SCALE.toString() : '';
|
|
34
|
+
normalized.NULLABLE = normalized.NULLABLE ? normalized.NULLABLE.toString() : '';
|
|
35
|
+
normalized.DATA_DEFAULT = normalized.DATA_DEFAULT !== undefined ? normalized.DATA_DEFAULT.toString() : normalized.DATA_DEFAULT;
|
|
36
|
+
normalized.CHAR_LENGTH = normalized.CHAR_LENGTH ? normalized.CHAR_LENGTH.toString() : '';
|
|
37
|
+
normalized.IDENTITY_COLUMN = normalized.IDENTITY_COLUMN ? normalized.IDENTITY_COLUMN.toString() : '';
|
|
38
|
+
normalized.COMMENT = normalized.COMMENT ? normalized.COMMENT.toString() : '';
|
|
39
|
+
return normalized;
|
|
40
|
+
}
|
|
41
|
+
function isIdentityColumn(colInfo) {
|
|
42
|
+
const v = colInfo.IDENTITY_COLUMN ? colInfo.IDENTITY_COLUMN.toString().toUpperCase() : '';
|
|
43
|
+
return v === 'YES' || v === 'Y' || v === 'TRUE' || v === '1';
|
|
44
|
+
}
|
|
45
|
+
function colInfoToProperty(colInfo) {
|
|
46
|
+
const property = {};
|
|
47
|
+
const col = normalizeColInfo(colInfo);
|
|
48
|
+
const type = col.DATA_TYPE.toUpperCase();
|
|
49
|
+
if (isIdentityColumn(col)) {
|
|
50
|
+
property.serial = true;
|
|
51
|
+
property.key = true;
|
|
52
|
+
property.primary = true;
|
|
53
|
+
}
|
|
54
|
+
if (col.NULLABLE && (col.NULLABLE.toUpperCase() === 'N' || col.NULLABLE.toUpperCase() === 'NO')) {
|
|
55
|
+
property.required = true;
|
|
56
|
+
}
|
|
57
|
+
if (col.DATA_DEFAULT !== 'null' && col.DATA_DEFAULT !== undefined && col.DATA_DEFAULT !== null) {
|
|
58
|
+
property.defaultValue = col.DATA_DEFAULT;
|
|
59
|
+
}
|
|
60
|
+
switch (type) {
|
|
61
|
+
case 'SMALLINT':
|
|
62
|
+
case 'INTEGER':
|
|
63
|
+
case 'INT':
|
|
64
|
+
case 'BIGINT':
|
|
65
|
+
case 'TINYINT':
|
|
66
|
+
property.type = 'integer';
|
|
67
|
+
property.size = 4 /* COLUMN_NUMER_TYPE_IDX.INTEGER */;
|
|
68
|
+
for (let k in columnSizes.integer) {
|
|
69
|
+
if (columnSizes.integer[k] === type) {
|
|
70
|
+
property.size = parseInt(k, 10);
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case 'FLOAT':
|
|
76
|
+
case 'DOUBLE':
|
|
77
|
+
case 'REAL':
|
|
78
|
+
case 'NUMERIC':
|
|
79
|
+
case 'DECIMAL':
|
|
80
|
+
property.type = 'number';
|
|
81
|
+
property.rational = true;
|
|
82
|
+
property.size = 8 /* COLUMN_NUMER_TYPE_IDX.DOUBLE */;
|
|
83
|
+
if (type === 'FLOAT' || type === 'REAL') {
|
|
84
|
+
property.size = 4 /* COLUMN_NUMER_TYPE_IDX.FLOAT */;
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case 'BIT':
|
|
88
|
+
property.type = 'boolean';
|
|
89
|
+
break;
|
|
90
|
+
case 'DATE':
|
|
91
|
+
property.type = 'date';
|
|
92
|
+
break;
|
|
93
|
+
case 'DATETIME':
|
|
94
|
+
case 'TIMESTAMP':
|
|
95
|
+
property.type = 'date';
|
|
96
|
+
property.time = true;
|
|
97
|
+
break;
|
|
98
|
+
case 'CHAR':
|
|
99
|
+
case 'VARCHAR':
|
|
100
|
+
case 'VARCHAR2':
|
|
101
|
+
case 'NCHAR':
|
|
102
|
+
case 'NVARCHAR':
|
|
103
|
+
property.type = 'text';
|
|
104
|
+
if (col.CHAR_LENGTH) {
|
|
105
|
+
property.size = parseInt(String(col.CHAR_LENGTH), 10);
|
|
106
|
+
}
|
|
107
|
+
else if (col.DATA_LENGTH) {
|
|
108
|
+
property.size = parseInt(String(col.DATA_LENGTH), 10);
|
|
109
|
+
}
|
|
110
|
+
break;
|
|
111
|
+
case 'TEXT':
|
|
112
|
+
case 'CLOB':
|
|
113
|
+
case 'LONG':
|
|
114
|
+
case 'LONGVARCHAR':
|
|
115
|
+
property.type = 'text';
|
|
116
|
+
property.big = true;
|
|
117
|
+
break;
|
|
118
|
+
case 'BLOB':
|
|
119
|
+
case 'IMAGE':
|
|
120
|
+
case 'LONGVARBINARY':
|
|
121
|
+
case 'VARBINARY':
|
|
122
|
+
case 'BINARY':
|
|
123
|
+
case 'RAW':
|
|
124
|
+
property.type = 'binary';
|
|
125
|
+
break;
|
|
126
|
+
default:
|
|
127
|
+
throw new Error(`Unknown property type '${type}'`);
|
|
128
|
+
}
|
|
129
|
+
if (property.serial) {
|
|
130
|
+
property.type = 'serial';
|
|
131
|
+
}
|
|
132
|
+
property.mapsTo = col.COLUMN_NAME;
|
|
133
|
+
if (col.COMMENT) {
|
|
134
|
+
property.comment = col.COMMENT;
|
|
135
|
+
}
|
|
136
|
+
return property;
|
|
137
|
+
}
|
|
138
|
+
const rawToProperty = function (colInfo, ctx) {
|
|
139
|
+
return {
|
|
140
|
+
raw: colInfo,
|
|
141
|
+
property: colInfoToProperty(colInfo)
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
exports.rawToProperty = rawToProperty;
|
|
145
|
+
const toStorageType = function (inputProperty, ctx) {
|
|
146
|
+
var _a;
|
|
147
|
+
const property = Object.assign({}, inputProperty);
|
|
148
|
+
const result = {
|
|
149
|
+
isCustom: false,
|
|
150
|
+
property,
|
|
151
|
+
typeValue: '',
|
|
152
|
+
};
|
|
153
|
+
if (property.type == 'number' && property.rational === false) {
|
|
154
|
+
property.type = 'integer';
|
|
155
|
+
delete property.rational;
|
|
156
|
+
}
|
|
157
|
+
switch (property.type) {
|
|
158
|
+
case 'text':
|
|
159
|
+
if (property.big) {
|
|
160
|
+
result.typeValue = 'TEXT';
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
const size = Math.min(Math.max(parseInt(property.size, 10) || 255, 1), 32767);
|
|
164
|
+
result.typeValue = `VARCHAR(${size})`;
|
|
165
|
+
}
|
|
166
|
+
break;
|
|
167
|
+
case 'integer':
|
|
168
|
+
result.typeValue = columnSizes.integer[property.size] || columnSizes.integer[4 /* COLUMN_NUMER_TYPE_IDX.INTEGER */];
|
|
169
|
+
break;
|
|
170
|
+
case 'number':
|
|
171
|
+
result.typeValue = columnSizes.floating[property.size] || columnSizes.floating[8 /* COLUMN_NUMER_TYPE_IDX.DOUBLE */];
|
|
172
|
+
break;
|
|
173
|
+
case 'serial':
|
|
174
|
+
property.type = 'number';
|
|
175
|
+
property.serial = true;
|
|
176
|
+
property.key = true;
|
|
177
|
+
result.typeValue = 'INT';
|
|
178
|
+
break;
|
|
179
|
+
case 'boolean':
|
|
180
|
+
result.typeValue = 'BIT';
|
|
181
|
+
break;
|
|
182
|
+
case 'datetime':
|
|
183
|
+
property.type = 'date';
|
|
184
|
+
property.time = true;
|
|
185
|
+
case 'date':
|
|
186
|
+
result.typeValue = property.time ? 'DATETIME' : 'DATE';
|
|
187
|
+
break;
|
|
188
|
+
case 'binary':
|
|
189
|
+
result.typeValue = 'BLOB';
|
|
190
|
+
break;
|
|
191
|
+
case 'object':
|
|
192
|
+
result.typeValue = 'TEXT';
|
|
193
|
+
break;
|
|
194
|
+
case 'point':
|
|
195
|
+
result.typeValue = 'TEXT';
|
|
196
|
+
break;
|
|
197
|
+
case 'enum':
|
|
198
|
+
result.typeValue = 'VARCHAR(255)';
|
|
199
|
+
break;
|
|
200
|
+
case 'point':
|
|
201
|
+
default:
|
|
202
|
+
result.isCustom = true;
|
|
203
|
+
break;
|
|
204
|
+
}
|
|
205
|
+
if (!result.typeValue && !result.isCustom)
|
|
206
|
+
return result;
|
|
207
|
+
if (property.required) {
|
|
208
|
+
result.typeValue += ' NOT NULL';
|
|
209
|
+
}
|
|
210
|
+
if (property.serial) {
|
|
211
|
+
if (!property.required) {
|
|
212
|
+
result.typeValue += ' NOT NULL';
|
|
213
|
+
}
|
|
214
|
+
result.typeValue += ' IDENTITY(1,1)';
|
|
215
|
+
}
|
|
216
|
+
if (result.isCustom) {
|
|
217
|
+
if ((_a = ctx.customTypes) === null || _a === void 0 ? void 0 : _a[property.type]) {
|
|
218
|
+
result.typeValue = ctx.customTypes[property.type].datastoreType(property, ctx);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else if (property.hasOwnProperty('defaultValue') && property.defaultValue !== undefined) {
|
|
222
|
+
const defaultValue = property.type === 'date' && property.defaultValue === Date.now
|
|
223
|
+
? 'CURRENT_TIMESTAMP'
|
|
224
|
+
: (0, Utils_1.filterPropertyDefaultValue)(property, ctx);
|
|
225
|
+
result.typeValue += ` DEFAULT ${property.type === 'date' && (['CURRENT_TIMESTAMP'].includes(defaultValue))
|
|
226
|
+
? defaultValue
|
|
227
|
+
: ctx.escapeVal(defaultValue)}`;
|
|
228
|
+
}
|
|
229
|
+
if (property.comment) {
|
|
230
|
+
result.typeValue += ` COMMENT ${ctx.escapeVal(property.comment)}`;
|
|
231
|
+
}
|
|
232
|
+
return result;
|
|
233
|
+
};
|
|
234
|
+
exports.toStorageType = toStorageType;
|
|
235
|
+
const filterRawColumns = function (col) {
|
|
236
|
+
return normalizeColInfo(col);
|
|
237
|
+
};
|
|
238
|
+
exports.filterRawColumns = filterRawColumns;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { IPropTransformer, PropertyType, __StringType } from "../Property";
|
|
2
|
+
export type ColumnType_MySQL = PropertyType;
|
|
3
|
+
/**
|
|
4
|
+
* result from:
|
|
5
|
+
* 1. SHOW COLUMN FROM ??;
|
|
6
|
+
* 1. SHOW FULL COLUMN FROM ??;
|
|
7
|
+
*
|
|
8
|
+
* there're extra fields in the result of sql 2: Collation, Comment, Privileges
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
export interface ColumnInfoMySQL {
|
|
12
|
+
Field: string;
|
|
13
|
+
Type: Class_Buffer | __StringType<'smallint' | 'integer' | 'bigint' | 'int' | 'float' | 'double' | 'tinyint' | 'datetime' | 'date' | 'longblob' | 'blob' | 'varchar'>;
|
|
14
|
+
Size: number | string;
|
|
15
|
+
/**
|
|
16
|
+
* extra description such as `AUTO_INCREMENT`
|
|
17
|
+
*/
|
|
18
|
+
Extra: string;
|
|
19
|
+
/**
|
|
20
|
+
* @example `PRI`
|
|
21
|
+
*/
|
|
22
|
+
Key: __StringType<'PRI' | 'MUL'>;
|
|
23
|
+
/**
|
|
24
|
+
* @example `NO`
|
|
25
|
+
*/
|
|
26
|
+
Null: __StringType<'NO' | 'YES'>;
|
|
27
|
+
/**
|
|
28
|
+
* @deprecated
|
|
29
|
+
*/
|
|
30
|
+
SubType?: string[];
|
|
31
|
+
/**
|
|
32
|
+
* @example null
|
|
33
|
+
*/
|
|
34
|
+
Default?: any;
|
|
35
|
+
/**
|
|
36
|
+
* @example `utf8mb4_unicode_ci`
|
|
37
|
+
*/
|
|
38
|
+
Collation?: string;
|
|
39
|
+
/**
|
|
40
|
+
* @example `select,insert,update,references`
|
|
41
|
+
* type IPrivileges = "select" | "insert" | "update" | "references";
|
|
42
|
+
*/
|
|
43
|
+
Privileges?: string;
|
|
44
|
+
Comment?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface ColumnInfoMySQL {
|
|
47
|
+
Field: string;
|
|
48
|
+
Type: Class_Buffer | __StringType<'smallint' | 'integer' | 'bigint' | 'int' | 'float' | 'double' | 'tinyint' | 'datetime' | 'date' | 'longblob' | 'blob' | 'varchar'>;
|
|
49
|
+
Size: number | string;
|
|
50
|
+
/**
|
|
51
|
+
* extra description such as `AUTO_INCREMENT`
|
|
52
|
+
*/
|
|
53
|
+
Extra: string;
|
|
54
|
+
/**
|
|
55
|
+
* @example `PRI`
|
|
56
|
+
*/
|
|
57
|
+
Key: __StringType<'PRI' | 'MUL'>;
|
|
58
|
+
/**
|
|
59
|
+
* @example `NO`
|
|
60
|
+
*/
|
|
61
|
+
Null: __StringType<'NO' | 'YES'>;
|
|
62
|
+
SubType?: string[];
|
|
63
|
+
/**
|
|
64
|
+
* @example null
|
|
65
|
+
*/
|
|
66
|
+
Default?: any;
|
|
67
|
+
}
|
|
68
|
+
type DB_INTEGER = number;
|
|
69
|
+
type DB_UNSIGNED_INT = DB_INTEGER;
|
|
70
|
+
type DB_BIGINT = number | bigint;
|
|
71
|
+
type DB_UNSIGNED_BIGINT = DB_BIGINT;
|
|
72
|
+
type DB_TEXT = string;
|
|
73
|
+
type DB_VARCHAR<T extends number = 255> = string;
|
|
74
|
+
export interface SchemaColumnInfoMySQL {
|
|
75
|
+
TABLE_CATALOG: DB_VARCHAR<64>;
|
|
76
|
+
TABLE_SCHEMA: DB_VARCHAR<64>;
|
|
77
|
+
TABLE_NAME: DB_VARCHAR<64>;
|
|
78
|
+
COLUMN_NAME: DB_VARCHAR<64>;
|
|
79
|
+
ORDINAL_POSITION: DB_UNSIGNED_INT;
|
|
80
|
+
COLUMN_DEFAULT: DB_TEXT;
|
|
81
|
+
IS_NULLABLE: DB_VARCHAR<3> | 'NO' | 'YES';
|
|
82
|
+
DATA_TYPE: DB_TEXT;
|
|
83
|
+
CHARACTER_MAXIMUM_LENGTH: DB_BIGINT;
|
|
84
|
+
CHARACTER_OCTET_LENGTH: DB_BIGINT;
|
|
85
|
+
NUMERIC_PRECISION: DB_UNSIGNED_BIGINT;
|
|
86
|
+
NUMERIC_SCALE: DB_UNSIGNED_BIGINT;
|
|
87
|
+
DATETIME_PRECISION: DB_UNSIGNED_INT;
|
|
88
|
+
CHARACTER_SET_NAME: DB_VARCHAR;
|
|
89
|
+
COLLATION_NAME: DB_TEXT;
|
|
90
|
+
COLUMN_TYPE: DB_TEXT;
|
|
91
|
+
COLUMN_KEY: '' | 'PRI' | 'UNI' | 'MUL';
|
|
92
|
+
EXTRA: DB_VARCHAR<256>;
|
|
93
|
+
PRIVILEGES: DB_VARCHAR<154>;
|
|
94
|
+
COLUMN_COMMENT: DB_TEXT;
|
|
95
|
+
GENERATION_EXPRESSION: DB_TEXT;
|
|
96
|
+
SRS_ID: DB_UNSIGNED_INT;
|
|
97
|
+
}
|
|
98
|
+
export declare const rawToProperty: IPropTransformer<ColumnInfoMySQL>['rawToProperty'];
|
|
99
|
+
export declare const toStorageType: IPropTransformer<ColumnInfoMySQL>['toStorageType'];
|
|
100
|
+
export declare const filterRawColumns: IPropTransformer<ColumnInfoMySQL>['filterRawColumns'];
|
|
101
|
+
export {};
|