@eggjs/dal-decorator 4.0.0-beta.34 → 4.0.0-beta.36
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/decorator/Column.d.ts +6 -2
- package/dist/decorator/Column.js +16 -13
- package/dist/decorator/Dao.d.ts +6 -2
- package/dist/decorator/Dao.js +19 -15
- package/dist/decorator/DataSourceQualifier.d.ts +4 -1
- package/dist/decorator/DataSourceQualifier.js +11 -7
- package/dist/decorator/Table.d.ts +6 -2
- package/dist/decorator/Table.js +20 -18
- package/dist/decorator/TableIndex.d.ts +6 -2
- package/dist/decorator/TableIndex.js +11 -6
- package/dist/decorator/index.d.ts +5 -5
- package/dist/decorator/index.js +7 -6
- package/dist/index.d.ts +20 -5
- package/dist/index.js +21 -6
- package/dist/model/ColumnModel.d.ts +23 -19
- package/dist/model/ColumnModel.js +59 -57
- package/dist/model/IndexModel.d.ts +22 -19
- package/dist/model/IndexModel.js +51 -52
- package/dist/model/TableModel.d.ts +34 -30
- package/dist/model/TableModel.js +114 -111
- package/dist/model/index.d.ts +3 -3
- package/dist/model/index.js +5 -4
- package/dist/type/MySql.d.ts +2 -1
- package/dist/type/Spatial.d.ts +13 -10
- package/dist/type/Spatial.js +31 -31
- package/dist/type/index.d.ts +2 -2
- package/dist/type/index.js +3 -3
- package/dist/util/ColumnInfoUtil.d.ts +12 -8
- package/dist/util/ColumnInfoUtil.js +21 -19
- package/dist/util/DaoInfoUtil.d.ts +8 -5
- package/dist/util/DaoInfoUtil.js +15 -11
- package/dist/util/IndexInfoUtil.d.ts +8 -4
- package/dist/util/IndexInfoUtil.js +15 -12
- package/dist/util/TableInfoUtil.d.ts +12 -8
- package/dist/util/TableInfoUtil.js +26 -23
- package/dist/util/index.d.ts +4 -4
- package/dist/util/index.js +6 -5
- package/package.json +27 -30
- package/dist/type/MySql.js +0 -2
|
@@ -1,12 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { ColumnModel } from "./ColumnModel.js";
|
|
2
|
+
import { IndexModel } from "./IndexModel.js";
|
|
3
|
+
import { CompressionType, EggProtoImplClass, InsertMethod, RowFormat } from "@eggjs/tegg-types";
|
|
4
|
+
|
|
5
|
+
//#region src/model/TableModel.d.ts
|
|
6
|
+
declare class TableModel<T = object> {
|
|
7
|
+
clazz: EggProtoImplClass<T>;
|
|
8
|
+
name: string;
|
|
9
|
+
columns: Array<ColumnModel>;
|
|
10
|
+
indices: Array<IndexModel>;
|
|
11
|
+
dataSourceName: string;
|
|
12
|
+
comment?: string;
|
|
13
|
+
autoExtendSize?: number;
|
|
14
|
+
autoIncrement?: number;
|
|
15
|
+
avgRowLength?: number;
|
|
16
|
+
characterSet?: string;
|
|
17
|
+
collate?: string;
|
|
18
|
+
compression?: CompressionType;
|
|
19
|
+
encryption?: boolean;
|
|
20
|
+
engine?: string;
|
|
21
|
+
engineAttribute?: string;
|
|
22
|
+
insertMethod?: InsertMethod;
|
|
23
|
+
keyBlockSize?: number;
|
|
24
|
+
maxRows?: number;
|
|
25
|
+
minRows?: number;
|
|
26
|
+
rowFormat?: RowFormat;
|
|
27
|
+
secondaryEngineAttribute?: string;
|
|
28
|
+
constructor(params: {
|
|
5
29
|
clazz: EggProtoImplClass<T>;
|
|
6
30
|
name: string;
|
|
31
|
+
dataSourceName: string;
|
|
7
32
|
columns: Array<ColumnModel>;
|
|
8
33
|
indices: Array<IndexModel>;
|
|
9
|
-
dataSourceName: string;
|
|
10
34
|
comment?: string;
|
|
11
35
|
autoExtendSize?: number;
|
|
12
36
|
autoIncrement?: number;
|
|
@@ -23,29 +47,9 @@ export declare class TableModel<T = object> {
|
|
|
23
47
|
minRows?: number;
|
|
24
48
|
rowFormat?: RowFormat;
|
|
25
49
|
secondaryEngineAttribute?: string;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
dataSourceName: string;
|
|
30
|
-
columns: Array<ColumnModel>;
|
|
31
|
-
indices: Array<IndexModel>;
|
|
32
|
-
comment?: string;
|
|
33
|
-
autoExtendSize?: number;
|
|
34
|
-
autoIncrement?: number;
|
|
35
|
-
avgRowLength?: number;
|
|
36
|
-
characterSet?: string;
|
|
37
|
-
collate?: string;
|
|
38
|
-
compression?: CompressionType;
|
|
39
|
-
encryption?: boolean;
|
|
40
|
-
engine?: string;
|
|
41
|
-
engineAttribute?: string;
|
|
42
|
-
insertMethod?: InsertMethod;
|
|
43
|
-
keyBlockSize?: number;
|
|
44
|
-
maxRows?: number;
|
|
45
|
-
minRows?: number;
|
|
46
|
-
rowFormat?: RowFormat;
|
|
47
|
-
secondaryEngineAttribute?: string;
|
|
48
|
-
});
|
|
49
|
-
getPrimary(): IndexModel | undefined;
|
|
50
|
-
static build<T>(clazz: EggProtoImplClass<T>): TableModel<T>;
|
|
50
|
+
});
|
|
51
|
+
getPrimary(): IndexModel | undefined;
|
|
52
|
+
static build<T>(clazz: EggProtoImplClass<T>): TableModel<T>;
|
|
51
53
|
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { TableModel };
|
package/dist/model/TableModel.js
CHANGED
|
@@ -1,113 +1,116 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { ColumnInfoUtil } from "../util/ColumnInfoUtil.js";
|
|
2
|
+
import { IndexInfoUtil } from "../util/IndexInfoUtil.js";
|
|
3
|
+
import { TableInfoUtil } from "../util/TableInfoUtil.js";
|
|
4
|
+
import "../util/index.js";
|
|
5
5
|
import { ColumnModel } from "./ColumnModel.js";
|
|
6
6
|
import { IndexModel } from "./IndexModel.js";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
|
|
7
|
+
import assert from "node:assert";
|
|
8
|
+
import { IndexType } from "@eggjs/tegg-types";
|
|
9
|
+
import snakecase from "lodash.snakecase";
|
|
10
|
+
import pluralize from "pluralize";
|
|
11
|
+
|
|
12
|
+
//#region src/model/TableModel.ts
|
|
13
|
+
var TableModel = class TableModel {
|
|
14
|
+
clazz;
|
|
15
|
+
name;
|
|
16
|
+
columns;
|
|
17
|
+
indices;
|
|
18
|
+
dataSourceName;
|
|
19
|
+
comment;
|
|
20
|
+
autoExtendSize;
|
|
21
|
+
autoIncrement;
|
|
22
|
+
avgRowLength;
|
|
23
|
+
characterSet;
|
|
24
|
+
collate;
|
|
25
|
+
compression;
|
|
26
|
+
encryption;
|
|
27
|
+
engine;
|
|
28
|
+
engineAttribute;
|
|
29
|
+
insertMethod;
|
|
30
|
+
keyBlockSize;
|
|
31
|
+
maxRows;
|
|
32
|
+
minRows;
|
|
33
|
+
rowFormat;
|
|
34
|
+
secondaryEngineAttribute;
|
|
35
|
+
constructor(params) {
|
|
36
|
+
this.clazz = params.clazz;
|
|
37
|
+
this.name = params.name;
|
|
38
|
+
this.dataSourceName = params.dataSourceName;
|
|
39
|
+
this.columns = params.columns;
|
|
40
|
+
this.indices = params.indices;
|
|
41
|
+
this.comment = params.comment;
|
|
42
|
+
this.autoExtendSize = params.autoExtendSize;
|
|
43
|
+
this.autoIncrement = params.autoIncrement;
|
|
44
|
+
this.avgRowLength = params.avgRowLength;
|
|
45
|
+
this.characterSet = params.characterSet;
|
|
46
|
+
this.collate = params.collate;
|
|
47
|
+
this.compression = params.compression;
|
|
48
|
+
this.encryption = params.encryption;
|
|
49
|
+
this.engine = params.engine;
|
|
50
|
+
this.engineAttribute = params.engineAttribute;
|
|
51
|
+
this.insertMethod = params.insertMethod;
|
|
52
|
+
this.keyBlockSize = params.keyBlockSize;
|
|
53
|
+
this.maxRows = params.maxRows;
|
|
54
|
+
this.minRows = params.minRows;
|
|
55
|
+
this.rowFormat = params.rowFormat;
|
|
56
|
+
this.secondaryEngineAttribute = params.secondaryEngineAttribute;
|
|
57
|
+
}
|
|
58
|
+
getPrimary() {
|
|
59
|
+
const index = this.indices.find((t) => t.type === IndexType.PRIMARY);
|
|
60
|
+
if (index) return index;
|
|
61
|
+
const primaryColumn = this.columns.filter((t) => t.primaryKey === true);
|
|
62
|
+
return new IndexModel({
|
|
63
|
+
name: "PRIMARY",
|
|
64
|
+
type: IndexType.PRIMARY,
|
|
65
|
+
keys: primaryColumn.map((t) => {
|
|
66
|
+
return {
|
|
67
|
+
columnName: t.columnName,
|
|
68
|
+
propertyName: t.propertyName
|
|
69
|
+
};
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
static build(clazz) {
|
|
74
|
+
const params = TableInfoUtil.getTableParams(clazz);
|
|
75
|
+
const name = params?.name ?? snakecase(pluralize(clazz.name));
|
|
76
|
+
const columnInfoMap = ColumnInfoUtil.getColumnInfoMap(clazz);
|
|
77
|
+
const columnTypeMap = ColumnInfoUtil.getColumnTypeMap(clazz);
|
|
78
|
+
const dataSourceName = params?.dataSourceName ?? "default";
|
|
79
|
+
assert(TableInfoUtil.getIsTable(clazz), `${name} is not Table`);
|
|
80
|
+
assert(columnTypeMap, `${name} has no columns`);
|
|
81
|
+
const columns = [];
|
|
82
|
+
const indices = [];
|
|
83
|
+
for (const [property, columnType] of columnTypeMap?.entries() ?? []) {
|
|
84
|
+
const columnParam = columnInfoMap?.get(property);
|
|
85
|
+
columns.push(ColumnModel.build(property, columnType, columnParam));
|
|
86
|
+
}
|
|
87
|
+
const indexList = IndexInfoUtil.getIndexList(clazz);
|
|
88
|
+
for (const index of indexList) indices.push(IndexModel.build(index, columns, clazz));
|
|
89
|
+
return new TableModel({
|
|
90
|
+
clazz,
|
|
91
|
+
name,
|
|
92
|
+
columns,
|
|
93
|
+
indices,
|
|
94
|
+
dataSourceName,
|
|
95
|
+
comment: params?.comment,
|
|
96
|
+
autoExtendSize: params?.autoExtendSize,
|
|
97
|
+
autoIncrement: params?.autoIncrement,
|
|
98
|
+
avgRowLength: params?.avgRowLength,
|
|
99
|
+
characterSet: params?.characterSet,
|
|
100
|
+
collate: params?.collate,
|
|
101
|
+
compression: params?.compression,
|
|
102
|
+
encryption: params?.encryption,
|
|
103
|
+
engine: params?.engine,
|
|
104
|
+
engineAttribute: params?.engineAttribute,
|
|
105
|
+
insertMethod: params?.insertMethod,
|
|
106
|
+
keyBlockSize: params?.keyBlockSize,
|
|
107
|
+
maxRows: params?.maxRows,
|
|
108
|
+
minRows: params?.minRows,
|
|
109
|
+
rowFormat: params?.rowFormat,
|
|
110
|
+
secondaryEngineAttribute: params?.secondaryEngineAttribute
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
//#endregion
|
|
116
|
+
export { TableModel };
|
package/dist/model/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { ColumnModel } from "./ColumnModel.js";
|
|
2
|
+
import { IndexKey, IndexModel } from "./IndexModel.js";
|
|
3
|
+
import { TableModel } from "./TableModel.js";
|
package/dist/model/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ColumnModel } from "./ColumnModel.js";
|
|
2
|
+
import { IndexModel } from "./IndexModel.js";
|
|
3
|
+
import { TableModel } from "./TableModel.js";
|
|
4
|
+
|
|
5
|
+
export { };
|
package/dist/type/MySql.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { DeleteResult, InsertResult, UpdateResult } from "@eggjs/rds";
|
|
2
|
+
export { type DeleteResult, type InsertResult, type UpdateResult };
|
package/dist/type/Spatial.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { ColumnType } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { ColumnType, Geometry, GeometryCollection } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/type/Spatial.d.ts
|
|
4
|
+
declare class SpatialHelper {
|
|
5
|
+
static isPoint(t: Geometry): boolean;
|
|
6
|
+
static isLine(t: Geometry): boolean;
|
|
7
|
+
static isPolygon(t: Geometry): boolean;
|
|
8
|
+
static getGeometryType(t: Geometry): ColumnType;
|
|
9
|
+
static isMultiPoint(t: GeometryCollection): boolean;
|
|
10
|
+
static isMultiLine(t: GeometryCollection): boolean;
|
|
11
|
+
static isMultiPolygon(t: GeometryCollection): boolean;
|
|
11
12
|
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SpatialHelper };
|
package/dist/type/Spatial.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { ColumnType } from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import { ColumnType } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/type/Spatial.ts
|
|
4
|
+
var SpatialHelper = class SpatialHelper {
|
|
5
|
+
static isPoint(t) {
|
|
6
|
+
return typeof Reflect.get(t, "x") === "number" && typeof Reflect.get(t, "y") === "number";
|
|
7
|
+
}
|
|
8
|
+
static isLine(t) {
|
|
9
|
+
return Array.isArray(t) && t[0] && SpatialHelper.isPoint(t[0]);
|
|
10
|
+
}
|
|
11
|
+
static isPolygon(t) {
|
|
12
|
+
return Array.isArray(t) && t[0] && SpatialHelper.isLine(t[0]);
|
|
13
|
+
}
|
|
14
|
+
static getGeometryType(t) {
|
|
15
|
+
if (SpatialHelper.isPoint(t)) return ColumnType.POINT;
|
|
16
|
+
else if (SpatialHelper.isLine(t)) return ColumnType.LINESTRING;
|
|
17
|
+
return ColumnType.POLYGON;
|
|
18
|
+
}
|
|
19
|
+
static isMultiPoint(t) {
|
|
20
|
+
return Array.isArray(t) && t[0] && SpatialHelper.isPoint(t[0]);
|
|
21
|
+
}
|
|
22
|
+
static isMultiLine(t) {
|
|
23
|
+
return Array.isArray(t) && t[0] && SpatialHelper.isLine(t[0]);
|
|
24
|
+
}
|
|
25
|
+
static isMultiPolygon(t) {
|
|
26
|
+
return Array.isArray(t) && t[0] && SpatialHelper.isPolygon(t[0]);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
//#endregion
|
|
31
|
+
export { SpatialHelper };
|
package/dist/type/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { DeleteResult, InsertResult, UpdateResult } from "./MySql.js";
|
|
2
|
+
import { SpatialHelper } from "./Spatial.js";
|
package/dist/type/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { SpatialHelper } from "./Spatial.js";
|
|
2
|
+
|
|
3
|
+
export { };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { ColumnParams, ColumnTypeParams, EggProtoImplClass } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/util/ColumnInfoUtil.d.ts
|
|
4
|
+
type ColumnInfoMap = Map<string, ColumnParams>;
|
|
5
|
+
type ColumnTypeMap = Map<string, ColumnTypeParams>;
|
|
6
|
+
declare class ColumnInfoUtil {
|
|
7
|
+
static addColumnInfo(clazz: EggProtoImplClass, property: string, column: ColumnInfoUtil): void;
|
|
8
|
+
static addColumnType(clazz: EggProtoImplClass, property: string, type: ColumnTypeParams): void;
|
|
9
|
+
static getColumnInfoMap(clazz: EggProtoImplClass): ColumnInfoMap | undefined;
|
|
10
|
+
static getColumnTypeMap(clazz: EggProtoImplClass): ColumnTypeMap | undefined;
|
|
9
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { ColumnInfoMap, ColumnInfoUtil, ColumnTypeMap };
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
1
|
+
import { MetadataUtil } from "@eggjs/core-decorator";
|
|
2
|
+
import { DAL_COLUMN_INFO_MAP, DAL_COLUMN_TYPE_MAP } from "@eggjs/tegg-types";
|
|
3
|
+
|
|
4
|
+
//#region src/util/ColumnInfoUtil.ts
|
|
5
|
+
var ColumnInfoUtil = class {
|
|
6
|
+
static addColumnInfo(clazz, property, column) {
|
|
7
|
+
MetadataUtil.initOwnMapMetaData(DAL_COLUMN_INFO_MAP, clazz, /* @__PURE__ */ new Map()).set(property, column);
|
|
8
|
+
}
|
|
9
|
+
static addColumnType(clazz, property, type) {
|
|
10
|
+
MetadataUtil.initOwnMapMetaData(DAL_COLUMN_TYPE_MAP, clazz, /* @__PURE__ */ new Map()).set(property, type);
|
|
11
|
+
}
|
|
12
|
+
static getColumnInfoMap(clazz) {
|
|
13
|
+
return MetadataUtil.getMetaData(DAL_COLUMN_INFO_MAP, clazz);
|
|
14
|
+
}
|
|
15
|
+
static getColumnTypeMap(clazz) {
|
|
16
|
+
return MetadataUtil.getMetaData(DAL_COLUMN_TYPE_MAP, clazz);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ColumnInfoUtil };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { BaseDaoType, EggProtoImplClass } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/util/DaoInfoUtil.d.ts
|
|
4
|
+
declare class DaoInfoUtil {
|
|
5
|
+
static setIsDao(clazz: EggProtoImplClass): void;
|
|
6
|
+
static getIsDao(clazz: EggProtoImplClass): clazz is BaseDaoType;
|
|
6
7
|
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { DaoInfoUtil };
|
package/dist/util/DaoInfoUtil.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { MetadataUtil } from "@eggjs/core-decorator";
|
|
2
|
+
import { DAL_IS_DAO } from "@eggjs/tegg-types";
|
|
3
|
+
|
|
4
|
+
//#region src/util/DaoInfoUtil.ts
|
|
5
|
+
var DaoInfoUtil = class {
|
|
6
|
+
static setIsDao(clazz) {
|
|
7
|
+
MetadataUtil.defineMetaData(DAL_IS_DAO, true, clazz);
|
|
8
|
+
}
|
|
9
|
+
static getIsDao(clazz) {
|
|
10
|
+
return MetadataUtil.getOwnMetaData(DAL_IS_DAO, clazz) === true;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { DaoInfoUtil };
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { EggProtoImplClass, IndexParams } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/util/IndexInfoUtil.d.ts
|
|
4
|
+
declare class IndexInfoUtil {
|
|
5
|
+
static addIndex(clazz: EggProtoImplClass, index: IndexParams): void;
|
|
6
|
+
static getIndexList(clazz: EggProtoImplClass): Array<IndexParams>;
|
|
5
7
|
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { IndexInfoUtil };
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
1
|
+
import { MetadataUtil } from "@eggjs/core-decorator";
|
|
2
|
+
import { DAL_INDEX_LIST } from "@eggjs/tegg-types";
|
|
3
|
+
|
|
4
|
+
//#region src/util/IndexInfoUtil.ts
|
|
5
|
+
var IndexInfoUtil = class {
|
|
6
|
+
static addIndex(clazz, index) {
|
|
7
|
+
MetadataUtil.initOwnArrayMetaData(DAL_INDEX_LIST, clazz, []).push(index);
|
|
8
|
+
}
|
|
9
|
+
static getIndexList(clazz) {
|
|
10
|
+
return MetadataUtil.getMetaData(DAL_INDEX_LIST, clazz) || [];
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { IndexInfoUtil };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { EggProtoImplClass, TableParams } from "@eggjs/tegg-types";
|
|
2
|
+
|
|
3
|
+
//#region src/util/TableInfoUtil.d.ts
|
|
4
|
+
declare const TABLE_CLAZZ_LIST: Array<EggProtoImplClass>;
|
|
5
|
+
declare class TableInfoUtil {
|
|
6
|
+
static setIsTable(clazz: EggProtoImplClass): void;
|
|
7
|
+
static getClazzList(): Array<EggProtoImplClass>;
|
|
8
|
+
static getIsTable(clazz: EggProtoImplClass): boolean;
|
|
9
|
+
static setTableParams(clazz: EggProtoImplClass, params: TableParams): void;
|
|
10
|
+
static getTableParams(clazz: EggProtoImplClass): TableParams | undefined;
|
|
9
11
|
}
|
|
12
|
+
//#endregion
|
|
13
|
+
export { TABLE_CLAZZ_LIST, TableInfoUtil };
|