@dbml/core 3.13.5-alpha.1 → 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.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/lib/export/DbmlExporter.js +8 -10
- package/lib/export/JsonExporter.js +8 -10
- package/lib/export/ModelExporter.js +9 -11
- package/lib/export/MysqlExporter.js +14 -16
- package/lib/export/OracleExporter.js +17 -19
- package/lib/export/PostgresExporter.js +16 -18
- package/lib/export/README.md +0 -0
- package/lib/export/SqlServerExporter.js +14 -16
- package/lib/export/index.js +3 -4
- package/lib/export/utils.js +4 -0
- package/lib/import/index.js +3 -4
- package/lib/index.js +1 -1
- package/lib/model_structure/config.js +6 -12
- package/lib/model_structure/database.js +22 -26
- package/lib/model_structure/dbState.js +9 -11
- package/lib/model_structure/element.js +22 -25
- package/lib/model_structure/endpoint.js +26 -29
- package/lib/model_structure/enum.js +21 -24
- package/lib/model_structure/enumValue.js +21 -24
- package/lib/model_structure/field.js +21 -24
- package/lib/model_structure/indexColumn.js +21 -24
- package/lib/model_structure/indexes.js +21 -24
- package/lib/model_structure/ref.js +21 -24
- package/lib/model_structure/schema.js +21 -24
- package/lib/model_structure/stickyNote.js +21 -24
- package/lib/model_structure/table.js +26 -29
- package/lib/model_structure/tableGroup.js +21 -24
- package/lib/model_structure/tablePartial.js +21 -24
- package/lib/model_structure/utils.js +0 -0
- package/lib/parse/ANTLR/ASTGeneration/AST.js +21 -35
- package/lib/parse/ANTLR/ASTGeneration/ParserErrorListener.js +19 -22
- package/lib/parse/ANTLR/ASTGeneration/SyntaxError.js +21 -23
- package/lib/parse/ANTLR/ASTGeneration/constants.js +5 -9
- package/lib/parse/ANTLR/ASTGeneration/helpers.js +0 -0
- package/lib/parse/ANTLR/ASTGeneration/index.js +1 -1
- package/lib/parse/ANTLR/ASTGeneration/mssql/MssqlASTGen.js +55 -58
- package/lib/parse/ANTLR/ASTGeneration/mysql/MySQLASTGen.js +54 -58
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgreSQLLexerBase.js +17 -19
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgreSQLParserBase.js +17 -19
- package/lib/parse/ANTLR/ASTGeneration/postgres/PostgresASTGen.js +38 -42
- package/lib/parse/ANTLR/ASTGeneration/snowflake/SnowflakeASTGen.js +28 -31
- package/lib/parse/ANTLR/README.md +0 -0
- package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.g4 +0 -0
- package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.interp +0 -0
- package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.js +19 -21
- package/lib/parse/ANTLR/parsers/mssql/TSqlLexer.tokens +0 -0
- package/lib/parse/ANTLR/parsers/mssql/TSqlParser.g4 +0 -0
- package/lib/parse/ANTLR/parsers/mssql/TSqlParser.interp +0 -0
- package/lib/parse/ANTLR/parsers/mssql/TSqlParser.js +2 -2
- package/lib/parse/ANTLR/parsers/mssql/TSqlParser.tokens +0 -0
- package/lib/parse/ANTLR/parsers/mssql/TSqlParserVisitor.js +19 -22
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.g4 +0 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.interp +0 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.js +19 -21
- package/lib/parse/ANTLR/parsers/mysql/MySqlLexer.tokens +0 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.g4 +0 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.interp +0 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.js +2 -2
- package/lib/parse/ANTLR/parsers/mysql/MySqlParser.tokens +0 -0
- package/lib/parse/ANTLR/parsers/mysql/MySqlParserVisitor.js +19 -22
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.g4 +0 -0
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.interp +0 -0
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.js +20 -23
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLLexer.tokens +0 -0
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.g4 +0 -0
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.interp +0 -0
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.js +2 -2
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParser.tokens +0 -0
- package/lib/parse/ANTLR/parsers/postgresql/PostgreSQLParserVisitor.js +19 -22
- package/lib/parse/ANTLR/parsers/postgresql/README.md +0 -0
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.g4 +0 -0
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.interp +0 -0
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.js +19 -21
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeLexer.tokens +0 -0
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.g4 +0 -0
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.interp +0 -0
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.js +2 -2
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParser.tokens +0 -0
- package/lib/parse/ANTLR/parsers/snowflake/SnowflakeParserVisitor.js +19 -22
- package/lib/parse/Parser.js +9 -11
- package/lib/parse/buildParser.js +6 -6
- package/lib/parse/databaseGenerator.js +3 -4
- package/lib/parse/dbml/parser.pegjs +0 -0
- package/lib/parse/dbmlParser.js +11 -11
- package/lib/parse/error.js +8 -10
- package/lib/parse/mssql/base_parsers.js +0 -0
- package/lib/parse/mssql/column_definition/actions.js +0 -0
- package/lib/parse/mssql/column_definition/index.js +0 -0
- package/lib/parse/mssql/constraint_definition/actions.js +6 -7
- package/lib/parse/mssql/constraint_definition/index.js +0 -0
- package/lib/parse/mssql/expression.js +0 -0
- package/lib/parse/mssql/fk_definition/actions.js +0 -0
- package/lib/parse/mssql/fk_definition/index.js +0 -0
- package/lib/parse/mssql/index.js +0 -0
- package/lib/parse/mssql/index_definition/actions.js +0 -0
- package/lib/parse/mssql/index_definition/index.js +0 -0
- package/lib/parse/mssql/keyword_parsers.js +0 -0
- package/lib/parse/mssql/keyword_utils.js +0 -0
- package/lib/parse/mssql/statements/actions.js +0 -0
- package/lib/parse/mssql/statements/index.js +0 -0
- package/lib/parse/mssql/statements/statement_types/alter_table/actions.js +0 -0
- package/lib/parse/mssql/statements/statement_types/alter_table/add/actions.js +0 -0
- package/lib/parse/mssql/statements/statement_types/alter_table/add/index.js +0 -0
- package/lib/parse/mssql/statements/statement_types/alter_table/index.js +0 -0
- package/lib/parse/mssql/statements/statement_types/comments/actions.js +0 -0
- package/lib/parse/mssql/statements/statement_types/comments/index.js +5 -5
- package/lib/parse/mssql/statements/statement_types/create_index/actions.js +0 -0
- package/lib/parse/mssql/statements/statement_types/create_index/index.js +0 -0
- package/lib/parse/mssql/statements/statement_types/create_table/actions.js +6 -6
- package/lib/parse/mssql/statements/statement_types/create_table/index.js +0 -0
- package/lib/parse/mssql/statements/statement_types/index.js +0 -0
- package/lib/parse/mssql/utils.js +1 -1
- package/lib/parse/mssql/whitespaces.js +0 -0
- package/lib/parse/mssqlParser.js +2 -3
- package/lib/parse/mysql/parser.pegjs +0 -0
- package/lib/parse/mysqlParser.js +11 -11
- package/lib/parse/postgresParser.js +1 -1
- package/lib/parse/postgresql/Base_rules.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Alter_table/Alter_table.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Commands.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Comment.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Create_index.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Create_table/Create_table.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Create_table/Create_table_normal.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Create_table/Create_table_of.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Create_table/Create_table_partition_of.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Create_type/Create_type.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Create_type/Create_type_enum.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Create_type/Create_type_range.pegjs +0 -0
- package/lib/parse/postgresql/Commands/Ignore_syntax.pegjs +0 -0
- package/lib/parse/postgresql/Expression.pegjs +0 -0
- package/lib/parse/postgresql/InitializerUtils.pegjs +0 -0
- package/lib/parse/postgresql/Keywords.pegjs +0 -0
- package/lib/parse/postgresql/get_parser.js +1 -1
- package/lib/parse/postgresql/parser.pegjs +0 -0
- package/lib/parse/schemarb/parser.pegjs +0 -0
- package/lib/parse/schemarbParser.js +8 -10
- package/lib/utils/version.js +1 -2
- package/package.json +3 -3
- package/types/export/ModelExporter.d.ts +0 -0
- package/types/export/index.d.ts +0 -0
- package/types/import/index.d.ts +0 -0
- package/types/index.d.ts +0 -0
- package/types/model_structure/database.d.ts +0 -0
- package/types/model_structure/dbState.d.ts +0 -0
- package/types/model_structure/element.d.ts +0 -0
- package/types/model_structure/endpoint.d.ts +0 -0
- package/types/model_structure/enum.d.ts +0 -0
- package/types/model_structure/enumValue.d.ts +0 -0
- package/types/model_structure/field.d.ts +0 -0
- package/types/model_structure/indexColumn.d.ts +0 -0
- package/types/model_structure/indexes.d.ts +0 -0
- package/types/model_structure/ref.d.ts +0 -0
- package/types/model_structure/schema.d.ts +0 -0
- package/types/model_structure/stickyNote.d.ts +0 -0
- package/types/model_structure/table.d.ts +0 -0
- package/types/model_structure/tableGroup.d.ts +0 -0
- package/types/model_structure/tablePartial.d.ts +0 -0
- package/types/parse/Parser.d.ts +0 -0
- package/types/parse/error.d.ts +0 -0
package/LICENSE
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
File without changes
|
|
@@ -7,17 +7,17 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _lodash = require("lodash");
|
|
8
8
|
var _utils = require("./utils");
|
|
9
9
|
var _config = require("../model_structure/config");
|
|
10
|
-
function _typeof(
|
|
11
|
-
function _classCallCheck(
|
|
12
|
-
function _defineProperties(
|
|
13
|
-
function _createClass(
|
|
14
|
-
function _toPropertyKey(
|
|
15
|
-
function _toPrimitive(
|
|
10
|
+
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); }
|
|
11
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
12
|
+
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); } }
|
|
13
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
14
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
15
|
+
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); }
|
|
16
16
|
var DbmlExporter = /*#__PURE__*/function () {
|
|
17
17
|
function DbmlExporter() {
|
|
18
18
|
_classCallCheck(this, DbmlExporter);
|
|
19
19
|
}
|
|
20
|
-
_createClass(DbmlExporter, null, [{
|
|
20
|
+
return _createClass(DbmlExporter, null, [{
|
|
21
21
|
key: "hasWhiteSpace",
|
|
22
22
|
value: function hasWhiteSpace(str) {
|
|
23
23
|
return /\s/g.test(str);
|
|
@@ -322,7 +322,5 @@ var DbmlExporter = /*#__PURE__*/function () {
|
|
|
322
322
|
return elementStrs.join('\n');
|
|
323
323
|
}
|
|
324
324
|
}]);
|
|
325
|
-
return DbmlExporter;
|
|
326
325
|
}();
|
|
327
|
-
var _default = DbmlExporter;
|
|
328
|
-
exports["default"] = _default;
|
|
326
|
+
var _default = exports["default"] = DbmlExporter;
|
|
@@ -4,17 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports["default"] = void 0;
|
|
7
|
-
function _typeof(
|
|
8
|
-
function _classCallCheck(
|
|
9
|
-
function _defineProperties(
|
|
10
|
-
function _createClass(
|
|
11
|
-
function _toPropertyKey(
|
|
12
|
-
function _toPrimitive(
|
|
7
|
+
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); }
|
|
8
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
9
|
+
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); } }
|
|
10
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
11
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
12
|
+
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); }
|
|
13
13
|
var JsonExporter = /*#__PURE__*/function () {
|
|
14
14
|
function JsonExporter() {
|
|
15
15
|
_classCallCheck(this, JsonExporter);
|
|
16
16
|
}
|
|
17
|
-
_createClass(JsonExporter, null, [{
|
|
17
|
+
return _createClass(JsonExporter, null, [{
|
|
18
18
|
key: "export",
|
|
19
19
|
value: function _export(model) {
|
|
20
20
|
var isNormalized = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
@@ -24,7 +24,5 @@ var JsonExporter = /*#__PURE__*/function () {
|
|
|
24
24
|
return JSON.stringify(model, null, 2);
|
|
25
25
|
}
|
|
26
26
|
}]);
|
|
27
|
-
return JsonExporter;
|
|
28
27
|
}();
|
|
29
|
-
var _default = JsonExporter;
|
|
30
|
-
exports["default"] = _default;
|
|
28
|
+
var _default = exports["default"] = JsonExporter;
|
|
@@ -10,18 +10,18 @@ var _PostgresExporter = _interopRequireDefault(require("./PostgresExporter"));
|
|
|
10
10
|
var _JsonExporter = _interopRequireDefault(require("./JsonExporter"));
|
|
11
11
|
var _SqlServerExporter = _interopRequireDefault(require("./SqlServerExporter"));
|
|
12
12
|
var _OracleExporter = _interopRequireDefault(require("./OracleExporter"));
|
|
13
|
-
function _interopRequireDefault(
|
|
14
|
-
function _typeof(
|
|
15
|
-
function _classCallCheck(
|
|
16
|
-
function _defineProperties(
|
|
17
|
-
function _createClass(
|
|
18
|
-
function _toPropertyKey(
|
|
19
|
-
function _toPrimitive(
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
14
|
+
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); }
|
|
15
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
16
|
+
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); } }
|
|
17
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
18
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
19
|
+
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); }
|
|
20
20
|
var ModelExporter = /*#__PURE__*/function () {
|
|
21
21
|
function ModelExporter() {
|
|
22
22
|
_classCallCheck(this, ModelExporter);
|
|
23
23
|
}
|
|
24
|
-
_createClass(ModelExporter, null, [{
|
|
24
|
+
return _createClass(ModelExporter, null, [{
|
|
25
25
|
key: "export",
|
|
26
26
|
value: function _export() {
|
|
27
27
|
var model = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
@@ -54,7 +54,5 @@ var ModelExporter = /*#__PURE__*/function () {
|
|
|
54
54
|
return res;
|
|
55
55
|
}
|
|
56
56
|
}]);
|
|
57
|
-
return ModelExporter;
|
|
58
57
|
}();
|
|
59
|
-
var _default = ModelExporter;
|
|
60
|
-
exports["default"] = _default;
|
|
58
|
+
var _default = exports["default"] = ModelExporter;
|
|
@@ -6,24 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
8
|
var _utils = require("./utils");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function _typeof(
|
|
11
|
-
function _toConsumableArray(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
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); }
|
|
11
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
12
12
|
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."); }
|
|
13
|
-
function _unsupportedIterableToArray(
|
|
14
|
-
function _iterableToArray(
|
|
15
|
-
function _arrayWithoutHoles(
|
|
16
|
-
function _arrayLikeToArray(
|
|
17
|
-
function _classCallCheck(
|
|
18
|
-
function _defineProperties(
|
|
19
|
-
function _createClass(
|
|
20
|
-
function _toPropertyKey(
|
|
21
|
-
function _toPrimitive(
|
|
13
|
+
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; } }
|
|
14
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
15
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
16
|
+
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; }
|
|
17
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
18
|
+
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); } }
|
|
19
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
21
|
+
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); }
|
|
22
22
|
var MySQLExporter = /*#__PURE__*/function () {
|
|
23
23
|
function MySQLExporter() {
|
|
24
24
|
_classCallCheck(this, MySQLExporter);
|
|
25
25
|
}
|
|
26
|
-
_createClass(MySQLExporter, null, [{
|
|
26
|
+
return _createClass(MySQLExporter, null, [{
|
|
27
27
|
key: "getFieldLines",
|
|
28
28
|
value: function getFieldLines(tableId, model) {
|
|
29
29
|
var table = model.tables[tableId];
|
|
@@ -306,7 +306,5 @@ var MySQLExporter = /*#__PURE__*/function () {
|
|
|
306
306
|
return res;
|
|
307
307
|
}
|
|
308
308
|
}]);
|
|
309
|
-
return MySQLExporter;
|
|
310
309
|
}();
|
|
311
|
-
var _default = MySQLExporter;
|
|
312
|
-
exports["default"] = _default;
|
|
310
|
+
var _default = exports["default"] = MySQLExporter;
|
|
@@ -6,27 +6,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
8
|
var _utils = require("./utils");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function _typeof(
|
|
11
|
-
function _toConsumableArray(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
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); }
|
|
11
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
12
12
|
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."); }
|
|
13
|
-
function _unsupportedIterableToArray(
|
|
14
|
-
function _iterableToArray(
|
|
15
|
-
function _arrayWithoutHoles(
|
|
16
|
-
function _arrayLikeToArray(
|
|
17
|
-
function ownKeys(
|
|
18
|
-
function _objectSpread(
|
|
19
|
-
function _defineProperty(
|
|
20
|
-
function _classCallCheck(
|
|
21
|
-
function _defineProperties(
|
|
22
|
-
function _createClass(
|
|
23
|
-
function _toPropertyKey(
|
|
24
|
-
function _toPrimitive(
|
|
13
|
+
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; } }
|
|
14
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
15
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
16
|
+
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; }
|
|
17
|
+
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; }
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
21
|
+
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); } }
|
|
22
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
23
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
24
|
+
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); }
|
|
25
25
|
var OracleExporter = /*#__PURE__*/function () {
|
|
26
26
|
function OracleExporter() {
|
|
27
27
|
_classCallCheck(this, OracleExporter);
|
|
28
28
|
}
|
|
29
|
-
_createClass(OracleExporter, null, [{
|
|
29
|
+
return _createClass(OracleExporter, null, [{
|
|
30
30
|
key: "buildSchemaToTableNameSetMap",
|
|
31
31
|
value: function buildSchemaToTableNameSetMap(model) {
|
|
32
32
|
var schemaToTableNameSetMap = new Map();
|
|
@@ -447,7 +447,5 @@ var OracleExporter = /*#__PURE__*/function () {
|
|
|
447
447
|
return res;
|
|
448
448
|
}
|
|
449
449
|
}]);
|
|
450
|
-
return OracleExporter;
|
|
451
450
|
}();
|
|
452
|
-
var _default = OracleExporter;
|
|
453
|
-
exports["default"] = _default;
|
|
451
|
+
var _default = exports["default"] = OracleExporter;
|
|
@@ -7,24 +7,24 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
8
|
var _utils = require("./utils");
|
|
9
9
|
var _config = require("../model_structure/config");
|
|
10
|
-
function _interopRequireDefault(
|
|
11
|
-
function _typeof(
|
|
12
|
-
function _toConsumableArray(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
|
+
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); }
|
|
12
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
13
13
|
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."); }
|
|
14
|
-
function _unsupportedIterableToArray(
|
|
15
|
-
function _iterableToArray(
|
|
16
|
-
function _arrayWithoutHoles(
|
|
17
|
-
function _arrayLikeToArray(
|
|
18
|
-
function _classCallCheck(
|
|
19
|
-
function _defineProperties(
|
|
20
|
-
function _createClass(
|
|
21
|
-
function _toPropertyKey(
|
|
22
|
-
function _toPrimitive(
|
|
14
|
+
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; } }
|
|
15
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
16
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
17
|
+
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; }
|
|
18
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
19
|
+
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); } }
|
|
20
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
21
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
22
|
+
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); }
|
|
23
23
|
var PostgresExporter = /*#__PURE__*/function () {
|
|
24
24
|
function PostgresExporter() {
|
|
25
25
|
_classCallCheck(this, PostgresExporter);
|
|
26
26
|
}
|
|
27
|
-
_createClass(PostgresExporter, null, [{
|
|
27
|
+
return _createClass(PostgresExporter, null, [{
|
|
28
28
|
key: "exportEnums",
|
|
29
29
|
value: function exportEnums(enumIds, model) {
|
|
30
30
|
var enumArr = enumIds.map(function (enumId) {
|
|
@@ -57,9 +57,9 @@ var PostgresExporter = /*#__PURE__*/function () {
|
|
|
57
57
|
} else {
|
|
58
58
|
var schemaName = '';
|
|
59
59
|
if (field.type.schemaName && field.type.schemaName !== _config.DEFAULT_SCHEMA_NAME) {
|
|
60
|
-
schemaName = (0, _utils.
|
|
60
|
+
schemaName = (0, _utils.hasWhiteSpaceOrUpperCase)(field.type.schemaName) ? "\"".concat(field.type.schemaName, "\".") : "".concat(field.type.schemaName, ".");
|
|
61
61
|
}
|
|
62
|
-
var typeName = (0, _utils.
|
|
62
|
+
var typeName = (0, _utils.hasWhiteSpaceOrUpperCase)(field.type.type_name) ? "\"".concat(field.type.type_name, "\"") : field.type.type_name;
|
|
63
63
|
line = "\"".concat(field.name, "\" ").concat(schemaName).concat(typeName);
|
|
64
64
|
}
|
|
65
65
|
if (field.unique) {
|
|
@@ -355,7 +355,5 @@ var PostgresExporter = /*#__PURE__*/function () {
|
|
|
355
355
|
return res;
|
|
356
356
|
}
|
|
357
357
|
}]);
|
|
358
|
-
return PostgresExporter;
|
|
359
358
|
}();
|
|
360
|
-
var _default = PostgresExporter;
|
|
361
|
-
exports["default"] = _default;
|
|
359
|
+
var _default = exports["default"] = PostgresExporter;
|
package/lib/export/README.md
CHANGED
|
File without changes
|
|
@@ -6,24 +6,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _lodash = _interopRequireDefault(require("lodash"));
|
|
8
8
|
var _utils = require("./utils");
|
|
9
|
-
function _interopRequireDefault(
|
|
10
|
-
function _typeof(
|
|
11
|
-
function _toConsumableArray(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
|
+
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); }
|
|
11
|
+
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
|
|
12
12
|
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."); }
|
|
13
|
-
function _unsupportedIterableToArray(
|
|
14
|
-
function _iterableToArray(
|
|
15
|
-
function _arrayWithoutHoles(
|
|
16
|
-
function _arrayLikeToArray(
|
|
17
|
-
function _classCallCheck(
|
|
18
|
-
function _defineProperties(
|
|
19
|
-
function _createClass(
|
|
20
|
-
function _toPropertyKey(
|
|
21
|
-
function _toPrimitive(
|
|
13
|
+
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; } }
|
|
14
|
+
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); }
|
|
15
|
+
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }
|
|
16
|
+
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; }
|
|
17
|
+
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
|
|
18
|
+
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); } }
|
|
19
|
+
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
|
|
20
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
21
|
+
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); }
|
|
22
22
|
var SqlServerExporter = /*#__PURE__*/function () {
|
|
23
23
|
function SqlServerExporter() {
|
|
24
24
|
_classCallCheck(this, SqlServerExporter);
|
|
25
25
|
}
|
|
26
|
-
_createClass(SqlServerExporter, null, [{
|
|
26
|
+
return _createClass(SqlServerExporter, null, [{
|
|
27
27
|
key: "getFieldLines",
|
|
28
28
|
value: function getFieldLines(tableId, model) {
|
|
29
29
|
var table = model.tables[tableId];
|
|
@@ -333,7 +333,5 @@ var SqlServerExporter = /*#__PURE__*/function () {
|
|
|
333
333
|
return res;
|
|
334
334
|
}
|
|
335
335
|
}]);
|
|
336
|
-
return SqlServerExporter;
|
|
337
336
|
}();
|
|
338
|
-
var _default = SqlServerExporter;
|
|
339
|
-
exports["default"] = _default;
|
|
337
|
+
var _default = exports["default"] = SqlServerExporter;
|
package/lib/export/index.js
CHANGED
|
@@ -6,12 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = void 0;
|
|
7
7
|
var _ModelExporter = _interopRequireDefault(require("./ModelExporter"));
|
|
8
8
|
var _Parser = _interopRequireDefault(require("../parse/Parser"));
|
|
9
|
-
function _interopRequireDefault(
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
10
10
|
function _export(str, format) {
|
|
11
11
|
var database = new _Parser["default"]().parse(str, 'dbmlv2');
|
|
12
12
|
return _ModelExporter["default"]["export"](database.normalize(), format);
|
|
13
13
|
}
|
|
14
|
-
var _default = {
|
|
14
|
+
var _default = exports["default"] = {
|
|
15
15
|
"export": _export
|
|
16
|
-
};
|
|
17
|
-
exports["default"] = _default;
|
|
16
|
+
};
|
package/lib/export/utils.js
CHANGED
|
@@ -9,11 +9,15 @@ exports.buildNewTableName = buildNewTableName;
|
|
|
9
9
|
exports.buildUniqueTableName = buildUniqueTableName;
|
|
10
10
|
exports.escapeObjectName = escapeObjectName;
|
|
11
11
|
exports.hasWhiteSpace = hasWhiteSpace;
|
|
12
|
+
exports.hasWhiteSpaceOrUpperCase = hasWhiteSpaceOrUpperCase;
|
|
12
13
|
exports.shouldPrintSchema = shouldPrintSchema;
|
|
13
14
|
var _config = require("../model_structure/config");
|
|
14
15
|
function hasWhiteSpace(s) {
|
|
15
16
|
return /\s/g.test(s);
|
|
16
17
|
}
|
|
18
|
+
function hasWhiteSpaceOrUpperCase(s) {
|
|
19
|
+
return /[\sA-Z]/g.test(s);
|
|
20
|
+
}
|
|
17
21
|
function shouldPrintSchema(schema, model) {
|
|
18
22
|
return schema.name !== _config.DEFAULT_SCHEMA_NAME || schema.name === _config.DEFAULT_SCHEMA_NAME && model.database['1'].hasDefaultSchema;
|
|
19
23
|
}
|
package/lib/import/index.js
CHANGED
|
@@ -7,7 +7,7 @@ exports["default"] = void 0;
|
|
|
7
7
|
var _databaseGenerator = require("../parse/databaseGenerator");
|
|
8
8
|
var _Parser = _interopRequireDefault(require("../parse/Parser"));
|
|
9
9
|
var _ModelExporter = _interopRequireDefault(require("../export/ModelExporter"));
|
|
10
|
-
function _interopRequireDefault(
|
|
10
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
11
11
|
function _import(str, format) {
|
|
12
12
|
var database = new _Parser["default"]().parse(str, format);
|
|
13
13
|
var dbml = _ModelExporter["default"]["export"](database.normalize(), 'dbml');
|
|
@@ -18,8 +18,7 @@ function generateDbml(schemaJson) {
|
|
|
18
18
|
var dbml = _ModelExporter["default"]["export"](database.normalize(), 'dbml');
|
|
19
19
|
return dbml;
|
|
20
20
|
}
|
|
21
|
-
var _default = {
|
|
21
|
+
var _default = exports["default"] = {
|
|
22
22
|
"import": _import,
|
|
23
23
|
generateDbml: generateDbml
|
|
24
|
-
};
|
|
25
|
-
exports["default"] = _default;
|
|
24
|
+
};
|
package/lib/index.js
CHANGED
|
@@ -45,4 +45,4 @@ var _error = require("../lib/parse/error");
|
|
|
45
45
|
var _import = _interopRequireDefault(require("./import"));
|
|
46
46
|
var _export = _interopRequireDefault(require("./export"));
|
|
47
47
|
var _version = require("./utils/version");
|
|
48
|
-
function _interopRequireDefault(
|
|
48
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
@@ -4,15 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TABLE_GROUP = exports.TABLE = exports.REF = exports.NOTE = exports.ENUM = exports.DEFAULT_SCHEMA_NAME = void 0;
|
|
7
|
-
var DEFAULT_SCHEMA_NAME = 'public';
|
|
8
|
-
exports.
|
|
9
|
-
var
|
|
10
|
-
exports.
|
|
11
|
-
var
|
|
12
|
-
exports.
|
|
13
|
-
var ENUM = 'enum';
|
|
14
|
-
exports.ENUM = ENUM;
|
|
15
|
-
var REF = 'ref';
|
|
16
|
-
exports.REF = REF;
|
|
17
|
-
var TABLE_GROUP = 'table_group';
|
|
18
|
-
exports.TABLE_GROUP = TABLE_GROUP;
|
|
7
|
+
var DEFAULT_SCHEMA_NAME = exports.DEFAULT_SCHEMA_NAME = 'public';
|
|
8
|
+
var TABLE = exports.TABLE = 'table';
|
|
9
|
+
var NOTE = exports.NOTE = 'note';
|
|
10
|
+
var ENUM = exports.ENUM = 'enum';
|
|
11
|
+
var REF = exports.REF = 'ref';
|
|
12
|
+
var TABLE_GROUP = exports.TABLE_GROUP = 'table_group';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(
|
|
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
|
});
|
|
@@ -16,27 +16,24 @@ var _element = _interopRequireDefault(require("./element"));
|
|
|
16
16
|
var _config = require("./config");
|
|
17
17
|
var _dbState = _interopRequireDefault(require("./dbState"));
|
|
18
18
|
var _tablePartial = _interopRequireDefault(require("./tablePartial"));
|
|
19
|
-
function _interopRequireDefault(
|
|
20
|
-
function
|
|
21
|
-
function
|
|
22
|
-
function
|
|
23
|
-
function
|
|
24
|
-
function
|
|
25
|
-
function
|
|
26
|
-
function
|
|
27
|
-
function
|
|
28
|
-
function
|
|
29
|
-
function
|
|
30
|
-
function
|
|
31
|
-
function
|
|
32
|
-
function
|
|
33
|
-
function
|
|
34
|
-
function
|
|
35
|
-
function
|
|
36
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
19
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
20
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
|
+
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; }
|
|
22
|
+
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; }
|
|
23
|
+
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; }
|
|
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); }
|
|
37
36
|
var Database = /*#__PURE__*/function (_Element) {
|
|
38
|
-
_inherits(Database, _Element);
|
|
39
|
-
var _super = _createSuper(Database);
|
|
40
37
|
function Database(_ref) {
|
|
41
38
|
var _this;
|
|
42
39
|
var _ref$schemas = _ref.schemas,
|
|
@@ -60,7 +57,7 @@ var Database = /*#__PURE__*/function (_Element) {
|
|
|
60
57
|
_ref$tablePartials = _ref.tablePartials,
|
|
61
58
|
tablePartials = _ref$tablePartials === void 0 ? [] : _ref$tablePartials;
|
|
62
59
|
_classCallCheck(this, Database);
|
|
63
|
-
_this =
|
|
60
|
+
_this = _callSuper(this, Database);
|
|
64
61
|
_this.dbState = new _dbState["default"]();
|
|
65
62
|
_this.generateId();
|
|
66
63
|
_this.hasDefaultSchema = false;
|
|
@@ -101,7 +98,8 @@ var Database = /*#__PURE__*/function (_Element) {
|
|
|
101
98
|
});
|
|
102
99
|
return _this;
|
|
103
100
|
}
|
|
104
|
-
|
|
101
|
+
_inherits(Database, _Element);
|
|
102
|
+
return _createClass(Database, [{
|
|
105
103
|
key: "generateId",
|
|
106
104
|
value: function generateId() {
|
|
107
105
|
this.id = this.dbState.generateId('dbId');
|
|
@@ -372,7 +370,5 @@ var Database = /*#__PURE__*/function (_Element) {
|
|
|
372
370
|
return normalizedModel;
|
|
373
371
|
}
|
|
374
372
|
}]);
|
|
375
|
-
return Database;
|
|
376
373
|
}(_element["default"]);
|
|
377
|
-
var _default = Database;
|
|
378
|
-
exports["default"] = _default;
|
|
374
|
+
var _default = exports["default"] = Database;
|