@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.
@@ -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 Constraint from './constraint';
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
- constraints?: any[];
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
- constraints: Constraint[];
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, constraints, schema, token, headerColor }: RawTable);
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
- processConstraints(constraints: any[]): void;
48
- pushConstraint(constraint: any): void;
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
- constraintIds: number[];
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
- constraintIds: number[];
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 Constraint from './constraint';
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
- constraints?: any[];
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
- constraints: Constraint[];
25
+ checks: Check[];
26
26
  headerColor: string;
27
27
  dbState: DbState;
28
28
  id: number;
29
29
 
30
- constructor({ name, note, fields, indexes, constraints, token, headerColor, dbState }: RawTablePartial);
30
+ constructor({ name, note, fields, indexes, checks, token, headerColor, dbState }: RawTablePartial);
31
31
  generateId(): void;
32
32
  export(): {
33
33
  name: string;