@dbml/core 3.13.5 → 3.13.7-alpha.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 (66) hide show
  1. package/lib/export/DbmlExporter.js +8 -10
  2. package/lib/export/JsonExporter.js +8 -10
  3. package/lib/export/ModelExporter.js +9 -11
  4. package/lib/export/MysqlExporter.js +14 -16
  5. package/lib/export/OracleExporter.js +17 -19
  6. package/lib/export/PostgresExporter.js +16 -18
  7. package/lib/export/SqlServerExporter.js +14 -16
  8. package/lib/export/index.js +3 -4
  9. package/lib/export/utils.js +4 -0
  10. package/lib/import/index.js +3 -4
  11. package/lib/index.js +1 -1
  12. package/lib/model_structure/config.js +6 -12
  13. package/lib/model_structure/database.js +22 -26
  14. package/lib/model_structure/dbState.js +9 -11
  15. package/lib/model_structure/element.js +22 -25
  16. package/lib/model_structure/endpoint.js +26 -29
  17. package/lib/model_structure/enum.js +21 -24
  18. package/lib/model_structure/enumValue.js +21 -24
  19. package/lib/model_structure/field.js +21 -24
  20. package/lib/model_structure/indexColumn.js +21 -24
  21. package/lib/model_structure/indexes.js +21 -24
  22. package/lib/model_structure/ref.js +21 -24
  23. package/lib/model_structure/schema.js +21 -24
  24. package/lib/model_structure/stickyNote.js +21 -24
  25. package/lib/model_structure/table.js +26 -29
  26. package/lib/model_structure/tableGroup.js +21 -24
  27. package/lib/model_structure/tablePartial.js +21 -24
  28. package/lib/parse/ANTLR/ASTGeneration/AST.js +21 -35
  29. package/lib/parse/ANTLR/ASTGeneration/ParserErrorListener.js +19 -22
  30. package/lib/parse/ANTLR/ASTGeneration/SyntaxError.js +21 -23
  31. package/lib/parse/ANTLR/ASTGeneration/constants.js +5 -9
  32. package/lib/parse/ANTLR/ASTGeneration/index.js +1 -1
  33. package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.js +55 -58
  34. package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.js +54 -58
  35. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgreSQLLexerBase.js +17 -19
  36. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgreSQLParserBase.js +17 -19
  37. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.js +38 -42
  38. package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.js +28 -31
  39. package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.js +19 -21
  40. package/lib/parse/ANTLR/parsers/mssql/TSqlParser.js +2 -2
  41. package/lib/parse/ANTLR/parsers/mssql/TSqlParserVisitor.js +19 -22
  42. package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.js +19 -21
  43. package/lib/parse/ANTLR/parsers/mysql/MySqlParser.js +2 -2
  44. package/lib/parse/ANTLR/parsers/mysql/MySqlParserVisitor.js +19 -22
  45. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.js +20 -23
  46. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.js +2 -2
  47. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParserVisitor.js +19 -22
  48. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.js +19 -21
  49. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.js +2 -2
  50. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParserVisitor.js +19 -22
  51. package/lib/parse/Parser.js +9 -11
  52. package/lib/parse/buildParser.js +6 -6
  53. package/lib/parse/databaseGenerator.js +3 -4
  54. package/lib/parse/dbmlParser.js +11 -11
  55. package/lib/parse/error.js +8 -10
  56. package/lib/parse/mssql/constraint_definition/actions.js +6 -7
  57. package/lib/parse/mssql/statements/statement_types/comments/index.js +5 -5
  58. package/lib/parse/mssql/statements/statement_types/create_table/actions.js +6 -6
  59. package/lib/parse/mssql/utils.js +1 -1
  60. package/lib/parse/mssqlParser.js +2 -3
  61. package/lib/parse/mysqlParser.js +11 -11
  62. package/lib/parse/postgresParser.js +1 -1
  63. package/lib/parse/postgresql/get_parser.js +1 -1
  64. package/lib/parse/schemarbParser.js +8 -10
  65. package/lib/utils/version.js +1 -2
  66. package/package.json +6 -3
@@ -6,12 +6,12 @@
6
6
 
7
7
  "use strict";
8
8
 
9
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
11
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
12
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
13
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
15
15
  var _ = require("lodash"),
16
16
  pluralize = require("pluralize");
17
17
  function peg$subclass(child, parent) {
@@ -161,7 +161,6 @@ function peg$parse(input, options) {
161
161
  fields: addPrimaryKey(body.fields)
162
162
  // index: _.union(...body.index)
163
163
  };
164
-
165
164
  return {
166
165
  table: table,
167
166
  refs: createRefFromTableWithReference(table, body.references)
@@ -2294,7 +2293,7 @@ function peg$parse(input, options) {
2294
2293
  return table.name === referenceTable;
2295
2294
  });
2296
2295
  if (!toTable) {
2297
- return "continue";
2296
+ return 1; // continue
2298
2297
  }
2299
2298
  // add field to table if not exists (`${reference}_id`)
2300
2299
  // auto add type of new field to be varchar if primaryKey not found
@@ -2328,8 +2327,7 @@ function peg$parse(input, options) {
2328
2327
  });
2329
2328
  };
2330
2329
  for (var i = 0; i < references.length; i += 1) {
2331
- var _ret = _loop();
2332
- if (_ret === "continue") continue;
2330
+ if (_loop()) continue;
2333
2331
  }
2334
2332
  return refs;
2335
2333
  }
@@ -5,5 +5,4 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.VERSION = void 0;
7
7
  var _package = require("../../package.json");
8
- var VERSION = _package.version;
9
- exports.VERSION = VERSION;
8
+ var VERSION = exports.VERSION = _package.version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbml/core",
3
- "version": "3.13.5",
3
+ "version": "3.13.7-alpha.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.13.5",
35
+ "@dbml/parse": "^3.13.7-alpha.0",
36
36
  "antlr4": "^4.13.1",
37
37
  "lodash": "^4.17.15",
38
38
  "parsimmon": "^1.13.0",
@@ -57,9 +57,12 @@
57
57
  "transform": {
58
58
  "^.+\\.js$": "babel-jest",
59
59
  "\\.(?!json$)[^.]*$": "@glen/jest-raw-loader"
60
+ },
61
+ "moduleNameMapper": {
62
+ "^lodash-es$": "lodash"
60
63
  }
61
64
  },
62
- "gitHead": "7496d9e42bdd83b9605fe620234433afca3f0d37",
65
+ "gitHead": "b75ba3ddb06e870cf797392398c6037c03904284",
63
66
  "engines": {
64
67
  "node": ">=16"
65
68
  }