@dbml/core 3.7.2 → 3.7.4
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/README.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
# @dbml/core
|
|
2
2
|
|
|
3
|
-
See our website [@dbml/core](https://dbml.dbdiagram.io/js-module
|
|
3
|
+
See our website [@dbml/core](https://dbml.dbdiagram.io/js-module/core) for more information
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
```bash
|
|
7
8
|
npm install @dbml/core
|
|
8
9
|
|
|
9
10
|
# or if you're using yarn
|
|
10
11
|
yarn add @dbml/core
|
|
11
|
-
```
|
|
12
|
+
```
|
|
@@ -36,6 +36,7 @@ var TableGroup = /*#__PURE__*/function (_Element) {
|
|
|
36
36
|
_ref$schema = _ref.schema,
|
|
37
37
|
schema = _ref$schema === void 0 ? {} : _ref$schema,
|
|
38
38
|
note = _ref.note,
|
|
39
|
+
color = _ref.color,
|
|
39
40
|
_ref$noteToken = _ref.noteToken,
|
|
40
41
|
noteToken = _ref$noteToken === void 0 ? null : _ref$noteToken;
|
|
41
42
|
_classCallCheck(this, TableGroup);
|
|
@@ -46,6 +47,7 @@ var TableGroup = /*#__PURE__*/function (_Element) {
|
|
|
46
47
|
_this.dbState = _this.schema.dbState;
|
|
47
48
|
_this.note = note ? (0, _lodash.get)(note, 'value', note) : null;
|
|
48
49
|
_this.noteToken = note ? (0, _lodash.get)(note, 'token', noteToken) : null;
|
|
50
|
+
_this.color = color;
|
|
49
51
|
_this.generateId();
|
|
50
52
|
_this.processTables(tables);
|
|
51
53
|
return _this;
|
|
@@ -124,7 +126,8 @@ var TableGroup = /*#__PURE__*/function (_Element) {
|
|
|
124
126
|
value: function shallowExport() {
|
|
125
127
|
return {
|
|
126
128
|
name: this.name,
|
|
127
|
-
note: this.note
|
|
129
|
+
note: this.note,
|
|
130
|
+
color: this.color
|
|
128
131
|
};
|
|
129
132
|
}
|
|
130
133
|
}, {
|
package/lib/parse/Parser.js
CHANGED
|
@@ -50,7 +50,7 @@ var Parser = /*#__PURE__*/function () {
|
|
|
50
50
|
rawDatabase = Parser.parseDBMLToJSON(str);
|
|
51
51
|
break;
|
|
52
52
|
case 'dbmlv2':
|
|
53
|
-
rawDatabase = Parser.parseDBMLToJSONv2(str, this.
|
|
53
|
+
rawDatabase = Parser.parseDBMLToJSONv2(str, this.DBMLCompiler);
|
|
54
54
|
break;
|
|
55
55
|
case 'schemarb':
|
|
56
56
|
rawDatabase = Parser.parseSchemaRbToJSON(str);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbml/core",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.4",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Holistics <dev@holistics.io>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,8 +32,7 @@
|
|
|
32
32
|
"prepublish": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@dbml/parse": "^3.7.
|
|
36
|
-
"@tediousjs/connection-string": "^0.5.0",
|
|
35
|
+
"@dbml/parse": "^3.7.4",
|
|
37
36
|
"antlr4": "^4.13.1",
|
|
38
37
|
"lodash": "^4.17.15",
|
|
39
38
|
"parsimmon": "^1.13.0",
|
|
@@ -60,7 +59,7 @@
|
|
|
60
59
|
"\\.(?!json$)[^.]*$": "@glen/jest-raw-loader"
|
|
61
60
|
}
|
|
62
61
|
},
|
|
63
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "316fd7ce4039ce9b622c30fbb2d03ab2198bd7eb",
|
|
64
63
|
"engines": {
|
|
65
64
|
"node": ">=16"
|
|
66
65
|
}
|
package/types/import/index.d.ts
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
declare function _import(str: string, format: 'dbml' | 'mysql' | 'postgres' | 'json' | 'mssql' | 'postgresLegacy'): string;
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @param {any} schemaJson
|
|
5
|
+
* @description Type of schemaJson is `DatabaseSchema`.
|
|
6
|
+
* The type definition of `DatabaseSchema` object can be found [here](https://github.com/holistics/dbml/blob/a4dcb110f1d79f5d95b0d3db4b919914439e039d/packages/dbml-connector/src/connectors/types.ts#L89)
|
|
7
|
+
*/
|
|
8
|
+
declare function generateDbml(schemaJson: any): string;
|
|
3
9
|
declare const _default: {
|
|
4
10
|
import: typeof _import;
|
|
5
11
|
generateDbml: typeof generateDbml;
|
|
@@ -10,6 +10,7 @@ interface RawTableGroup {
|
|
|
10
10
|
schema: Schema;
|
|
11
11
|
token: Token;
|
|
12
12
|
note: RawNote;
|
|
13
|
+
color: string;
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
declare class TableGroup extends Element {
|
|
@@ -20,8 +21,7 @@ declare class TableGroup extends Element {
|
|
|
20
21
|
id: number;
|
|
21
22
|
note: string;
|
|
22
23
|
noteToken: Token;
|
|
23
|
-
constructor({ name, token, tables, schema, note }: RawTableGroup
|
|
24
|
-
);
|
|
24
|
+
constructor({ name, token, tables, schema, note, color }: RawTableGroup);
|
|
25
25
|
generateId(): void;
|
|
26
26
|
processTables(rawTables: any): void;
|
|
27
27
|
pushTable(table: any): void;
|
|
@@ -33,6 +33,7 @@ declare class TableGroup extends Element {
|
|
|
33
33
|
}[];
|
|
34
34
|
name: string;
|
|
35
35
|
note: string;
|
|
36
|
+
color: string;
|
|
36
37
|
};
|
|
37
38
|
exportChild(): {
|
|
38
39
|
tables: {
|
|
@@ -49,6 +50,7 @@ declare class TableGroup extends Element {
|
|
|
49
50
|
shallowExport(): {
|
|
50
51
|
name: string;
|
|
51
52
|
note: string;
|
|
53
|
+
color: string;
|
|
52
54
|
};
|
|
53
55
|
normalize(model: NormalizedDatabase): void;
|
|
54
56
|
}
|
|
@@ -59,6 +61,7 @@ export interface NormalizedTableGroup {
|
|
|
59
61
|
tableIds: number[];
|
|
60
62
|
schemaId: number;
|
|
61
63
|
note: string;
|
|
64
|
+
color: string;
|
|
62
65
|
};
|
|
63
66
|
}
|
|
64
67
|
export default TableGroup;
|