@dbml/core 3.13.5 → 3.13.6

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 (162) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/lib/export/DbmlExporter.js +8 -10
  4. package/lib/export/JsonExporter.js +8 -10
  5. package/lib/export/ModelExporter.js +9 -11
  6. package/lib/export/MysqlExporter.js +14 -16
  7. package/lib/export/OracleExporter.js +17 -19
  8. package/lib/export/PostgresExporter.js +16 -18
  9. package/lib/export/README.md +0 -0
  10. package/lib/export/SqlServerExporter.js +14 -16
  11. package/lib/export/index.js +3 -4
  12. package/lib/export/utils.js +4 -0
  13. package/lib/import/index.js +3 -4
  14. package/lib/index.js +1 -1
  15. package/lib/model_structure/config.js +6 -12
  16. package/lib/model_structure/database.js +22 -26
  17. package/lib/model_structure/dbState.js +9 -11
  18. package/lib/model_structure/element.js +22 -25
  19. package/lib/model_structure/endpoint.js +26 -29
  20. package/lib/model_structure/enum.js +21 -24
  21. package/lib/model_structure/enumValue.js +21 -24
  22. package/lib/model_structure/field.js +21 -24
  23. package/lib/model_structure/indexColumn.js +21 -24
  24. package/lib/model_structure/indexes.js +21 -24
  25. package/lib/model_structure/ref.js +21 -24
  26. package/lib/model_structure/schema.js +21 -24
  27. package/lib/model_structure/stickyNote.js +21 -24
  28. package/lib/model_structure/table.js +26 -29
  29. package/lib/model_structure/tableGroup.js +21 -24
  30. package/lib/model_structure/tablePartial.js +21 -24
  31. package/lib/model_structure/utils.js +0 -0
  32. package/lib/parse/ANTLR/ASTGeneration/AST.js +21 -35
  33. package/lib/parse/ANTLR/ASTGeneration/ParserErrorListener.js +19 -22
  34. package/lib/parse/ANTLR/ASTGeneration/SyntaxError.js +21 -23
  35. package/lib/parse/ANTLR/ASTGeneration/constants.js +5 -9
  36. package/lib/parse/ANTLR/ASTGeneration/helpers.js +0 -0
  37. package/lib/parse/ANTLR/ASTGeneration/index.js +1 -1
  38. package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.js +55 -58
  39. package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.js +54 -58
  40. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgreSQLLexerBase.js +17 -19
  41. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgreSQLParserBase.js +17 -19
  42. package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.js +38 -42
  43. package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.js +28 -31
  44. package/lib/parse/ANTLR/README.md +0 -0
  45. package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.g4 +0 -0
  46. package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.interp +0 -0
  47. package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.js +19 -21
  48. package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.tokens +0 -0
  49. package/lib/parse/ANTLR/parsers/mssql/TSqlParser.g4 +0 -0
  50. package/lib/parse/ANTLR/parsers/mssql/TSqlParser.interp +0 -0
  51. package/lib/parse/ANTLR/parsers/mssql/TSqlParser.js +2 -2
  52. package/lib/parse/ANTLR/parsers/mssql/TSqlParser.tokens +0 -0
  53. package/lib/parse/ANTLR/parsers/mssql/TSqlParserVisitor.js +19 -22
  54. package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.g4 +0 -0
  55. package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.interp +0 -0
  56. package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.js +19 -21
  57. package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.tokens +0 -0
  58. package/lib/parse/ANTLR/parsers/mysql/MySqlParser.g4 +0 -0
  59. package/lib/parse/ANTLR/parsers/mysql/MySqlParser.interp +0 -0
  60. package/lib/parse/ANTLR/parsers/mysql/MySqlParser.js +2 -2
  61. package/lib/parse/ANTLR/parsers/mysql/MySqlParser.tokens +0 -0
  62. package/lib/parse/ANTLR/parsers/mysql/MySqlParserVisitor.js +19 -22
  63. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.g4 +0 -0
  64. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.interp +0 -0
  65. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.js +20 -23
  66. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.tokens +0 -0
  67. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.g4 +0 -0
  68. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.interp +0 -0
  69. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.js +2 -2
  70. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.tokens +0 -0
  71. package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParserVisitor.js +19 -22
  72. package/lib/parse/ANTLR/parsers/postgresql/README.md +0 -0
  73. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.g4 +0 -0
  74. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.interp +0 -0
  75. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.js +19 -21
  76. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.tokens +0 -0
  77. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.g4 +0 -0
  78. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.interp +0 -0
  79. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.js +2 -2
  80. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.tokens +0 -0
  81. package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParserVisitor.js +19 -22
  82. package/lib/parse/Parser.js +9 -11
  83. package/lib/parse/buildParser.js +6 -6
  84. package/lib/parse/databaseGenerator.js +3 -4
  85. package/lib/parse/dbml/parser.pegjs +0 -0
  86. package/lib/parse/dbmlParser.js +11 -11
  87. package/lib/parse/error.js +8 -10
  88. package/lib/parse/mssql/base_parsers.js +0 -0
  89. package/lib/parse/mssql/column_definition/actions.js +0 -0
  90. package/lib/parse/mssql/column_definition/index.js +0 -0
  91. package/lib/parse/mssql/constraint_definition/actions.js +6 -7
  92. package/lib/parse/mssql/constraint_definition/index.js +0 -0
  93. package/lib/parse/mssql/expression.js +0 -0
  94. package/lib/parse/mssql/fk_definition/actions.js +0 -0
  95. package/lib/parse/mssql/fk_definition/index.js +0 -0
  96. package/lib/parse/mssql/index.js +0 -0
  97. package/lib/parse/mssql/index_definition/actions.js +0 -0
  98. package/lib/parse/mssql/index_definition/index.js +0 -0
  99. package/lib/parse/mssql/keyword_parsers.js +0 -0
  100. package/lib/parse/mssql/keyword_utils.js +0 -0
  101. package/lib/parse/mssql/statements/actions.js +0 -0
  102. package/lib/parse/mssql/statements/index.js +0 -0
  103. package/lib/parse/mssql/statements/statement_types/alter_table/actions.js +0 -0
  104. package/lib/parse/mssql/statements/statement_types/alter_table/add/actions.js +0 -0
  105. package/lib/parse/mssql/statements/statement_types/alter_table/add/index.js +0 -0
  106. package/lib/parse/mssql/statements/statement_types/alter_table/index.js +0 -0
  107. package/lib/parse/mssql/statements/statement_types/comments/actions.js +0 -0
  108. package/lib/parse/mssql/statements/statement_types/comments/index.js +5 -5
  109. package/lib/parse/mssql/statements/statement_types/create_index/actions.js +0 -0
  110. package/lib/parse/mssql/statements/statement_types/create_index/index.js +0 -0
  111. package/lib/parse/mssql/statements/statement_types/create_table/actions.js +6 -6
  112. package/lib/parse/mssql/statements/statement_types/create_table/index.js +0 -0
  113. package/lib/parse/mssql/statements/statement_types/index.js +0 -0
  114. package/lib/parse/mssql/utils.js +1 -1
  115. package/lib/parse/mssql/whitespaces.js +0 -0
  116. package/lib/parse/mssqlParser.js +2 -3
  117. package/lib/parse/mysql/parser.pegjs +0 -0
  118. package/lib/parse/mysqlParser.js +11 -11
  119. package/lib/parse/postgresParser.js +1 -1
  120. package/lib/parse/postgresql/Base_rules.pegjs +0 -0
  121. package/lib/parse/postgresql/Commands/Alter_table/Alter_table.pegjs +0 -0
  122. package/lib/parse/postgresql/Commands/Commands.pegjs +0 -0
  123. package/lib/parse/postgresql/Commands/Comment.pegjs +0 -0
  124. package/lib/parse/postgresql/Commands/Create_index.pegjs +0 -0
  125. package/lib/parse/postgresql/Commands/Create_table/Create_table.pegjs +0 -0
  126. package/lib/parse/postgresql/Commands/Create_table/Create_table_normal.pegjs +0 -0
  127. package/lib/parse/postgresql/Commands/Create_table/Create_table_of.pegjs +0 -0
  128. package/lib/parse/postgresql/Commands/Create_table/Create_table_partition_of.pegjs +0 -0
  129. package/lib/parse/postgresql/Commands/Create_type/Create_type.pegjs +0 -0
  130. package/lib/parse/postgresql/Commands/Create_type/Create_type_enum.pegjs +0 -0
  131. package/lib/parse/postgresql/Commands/Create_type/Create_type_range.pegjs +0 -0
  132. package/lib/parse/postgresql/Commands/Ignore_syntax.pegjs +0 -0
  133. package/lib/parse/postgresql/Expression.pegjs +0 -0
  134. package/lib/parse/postgresql/InitializerUtils.pegjs +0 -0
  135. package/lib/parse/postgresql/Keywords.pegjs +0 -0
  136. package/lib/parse/postgresql/get_parser.js +1 -1
  137. package/lib/parse/postgresql/parser.pegjs +0 -0
  138. package/lib/parse/schemarb/parser.pegjs +0 -0
  139. package/lib/parse/schemarbParser.js +8 -10
  140. package/lib/utils/version.js +1 -2
  141. package/package.json +3 -3
  142. package/types/export/ModelExporter.d.ts +0 -0
  143. package/types/export/index.d.ts +0 -0
  144. package/types/import/index.d.ts +0 -0
  145. package/types/index.d.ts +0 -0
  146. package/types/model_structure/database.d.ts +0 -0
  147. package/types/model_structure/dbState.d.ts +0 -0
  148. package/types/model_structure/element.d.ts +0 -0
  149. package/types/model_structure/endpoint.d.ts +0 -0
  150. package/types/model_structure/enum.d.ts +0 -0
  151. package/types/model_structure/enumValue.d.ts +0 -0
  152. package/types/model_structure/field.d.ts +0 -0
  153. package/types/model_structure/indexColumn.d.ts +0 -0
  154. package/types/model_structure/indexes.d.ts +0 -0
  155. package/types/model_structure/ref.d.ts +0 -0
  156. package/types/model_structure/schema.d.ts +0 -0
  157. package/types/model_structure/stickyNote.d.ts +0 -0
  158. package/types/model_structure/table.d.ts +0 -0
  159. package/types/model_structure/tableGroup.d.ts +0 -0
  160. package/types/model_structure/tablePartial.d.ts +0 -0
  161. package/types/parse/Parser.d.ts +0 -0
  162. package/types/parse/error.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- 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); }
3
+ 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); }
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -9,32 +9,32 @@ var _lodash = require("lodash");
9
9
  var _PostgreSQLParserVisitor = _interopRequireDefault(require("../../parsers/postgresql/PostgreSQLParserVisitor"));
10
10
  var _AST = require("../AST");
11
11
  var _constants = require("../constants");
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
- 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; }
14
- 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; }
15
- 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; }
16
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
12
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
13
+ 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; }
14
+ 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; }
15
+ 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; }
16
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
17
17
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
18
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
19
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
20
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
18
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
19
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
20
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
21
21
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
22
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
23
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
24
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
25
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
26
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
28
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
29
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
30
- 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); }
31
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
32
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
34
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
35
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
36
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /* eslint-disable no-param-reassign */ /* eslint-disable consistent-return */ /* eslint-disable class-methods-use-this */
22
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
23
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
24
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
25
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
26
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
27
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
28
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
29
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
30
+ 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); }
31
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
32
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
33
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
34
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
35
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
36
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
37
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } /* eslint-disable no-param-reassign */ /* eslint-disable consistent-return */ /* eslint-disable class-methods-use-this */
38
38
  var COMMAND_KIND = {
39
39
  REF: 'ref'
40
40
  };
@@ -55,13 +55,11 @@ var escapeStr = function escapeStr(str) {
55
55
  }
56
56
  return str;
57
57
  };
58
- var PostgresASTGen = /*#__PURE__*/function (_PostgreSQLParserVisi) {
59
- _inherits(PostgresASTGen, _PostgreSQLParserVisi);
60
- var _super = _createSuper(PostgresASTGen);
58
+ var PostgresASTGen = exports["default"] = /*#__PURE__*/function (_PostgreSQLParserVisi) {
61
59
  function PostgresASTGen() {
62
60
  var _this;
63
61
  _classCallCheck(this, PostgresASTGen);
64
- _this = _super.call(this);
62
+ _this = _callSuper(this, PostgresASTGen);
65
63
  _this.data = {
66
64
  schemas: [],
67
65
  tables: [],
@@ -76,7 +74,8 @@ var PostgresASTGen = /*#__PURE__*/function (_PostgreSQLParserVisi) {
76
74
  }
77
75
 
78
76
  // stmtblock EOF
79
- _createClass(PostgresASTGen, [{
77
+ _inherits(PostgresASTGen, _PostgreSQLParserVisi);
78
+ return _createClass(PostgresASTGen, [{
80
79
  key: "visitRoot",
81
80
  value: function visitRoot(ctx) {
82
81
  ctx.stmtblock().accept(this);
@@ -249,7 +248,6 @@ var PostgresASTGen = /*#__PURE__*/function (_PostgreSQLParserVisi) {
249
248
  // },
250
249
  };
251
250
  }
252
-
253
251
  if (ctx.FOREIGN()) {
254
252
  var _ctx$opt_column_list$;
255
253
  var names = ctx.qualified_name().accept(this);
@@ -1110,9 +1108,9 @@ var PostgresASTGen = /*#__PURE__*/function (_PostgreSQLParserVisi) {
1110
1108
  }, {
1111
1109
  key: "visitAttrs",
1112
1110
  value: function visitAttrs(ctx) {
1113
- var _this10 = this;
1111
+ var _this0 = this;
1114
1112
  return ctx.attr_name().map(function (a) {
1115
- return a.accept(_this10);
1113
+ return a.accept(_this0);
1116
1114
  });
1117
1115
  }
1118
1116
 
@@ -1170,9 +1168,9 @@ var PostgresASTGen = /*#__PURE__*/function (_PostgreSQLParserVisi) {
1170
1168
  }, {
1171
1169
  key: "visitEnum_val_list",
1172
1170
  value: function visitEnum_val_list(ctx) {
1173
- var _this11 = this;
1171
+ var _this1 = this;
1174
1172
  return ctx.sconst().map(function (s) {
1175
- return s.accept(_this11);
1173
+ return s.accept(_this1);
1176
1174
  });
1177
1175
  }
1178
1176
 
@@ -1255,9 +1253,9 @@ var PostgresASTGen = /*#__PURE__*/function (_PostgreSQLParserVisi) {
1255
1253
  }, {
1256
1254
  key: "visitInsert_column_list",
1257
1255
  value: function visitInsert_column_list(ctx) {
1258
- var _this12 = this;
1256
+ var _this10 = this;
1259
1257
  return ctx.insert_column_item().map(function (colItem) {
1260
- return colItem.accept(_this12);
1258
+ return colItem.accept(_this10);
1261
1259
  });
1262
1260
  }
1263
1261
 
@@ -1332,9 +1330,9 @@ var PostgresASTGen = /*#__PURE__*/function (_PostgreSQLParserVisi) {
1332
1330
  }, {
1333
1331
  key: "visitValues_clause",
1334
1332
  value: function visitValues_clause(ctx) {
1335
- var _this13 = this;
1333
+ var _this11 = this;
1336
1334
  return ctx.expr_list().map(function (expr) {
1337
- var rawValues = expr.accept(_this13);
1335
+ var rawValues = expr.accept(_this11);
1338
1336
 
1339
1337
  // We get the value of the c_expr through:
1340
1338
  // a_expr->a_expr_qual->a_expr_lessless->a_expr_or->a_expr_and->
@@ -1389,6 +1387,4 @@ var PostgresASTGen = /*#__PURE__*/function (_PostgreSQLParserVisi) {
1389
1387
  }, rawType);
1390
1388
  }
1391
1389
  }]);
1392
- return PostgresASTGen;
1393
- }(_PostgreSQLParserVisitor["default"]);
1394
- exports["default"] = PostgresASTGen;
1390
+ }(_PostgreSQLParserVisitor["default"]);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- 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); }
3
+ 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); }
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
@@ -10,39 +10,37 @@ var _SnowflakeParserVisitor = _interopRequireDefault(require("../../parsers/snow
10
10
  var _AST = require("../AST");
11
11
  var _constants = require("../constants");
12
12
  var _helpers = require("../helpers");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
14
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
13
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
14
+ function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
15
15
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
17
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+ function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
17
+ function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
18
+ function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
19
19
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
20
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
21
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
22
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
23
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
24
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
25
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
26
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
27
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
28
- 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); }
29
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
30
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
31
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
32
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
33
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
34
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
35
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /* eslint-disable class-methods-use-this */
20
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
21
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
22
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
23
+ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
24
+ function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
25
+ function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
26
+ function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
27
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
28
+ 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); }
29
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
30
+ function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); }
31
+ function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; }
32
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
33
+ function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); }
34
+ function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); }
35
+ function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } /* eslint-disable class-methods-use-this */
36
36
  var sanitizeComment = function sanitizeComment(stringContext) {
37
37
  return (0, _helpers.getOriginalText)(stringContext).replace(/''/g, "'").slice(1, -1);
38
38
  };
39
- var SnowflakeASTGen = /*#__PURE__*/function (_SnowflakeParserVisit) {
40
- _inherits(SnowflakeASTGen, _SnowflakeParserVisit);
41
- var _super = _createSuper(SnowflakeASTGen);
39
+ var SnowflakeASTGen = exports["default"] = /*#__PURE__*/function (_SnowflakeParserVisit) {
42
40
  function SnowflakeASTGen() {
43
41
  var _this;
44
42
  _classCallCheck(this, SnowflakeASTGen);
45
- _this = _super.call(this);
43
+ _this = _callSuper(this, SnowflakeASTGen);
46
44
  _this.data = {
47
45
  schemas: [],
48
46
  tables: [],
@@ -56,11 +54,12 @@ var SnowflakeASTGen = /*#__PURE__*/function (_SnowflakeParserVisit) {
56
54
  }
57
55
 
58
56
  // batch? EOF
59
- _createClass(SnowflakeASTGen, [{
57
+ _inherits(SnowflakeASTGen, _SnowflakeParserVisit);
58
+ return _createClass(SnowflakeASTGen, [{
60
59
  key: "visitSnowflake_file",
61
60
  value: function visitSnowflake_file(ctx) {
62
61
  var _ctx$batch;
63
- (_ctx$batch = ctx.batch()) === null || _ctx$batch === void 0 ? void 0 : _ctx$batch.accept(this);
62
+ (_ctx$batch = ctx.batch()) === null || _ctx$batch === void 0 || _ctx$batch.accept(this);
64
63
  return this.data;
65
64
  }
66
65
 
@@ -745,6 +744,4 @@ var SnowflakeASTGen = /*#__PURE__*/function (_SnowflakeParserVisit) {
745
744
  return null;
746
745
  }
747
746
  }]);
748
- return SnowflakeASTGen;
749
- }(_SnowflakeParserVisitor["default"]);
750
- exports["default"] = SnowflakeASTGen;
747
+ }(_SnowflakeParserVisitor["default"]);
File without changes
File without changes
File without changes