@dbml/core 3.0.0 → 3.1.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.
Files changed (27) hide show
  1. package/lib/model_structure/database.js +5 -3
  2. package/lib/model_structure/enum.js +6 -3
  3. package/lib/model_structure/enumValue.js +6 -3
  4. package/lib/model_structure/field.js +6 -3
  5. package/lib/model_structure/schema.js +6 -3
  6. package/lib/model_structure/table.js +6 -3
  7. package/lib/parse/ANTLR/ASTGeneration/AST.js +54 -8
  8. package/lib/parse/ANTLR/ASTGeneration/ParserErrorListener.js +11 -6
  9. package/lib/parse/ANTLR/ASTGeneration/constants.js +39 -0
  10. package/lib/parse/ANTLR/ASTGeneration/index.js +33 -11
  11. package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.js +1148 -0
  12. package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLBaseCommon.js +31 -0
  13. package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLBaseLexer.js +40 -0
  14. package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLBaseRecognizer.js +32 -0
  15. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.js +64 -62
  16. package/lib/parse/ANTLR/parsers/mysql/MySQLLexer.g4 +1357 -0
  17. package/lib/parse/ANTLR/parsers/mysql/MySQLLexer.interp +3515 -0
  18. package/lib/parse/ANTLR/parsers/mysql/MySQLLexer.js +1211 -0
  19. package/lib/parse/ANTLR/parsers/mysql/MySQLLexer.tokens +2300 -0
  20. package/lib/parse/ANTLR/parsers/mysql/MySQLParser.g4 +3494 -0
  21. package/lib/parse/ANTLR/parsers/mysql/MySQLParser.interp +2694 -0
  22. package/lib/parse/ANTLR/parsers/mysql/MySQLParser.js +3 -0
  23. package/lib/parse/ANTLR/parsers/mysql/MySQLParser.tokens +2300 -0
  24. package/lib/parse/ANTLR/parsers/mysql/MySQLParserVisitor.js +4360 -0
  25. package/lib/parse/ANTLR/parsers/mysql/predefined.tokens +744 -0
  26. package/lib/parse/Parser.js +8 -0
  27. package/package.json +3 -3
@@ -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.0.0",
3
+ "version": "3.1.0",
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.0.0",
35
+ "@dbml/parse": "^3.1.0",
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": "d475bdf2122e26b3b2c3bb00c67124b5e669ba10"
62
+ "gitHead": "a8c31e65df64b80342dab379c2889b3dca92ac3c"
63
63
  }