@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.
Files changed (54) hide show
  1. package/LICENSE +0 -0
  2. package/README.md +0 -0
  3. package/__tests__/connector.test.ts +0 -0
  4. package/__tests__/connectors/mssql/connection.json +0 -0
  5. package/__tests__/connectors/mssql/expect-out-files/schema.json +0 -0
  6. package/__tests__/connectors/mysql/connection.json +0 -0
  7. package/__tests__/connectors/mysql/expect-out-files/schema.json +0 -0
  8. package/__tests__/connectors/oracle/connection.json +0 -0
  9. package/__tests__/connectors/oracle/expect-out-files/schema.json +0 -0
  10. package/__tests__/connectors/postgres/connection.json +0 -0
  11. package/__tests__/connectors/postgres/expect-out-files/schema.json +0 -0
  12. package/__tests__/testHelpers.ts +0 -0
  13. package/dist/connectors/bigquery/index.d.ts +0 -0
  14. package/dist/connectors/connector.d.ts +0 -0
  15. package/dist/connectors/mssql/index.d.ts +0 -0
  16. package/dist/connectors/mysql/index.d.ts +0 -0
  17. package/dist/connectors/oracle/constraints.d.ts +0 -0
  18. package/dist/connectors/oracle/index.d.ts +0 -0
  19. package/dist/connectors/oracle/indexes.d.ts +0 -0
  20. package/dist/connectors/oracle/refs.d.ts +0 -0
  21. package/dist/connectors/oracle/tables.d.ts +0 -0
  22. package/dist/connectors/oracle/utils.d.ts +0 -0
  23. package/dist/connectors/postgres/index.d.ts +0 -0
  24. package/dist/connectors/snowflake/index.d.ts +0 -0
  25. package/dist/connectors/types.d.ts +0 -0
  26. package/dist/index.d.ts +0 -0
  27. package/dist/index.js +517 -517
  28. package/dist/index.mjs +1555 -1555
  29. package/dist/utils/credential-loader.d.ts +0 -0
  30. package/dist/utils/helpers.d.ts +0 -0
  31. package/dist/utils/parseSchema.d.ts +0 -0
  32. package/eslint.config.ts +39 -9
  33. package/package.json +3 -3
  34. package/src/connectors/bigquery/index.ts +0 -0
  35. package/src/connectors/connector.ts +4 -4
  36. package/src/connectors/mssql/index.ts +0 -0
  37. package/src/connectors/mysql/index.ts +2 -2
  38. package/src/connectors/oracle/constraints.ts +0 -0
  39. package/src/connectors/oracle/index.ts +3 -3
  40. package/src/connectors/oracle/indexes.ts +0 -0
  41. package/src/connectors/oracle/refs.ts +0 -0
  42. package/src/connectors/oracle/tables.ts +0 -0
  43. package/src/connectors/oracle/utils.ts +0 -0
  44. package/src/connectors/postgres/index.ts +0 -0
  45. package/src/connectors/snowflake/index.ts +1 -1
  46. package/src/connectors/types.ts +0 -0
  47. package/src/ddl_samples/bigquery.sql +0 -0
  48. package/src/ddl_samples/snowflake.sql +0 -0
  49. package/src/index.ts +0 -0
  50. package/src/utils/credential-loader.ts +0 -0
  51. package/src/utils/helpers.ts +0 -0
  52. package/src/utils/parseSchema.ts +0 -0
  53. package/tsconfig.json +0 -0
  54. package/vite.config.ts +0 -0
File without changes
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', { 'avoidEscape': true }],
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.0.0-alpha.0",
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.3.3"
36
+ "snowflake-sdk": "^2.4.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=18"
40
40
  },
41
- "gitHead": "cb925c52bc255aa63688dc04db48f2ad5d7129c9"
41
+ "gitHead": "109c30cccebfcb36b793945798d40963fb24d08c"
42
42
  }
File without changes
@@ -1,10 +1,10 @@
1
- import { DatabaseSchema } from './types';
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, DefaultInfo, DatabaseSchema, DefaultType, Field, IndexColumn, FieldsDictionary, Table, Enum, IndexesDictionary, TableConstraintsDictionary, Index, Ref,
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 { getConnection, Connection } from 'oracledb';
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, LogLevel, ConnectionOptions } from 'snowflake-sdk';
10
+ import type { Connection, ConnectionOptions, LogLevel } from 'snowflake-sdk';
11
11
  import { parseSchema } from '../../utils/parseSchema';
12
12
  import {
13
13
  DatabaseSchema,
File without changes
File without changes
File without changes
package/src/index.ts CHANGED
File without changes
File without changes
File without changes
File without changes
package/tsconfig.json CHANGED
File without changes
package/vite.config.ts CHANGED
File without changes