@dbml/core 3.9.4 → 3.9.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dbml/core",
3
- "version": "3.9.4",
3
+ "version": "3.9.5",
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.9.4",
35
+ "@dbml/parse": "^3.9.5",
36
36
  "antlr4": "^4.13.1",
37
37
  "lodash": "^4.17.15",
38
38
  "parsimmon": "^1.13.0",
@@ -59,7 +59,7 @@
59
59
  "\\.(?!json$)[^.]*$": "@glen/jest-raw-loader"
60
60
  }
61
61
  },
62
- "gitHead": "7dcc73bb327aa5603e3d9b6fec2b1b2e6f3f82da",
62
+ "gitHead": "d63ebd60bc967a794cd093ecb712b3a15a149783",
63
63
  "engines": {
64
64
  "node": ">=16"
65
65
  }
package/types/index.d.ts CHANGED
@@ -2,5 +2,5 @@ import ModelExporter from './export/ModelExporter';
2
2
  import Parser from './parse/Parser';
3
3
  import importer from './import';
4
4
  import exporter from './export';
5
- export { importer, exporter, ModelExporter, Parser, };
6
- export { CompilerDiagnostic, CompilerError as CompilerDiagnostics, EditorPosition, ErrorCode, WarningLevel, } from './parse/error'
5
+ export { importer, exporter, ModelExporter, Parser };
6
+ export { CompilerDiagnostic, CompilerError as CompilerDiagnostics, EditorPosition, ErrorCode, WarningLevel, } from './parse/error';
@@ -1,20 +1,33 @@
1
1
  import { Compiler } from '@dbml/parse';
2
2
  import Database, { RawDatabase } from '../model_structure/database';
3
+
4
+ declare type ParseFormat = 'json'
5
+ | 'mysql' | 'mysqlLegacy'
6
+ | 'postgres' | 'postgresLegacy'
7
+ | 'dbml' | 'dbmlv2'
8
+ | 'mssql'
9
+ | 'schemarb'
10
+ | 'snowflake';
11
+
3
12
  declare class Parser {
13
+ public DBMLCompiler: Compiler;
4
14
  constructor(dbmlCompiler?: Compiler);
5
15
  static parseJSONToDatabase(rawDatabase: RawDatabase): Database;
6
16
  static parseMySQLToJSON(str: string): RawDatabase;
17
+ static parseMySQLToJSONv2(str: string): RawDatabase;
7
18
  static parsePostgresToJSON(str: string): RawDatabase;
8
19
  static parsePostgresToJSONv2(str: string): RawDatabase;
9
20
  static parseDBMLToJSON(str: string): RawDatabase;
21
+ static parseDBMLToJSONv2(str: string, dbmlCompiler: Compiler): RawDatabase;
10
22
  static parseSchemaRbToJSON(str: string): RawDatabase;
11
23
  static parseMSSQLToJSON(str: string): RawDatabase;
24
+ static parseSnowflakeToJSON(str: string): RawDatabase;
12
25
  /**
13
26
  * Should use parse() instance method instead of this static method whenever possible
14
27
  */
15
- static parse(str: string, format: 'mysql' | 'postgres' | 'dbml' | 'dbmlv2' | 'schemarb' | 'mssql' | 'json'): Database;
28
+ static parse(str: string, format: ParseFormat): Database;
16
29
  static parse(str: RawDatabase, format: 'json'): Database;
17
- parse(str: string, format: 'mysql' | 'postgres' | 'dbml' | 'dbmlv2' | 'schemarb' | 'mssql' | 'json'): Database;
30
+ parse(str: string, format: ParseFormat): Database;
18
31
  parse(str: RawDatabase, format: 'json'): Database;
19
32
  }
20
33
  export default Parser;