@dbml/core
Advanced tools
Comparing version 2.5.4 to 2.6.0
@@ -81,3 +81,5 @@ "use strict"; | ||
if (!_enum) { | ||
this.error("Cannot find type ".concat(typeSchemaName, " in schema ").concat(typeSchemaName)); | ||
// SQL allow definition of non-enum type to be used as column type, which we don't have equivalent dbml counterpart. | ||
// So instead of throwing errors on those type, we can view the type as plain text for the purpose of importing to dbml. | ||
this.type.type_name = "".concat(typeSchemaName, ".").concat(typeName); | ||
return; | ||
@@ -84,0 +86,0 @@ } |
@@ -13,2 +13,3 @@ "use strict"; | ||
var _mssqlParser = _interopRequireDefault(require("./mssqlParser")); | ||
var _ASTGeneration = require("./ANTLR/ASTGeneration"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
@@ -37,2 +38,7 @@ 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); } | ||
}, { | ||
key: "parsePostgresToJSONv2", | ||
value: function parsePostgresToJSONv2(str) { | ||
return (0, _ASTGeneration.parse)(str, 'postgres'); | ||
} | ||
}, { | ||
key: "parsePostgresToJSON", | ||
@@ -66,2 +72,5 @@ value: function parsePostgresToJSON(str) { | ||
case 'postgres': | ||
rawDatabase = Parser.parsePostgresToJSONv2(str); | ||
break; | ||
case 'postgresLegacy': | ||
rawDatabase = Parser.parsePostgresToJSON(str); | ||
@@ -68,0 +77,0 @@ break; |
{ | ||
"name": "@dbml/core", | ||
"version": "2.5.4", | ||
"version": "2.6.0", | ||
"description": "> TODO: description", | ||
@@ -28,2 +28,3 @@ "author": "Holistics <dev@holistics.io>", | ||
"test": "jest", | ||
"benchmark": "jest --projects jest-bench.config.json", | ||
"build:lib": "babel src --out-dir lib --copy-files", | ||
@@ -35,2 +36,3 @@ "build:parser": "npx babel-node src/parse/buildParser.js", | ||
"dependencies": { | ||
"antlr4": "^4.13.1", | ||
"lodash": "^4.17.15", | ||
@@ -49,2 +51,3 @@ "parsimmon": "^1.13.0", | ||
"jest": "^29.5.0", | ||
"jest-bench": "^29.4.1", | ||
"pegjs-require-import": "0.0.6" | ||
@@ -61,3 +64,3 @@ }, | ||
}, | ||
"gitHead": "2f74de58e4a66ac7390833e3a9434e3fab7e0f4e" | ||
"gitHead": "4362a43e3a39e097a982b5d35a551fab20270655" | ||
} |
@@ -1,2 +0,2 @@ | ||
declare function _import(str: string, format: 'dbml' | 'mysql' | 'postgres' | 'json' | 'mssql'): string; | ||
declare function _import(str: string, format: 'dbml' | 'mysql' | 'postgres' | 'json' | 'mssql' | 'postgresLegacy'): string; | ||
declare const _default: { | ||
@@ -3,0 +3,0 @@ import: typeof _import; |
@@ -6,2 +6,3 @@ import Database, { RawDatabase } from '../model_structure/database'; | ||
static parsePostgresToJSON(str: string): RawDatabase; | ||
static parsePostgresToJSONv2(str: string): RawDatabase; | ||
static parseDBMLToJSON(str: string): RawDatabase; | ||
@@ -8,0 +9,0 @@ static parseSchemaRbToJSON(str: string): RawDatabase; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
5368596
123
34638
4
10
+ Addedantlr4@^4.13.1
+ Addedantlr4@4.13.2(transitive)