@dbml/core 4.0.0 → 5.0.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/lib/export/DbmlExporter.js +19 -19
- package/lib/export/MysqlExporter.js +21 -21
- package/lib/export/OracleExporter.js +21 -21
- package/lib/export/PostgresExporter.js +21 -21
- package/lib/export/SqlServerExporter.js +23 -23
- package/lib/model_structure/{constraint.js → check.js} +9 -9
- package/lib/model_structure/database.js +1 -1
- package/lib/model_structure/dbState.js +1 -1
- package/lib/model_structure/field.js +13 -13
- package/lib/model_structure/table.js +19 -19
- package/lib/model_structure/tablePartial.js +3 -3
- package/lib/parse/ANTLR/ASTGeneration/AST.js +8 -8
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.js +9 -9
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.js +5 -5
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.js +6 -6
- package/lib/parse/schemarb/parser.pegjs +14 -14
- package/lib/parse/schemarbParser.js +18 -18
- package/package.json +3 -3
- package/types/model_structure/{constraint.d.ts → check.d.ts} +5 -5
- package/types/model_structure/database.d.ts +2 -2
- package/types/model_structure/dbState.d.ts +1 -0
- package/types/model_structure/field.d.ts +7 -7
- package/types/model_structure/table.d.ts +8 -8
- package/types/model_structure/tablePartial.d.ts +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Element, { RawNote, Token } from './element';
|
|
2
2
|
import Field from './field';
|
|
3
3
|
import Index from './indexes';
|
|
4
|
-
import
|
|
4
|
+
import Check from './check';
|
|
5
5
|
import Schema from './schema';
|
|
6
6
|
import DbState from './dbState';
|
|
7
7
|
import TableGroup from './tableGroup';
|
|
@@ -14,7 +14,7 @@ interface RawTable {
|
|
|
14
14
|
note: RawNote;
|
|
15
15
|
fields: Field[];
|
|
16
16
|
indexes: Index[];
|
|
17
|
-
|
|
17
|
+
checks?: any[];
|
|
18
18
|
schema: Schema;
|
|
19
19
|
token: Token;
|
|
20
20
|
headerColor: string;
|
|
@@ -28,7 +28,7 @@ declare class Table extends Element {
|
|
|
28
28
|
noteToken: Token;
|
|
29
29
|
fields: Field[];
|
|
30
30
|
indexes: Index[];
|
|
31
|
-
|
|
31
|
+
checks: Check[];
|
|
32
32
|
schema: Schema;
|
|
33
33
|
headerColor: string;
|
|
34
34
|
dbState: DbState;
|
|
@@ -36,7 +36,7 @@ declare class Table extends Element {
|
|
|
36
36
|
group: TableGroup;
|
|
37
37
|
partials: TablePartial[];
|
|
38
38
|
|
|
39
|
-
constructor({ name, alias, note, fields, indexes,
|
|
39
|
+
constructor({ name, alias, note, fields, indexes, checks, schema, token, headerColor }: RawTable);
|
|
40
40
|
generateId(): void;
|
|
41
41
|
processFields(rawFields: any): void;
|
|
42
42
|
pushField(field: any): void;
|
|
@@ -44,8 +44,8 @@ declare class Table extends Element {
|
|
|
44
44
|
processIndexes(rawIndexes: any): void;
|
|
45
45
|
pushIndex(index: any): void;
|
|
46
46
|
checkIndex(index: any): void;
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
processChecks(checks: any[]): void;
|
|
48
|
+
pushCheck(check: any): void;
|
|
49
49
|
findField(fieldName: any): Field;
|
|
50
50
|
checkSameId(table: any): boolean;
|
|
51
51
|
processPartials(): void;
|
|
@@ -103,7 +103,7 @@ declare class Table extends Element {
|
|
|
103
103
|
exportChildIds(): {
|
|
104
104
|
fieldIds: number[];
|
|
105
105
|
indexIds: number[];
|
|
106
|
-
|
|
106
|
+
checkIds: number[];
|
|
107
107
|
};
|
|
108
108
|
exportParentIds(): {
|
|
109
109
|
schemaId: number;
|
|
@@ -128,7 +128,7 @@ export interface NormalizedTable {
|
|
|
128
128
|
headerColor: string;
|
|
129
129
|
fieldIds: number[];
|
|
130
130
|
indexIds: number[];
|
|
131
|
-
|
|
131
|
+
checkIds: number[];
|
|
132
132
|
schemaId: number;
|
|
133
133
|
groupId: number;
|
|
134
134
|
partials: TablePartial[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Element, { RawNote, Token } from './element';
|
|
2
2
|
import Field from './field';
|
|
3
3
|
import Index from './indexes';
|
|
4
|
-
import
|
|
4
|
+
import Check from './check';
|
|
5
5
|
import DbState from './dbState';
|
|
6
6
|
import { NormalizedDatabase } from './database';
|
|
7
7
|
|
|
@@ -10,7 +10,7 @@ interface RawTablePartial {
|
|
|
10
10
|
note: RawNote;
|
|
11
11
|
fields: Field[];
|
|
12
12
|
indexes: Index[];
|
|
13
|
-
|
|
13
|
+
checks?: any[];
|
|
14
14
|
token: Token;
|
|
15
15
|
headerColor: string;
|
|
16
16
|
dbState: DbState;
|
|
@@ -22,12 +22,12 @@ declare class TablePartial extends Element {
|
|
|
22
22
|
noteToken: Token;
|
|
23
23
|
fields: Field[];
|
|
24
24
|
indexes: Index[];
|
|
25
|
-
|
|
25
|
+
checks: Check[];
|
|
26
26
|
headerColor: string;
|
|
27
27
|
dbState: DbState;
|
|
28
28
|
id: number;
|
|
29
29
|
|
|
30
|
-
constructor({ name, note, fields, indexes,
|
|
30
|
+
constructor({ name, note, fields, indexes, checks, token, headerColor, dbState }: RawTablePartial);
|
|
31
31
|
generateId(): void;
|
|
32
32
|
export(): {
|
|
33
33
|
name: string;
|