@dbml/connector 7.0.0-alpha.0 → 7.1.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/__tests__/connector.test.ts +0 -0
- package/__tests__/connectors/mssql/connection.json +0 -0
- package/__tests__/connectors/mssql/expect-out-files/schema.json +0 -0
- package/__tests__/connectors/mysql/connection.json +0 -0
- package/__tests__/connectors/mysql/expect-out-files/schema.json +0 -0
- package/__tests__/connectors/oracle/connection.json +0 -0
- package/__tests__/connectors/oracle/expect-out-files/schema.json +0 -0
- package/__tests__/connectors/postgres/connection.json +0 -0
- package/__tests__/connectors/postgres/expect-out-files/schema.json +0 -0
- package/__tests__/testHelpers.ts +0 -0
- package/dist/connectors/bigquery/index.d.ts +0 -0
- package/dist/connectors/connector.d.ts +0 -0
- package/dist/connectors/mssql/index.d.ts +0 -0
- package/dist/connectors/mysql/index.d.ts +0 -0
- package/dist/connectors/oracle/constraints.d.ts +0 -0
- package/dist/connectors/oracle/index.d.ts +0 -0
- package/dist/connectors/oracle/indexes.d.ts +0 -0
- package/dist/connectors/oracle/refs.d.ts +0 -0
- package/dist/connectors/oracle/tables.d.ts +0 -0
- package/dist/connectors/oracle/utils.d.ts +0 -0
- package/dist/connectors/postgres/index.d.ts +0 -0
- package/dist/connectors/snowflake/index.d.ts +0 -0
- package/dist/connectors/types.d.ts +0 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +517 -517
- package/dist/index.mjs +1555 -1555
- package/dist/utils/credential-loader.d.ts +0 -0
- package/dist/utils/helpers.d.ts +0 -0
- package/dist/utils/parseSchema.d.ts +0 -0
- package/eslint.config.ts +39 -9
- package/package.json +3 -3
- package/src/connectors/bigquery/index.ts +0 -0
- package/src/connectors/connector.ts +4 -4
- package/src/connectors/mssql/index.ts +0 -0
- package/src/connectors/mysql/index.ts +2 -2
- package/src/connectors/oracle/constraints.ts +0 -0
- package/src/connectors/oracle/index.ts +3 -3
- package/src/connectors/oracle/indexes.ts +0 -0
- package/src/connectors/oracle/refs.ts +0 -0
- package/src/connectors/oracle/tables.ts +0 -0
- package/src/connectors/oracle/utils.ts +0 -0
- package/src/connectors/postgres/index.ts +0 -0
- package/src/connectors/snowflake/index.ts +1 -1
- package/src/connectors/types.ts +0 -0
- package/src/ddl_samples/bigquery.sql +0 -0
- package/src/ddl_samples/snowflake.sql +0 -0
- package/src/index.ts +0 -0
- package/src/utils/credential-loader.ts +0 -0
- package/src/utils/helpers.ts +0 -0
- package/src/utils/parseSchema.ts +0 -0
- package/tsconfig.json +0 -0
- package/vite.config.ts +0 -0
|
File without changes
|
package/dist/utils/helpers.d.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/eslint.config.ts
CHANGED
|
@@ -3,6 +3,41 @@ import { defineConfig } from 'eslint/config';
|
|
|
3
3
|
import tseslint from 'typescript-eslint';
|
|
4
4
|
import tsparser from '@typescript-eslint/parser';
|
|
5
5
|
import stylistic from '@stylistic/eslint-plugin';
|
|
6
|
+
import importPlugin from 'eslint-plugin-import';
|
|
7
|
+
|
|
8
|
+
const IMPORT_ORDER_RULES = {
|
|
9
|
+
'import/order': ['error', {
|
|
10
|
+
groups: [
|
|
11
|
+
'builtin',
|
|
12
|
+
'external',
|
|
13
|
+
'internal',
|
|
14
|
+
'parent',
|
|
15
|
+
'sibling',
|
|
16
|
+
'index',
|
|
17
|
+
],
|
|
18
|
+
'newlines-between': 'never',
|
|
19
|
+
alphabetize: {
|
|
20
|
+
order: 'asc',
|
|
21
|
+
caseInsensitive: false,
|
|
22
|
+
},
|
|
23
|
+
}],
|
|
24
|
+
'import/newline-after-import': ['error', { count: 1 }],
|
|
25
|
+
'sort-imports': ['error', {
|
|
26
|
+
ignoreDeclarationSort: true,
|
|
27
|
+
ignoreCase: false,
|
|
28
|
+
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
|
|
29
|
+
}],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const IMPORT_SETTINGS = {
|
|
33
|
+
'import/resolver': {
|
|
34
|
+
typescript: {
|
|
35
|
+
alwaysTryTypes: true,
|
|
36
|
+
project: './tsconfig.json',
|
|
37
|
+
},
|
|
38
|
+
node: true,
|
|
39
|
+
},
|
|
40
|
+
};
|
|
6
41
|
|
|
7
42
|
export default defineConfig(
|
|
8
43
|
eslint.configs.recommended,
|
|
@@ -37,8 +72,11 @@ export default defineConfig(
|
|
|
37
72
|
},
|
|
38
73
|
plugins: {
|
|
39
74
|
'@stylistic': stylistic,
|
|
75
|
+
import: importPlugin,
|
|
40
76
|
},
|
|
77
|
+
settings: IMPORT_SETTINGS,
|
|
41
78
|
rules: {
|
|
79
|
+
...IMPORT_ORDER_RULES,
|
|
42
80
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
43
81
|
'no-use-before-define': 'off',
|
|
44
82
|
'no-continue': 'off',
|
|
@@ -54,18 +92,10 @@ export default defineConfig(
|
|
|
54
92
|
],
|
|
55
93
|
'consistent-return': 'off',
|
|
56
94
|
'@typescript-eslint/consistent-return': ['error'],
|
|
57
|
-
'@stylistic/quotes': ['error', 'single', {
|
|
95
|
+
'@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
|
|
58
96
|
'@stylistic/max-statements-per-line': 'off',
|
|
59
97
|
'@stylistic/operator-linebreak': ['error', 'before', { overrides: { '=': 'after' } }],
|
|
60
98
|
},
|
|
61
|
-
settings: {
|
|
62
|
-
'import/resolver': {
|
|
63
|
-
typescript: {
|
|
64
|
-
alwaysTryTypes: true,
|
|
65
|
-
project: 'packages/*/{ts,js}config.json',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
99
|
},
|
|
70
100
|
],
|
|
71
101
|
);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@dbml/connector",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.1.0-alpha.0",
|
|
5
5
|
"description": "This package was created to fetch the schema JSON from many kind of databases.",
|
|
6
6
|
"author": "huy.phung.sw@gmail.com",
|
|
7
7
|
"license": "MIT",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"mysql2": "^3.11.0",
|
|
34
34
|
"oracledb": "^6.10.0",
|
|
35
35
|
"pg": "^8.12.0",
|
|
36
|
-
"snowflake-sdk": "^2.
|
|
36
|
+
"snowflake-sdk": "^2.4.0"
|
|
37
37
|
},
|
|
38
38
|
"engines": {
|
|
39
39
|
"node": ">=18"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "109c30cccebfcb36b793945798d40963fb24d08c"
|
|
42
42
|
}
|
|
File without changes
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { fetchSchemaJson as fetchPostgresSchemaJson } from './postgres';
|
|
1
|
+
import { fetchSchemaJson as fetchBigQuerySchemaJson } from './bigquery';
|
|
3
2
|
import { fetchSchemaJson as fetchMssqlSchemaJson } from './mssql';
|
|
4
3
|
import { fetchSchemaJson as fetchMysqlSchemaJson } from './mysql';
|
|
5
|
-
import { fetchSchemaJson as fetchSnowflakeSchemaJson } from './snowflake';
|
|
6
|
-
import { fetchSchemaJson as fetchBigQuerySchemaJson } from './bigquery';
|
|
7
4
|
import { fetchSchemaJson as fetchOracleSchemaJson } from './oracle';
|
|
5
|
+
import { fetchSchemaJson as fetchPostgresSchemaJson } from './postgres';
|
|
6
|
+
import { fetchSchemaJson as fetchSnowflakeSchemaJson } from './snowflake';
|
|
7
|
+
import { DatabaseSchema } from './types';
|
|
8
8
|
|
|
9
9
|
const fetchSchemaJson = async (connection: string, databaseType: string): Promise<DatabaseSchema> => {
|
|
10
10
|
switch (databaseType) {
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createConnection, Connection } from 'mysql2/promise';
|
|
2
1
|
import { flatten } from 'lodash-es';
|
|
2
|
+
import { Connection, createConnection } from 'mysql2/promise';
|
|
3
3
|
import {
|
|
4
|
-
CheckConstraintDictionary,
|
|
4
|
+
CheckConstraintDictionary, DatabaseSchema, DefaultInfo, DefaultType, Enum, Field, FieldsDictionary, Index, IndexColumn, IndexesDictionary, Ref, Table, TableConstraintsDictionary,
|
|
5
5
|
} from '../types';
|
|
6
6
|
|
|
7
7
|
const NUMBER_REGEX = '^-?[0-9]+(.[0-9]+)?$';
|
|
File without changes
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Connection, getConnection } from 'oracledb';
|
|
2
2
|
import { DatabaseSchema } from '../types';
|
|
3
|
-
import { generateTablesAndFields } from './tables';
|
|
4
|
-
import { generateRawRefs } from './refs';
|
|
5
3
|
import { generateConstraints } from './constraints';
|
|
6
4
|
import { generateIndexes } from './indexes';
|
|
5
|
+
import { generateRawRefs } from './refs';
|
|
6
|
+
import { generateTablesAndFields } from './tables';
|
|
7
7
|
import { processEasyConnectString } from './utils';
|
|
8
8
|
|
|
9
9
|
const getValidatedClient = async (username: string, password: string, dbidentifier: string): Promise<Connection> => {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
//
|
|
8
8
|
|
|
9
9
|
import snowflake from 'snowflake-sdk';
|
|
10
|
-
import type { Connection,
|
|
10
|
+
import type { Connection, ConnectionOptions, LogLevel } from 'snowflake-sdk';
|
|
11
11
|
import { parseSchema } from '../../utils/parseSchema';
|
|
12
12
|
import {
|
|
13
13
|
DatabaseSchema,
|
package/src/connectors/types.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/utils/helpers.ts
CHANGED
|
File without changes
|
package/src/utils/parseSchema.ts
CHANGED
|
File without changes
|
package/tsconfig.json
CHANGED
|
File without changes
|
package/vite.config.ts
CHANGED
|
File without changes
|