@dbml/core 3.0.0 → 3.1.1
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/model_structure/database.js +5 -3
- package/lib/model_structure/enum.js +6 -3
- package/lib/model_structure/enumValue.js +6 -3
- package/lib/model_structure/field.js +6 -3
- package/lib/model_structure/schema.js +6 -3
- package/lib/model_structure/table.js +6 -3
- package/lib/parse/ANTLR/ASTGeneration/AST.js +54 -8
- package/lib/parse/ANTLR/ASTGeneration/ParserErrorListener.js +11 -6
- package/lib/parse/ANTLR/ASTGeneration/constants.js +39 -0
- package/lib/parse/ANTLR/ASTGeneration/index.js +33 -11
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.js +1148 -0
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.js +64 -62
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.g4 +1357 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.interp +3515 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.js +1211 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.tokens +2300 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.g4 +3494 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.interp +2694 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.js +3 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.tokens +2300 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParserVisitor.js +4360 -0
- package/lib/parse/Parser.js +8 -0
- package/package.json +3 -3
package/lib/parse/Parser.js
CHANGED
|
@@ -30,6 +30,9 @@ var Parser = /*#__PURE__*/function () {
|
|
|
30
30
|
var rawDatabase = {};
|
|
31
31
|
switch (format) {
|
|
32
32
|
case 'mysql':
|
|
33
|
+
rawDatabase = Parser.parseMySQLToJSONv2(str);
|
|
34
|
+
break;
|
|
35
|
+
case 'mysqlLegacy':
|
|
33
36
|
rawDatabase = Parser.parseMySQLToJSON(str);
|
|
34
37
|
break;
|
|
35
38
|
case 'postgres':
|
|
@@ -91,6 +94,11 @@ var Parser = /*#__PURE__*/function () {
|
|
|
91
94
|
var database = new _database["default"](rawDatabase);
|
|
92
95
|
return database;
|
|
93
96
|
}
|
|
97
|
+
}, {
|
|
98
|
+
key: "parseMySQLToJSONv2",
|
|
99
|
+
value: function parseMySQLToJSONv2(str) {
|
|
100
|
+
return (0, _ASTGeneration.parse)(str, 'mysql');
|
|
101
|
+
}
|
|
94
102
|
}, {
|
|
95
103
|
key: "parseMySQLToJSON",
|
|
96
104
|
value: function parseMySQLToJSON(str) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbml/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "> TODO: description",
|
|
5
5
|
"author": "Holistics <dev@holistics.io>",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"prepublish": "npm run build"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@dbml/parse": "^3.
|
|
35
|
+
"@dbml/parse": "^3.1.1",
|
|
36
36
|
"antlr4": "^4.13.1",
|
|
37
37
|
"lodash": "^4.17.15",
|
|
38
38
|
"parsimmon": "^1.13.0",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"\\.(?!json$)[^.]*$": "@glen/jest-raw-loader"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "16ea54e5e369de55554da73e25e7f87d56199399"
|
|
63
63
|
}
|