drizzle-seed 0.4.0-dd6ee88 → 0.4.0-e6bdce6

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 (53) hide show
  1. package/SeedService.d.cts +1 -0
  2. package/SeedService.d.mts +1 -0
  3. package/SeedService.d.ts +1 -0
  4. package/cockroach-core/index.d.cts +3 -5
  5. package/cockroach-core/index.d.mts +3 -5
  6. package/cockroach-core/index.d.ts +3 -5
  7. package/common.d.cts +3 -5
  8. package/common.d.mts +3 -5
  9. package/common.d.ts +3 -5
  10. package/generators/GeneratorFuncs.d.cts +888 -28
  11. package/generators/GeneratorFuncs.d.mts +888 -28
  12. package/generators/GeneratorFuncs.d.ts +888 -28
  13. package/generators/Generators.d.cts +147 -42
  14. package/generators/Generators.d.mts +147 -42
  15. package/generators/Generators.d.ts +147 -42
  16. package/generators/apiVersion.d.cts +1 -1
  17. package/generators/apiVersion.d.mts +1 -1
  18. package/generators/apiVersion.d.ts +1 -1
  19. package/generators/versioning/v2.d.cts +11 -4
  20. package/generators/versioning/v2.d.mts +11 -4
  21. package/generators/versioning/v2.d.ts +11 -4
  22. package/generators/versioning/v3.d.cts +10 -0
  23. package/generators/versioning/v3.d.mts +10 -0
  24. package/generators/versioning/v3.d.ts +10 -0
  25. package/index.cjs +764 -282
  26. package/index.cjs.map +1 -1
  27. package/index.d.cts +8 -20
  28. package/index.d.mts +8 -20
  29. package/index.d.ts +8 -20
  30. package/index.mjs +764 -282
  31. package/index.mjs.map +1 -1
  32. package/mysql-core/index.d.cts +3 -5
  33. package/mysql-core/index.d.mts +3 -5
  34. package/mysql-core/index.d.ts +3 -5
  35. package/package.json +108 -107
  36. package/pg-core/index.d.cts +3 -5
  37. package/pg-core/index.d.mts +3 -5
  38. package/pg-core/index.d.ts +3 -5
  39. package/singlestore-core/index.d.cts +3 -5
  40. package/singlestore-core/index.d.mts +3 -5
  41. package/singlestore-core/index.d.ts +3 -5
  42. package/sqlite-core/index.d.cts +3 -5
  43. package/sqlite-core/index.d.mts +3 -5
  44. package/sqlite-core/index.d.ts +3 -5
  45. package/types/seedService.d.cts +1 -1
  46. package/types/seedService.d.mts +1 -1
  47. package/types/seedService.d.ts +1 -1
  48. package/types/tables.d.cts +9 -6
  49. package/types/tables.d.mts +9 -6
  50. package/types/tables.d.ts +9 -6
  51. package/utils.d.cts +0 -1
  52. package/utils.d.mts +0 -1
  53. package/utils.d.ts +0 -1
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { MySqlDatabase, MySqlSchema } from 'drizzle-orm/mysql-core';
3
3
  import { MySqlTable } from 'drizzle-orm/mysql-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetMySql: (db: MySqlDatabase<any, any>, schema: {
7
7
  [key: string]: MySqlTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedMySql: (db: MySqlDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapMySqlTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapMySqlColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { MySqlDatabase, MySqlSchema } from 'drizzle-orm/mysql-core';
3
3
  import { MySqlTable } from 'drizzle-orm/mysql-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetMySql: (db: MySqlDatabase<any, any>, schema: {
7
7
  [key: string]: MySqlTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedMySql: (db: MySqlDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapMySqlTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapMySqlColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { MySqlDatabase, MySqlSchema } from 'drizzle-orm/mysql-core';
3
3
  import { MySqlTable } from 'drizzle-orm/mysql-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetMySql: (db: MySqlDatabase<any, any>, schema: {
7
7
  [key: string]: MySqlTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedMySql: (db: MySqlDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapMySqlTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapMySqlColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
package/package.json CHANGED
@@ -1,109 +1,110 @@
1
1
  {
2
- "name": "drizzle-seed",
3
- "version": "0.4.0-dd6ee88",
4
- "main": "index.js",
5
- "type": "module",
6
- "scripts": {
7
- "build": "tsc -p ./tsconfig.json && tsx scripts/build.ts",
8
- "pack": "(cd dist && npm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz",
9
- "test": "vitest --config ./vitest.config.ts",
10
- "test:types": "cd type-tests && tsc -p ./../tsconfig.json",
11
- "generate-for-tests:pg": "drizzle-kit generate --config=./src/tests/pg/drizzle.config.ts",
12
- "generate-for-tests:mysql": "drizzle-kit generate --config=./src/tests/mysql/drizzle.config.ts",
13
- "generate-for-tests:sqlite": "drizzle-kit generate --config=./src/tests/sqlite/drizzle.config.ts",
14
- "generate": "drizzle-kit generate",
15
- "start": "npx tsx ./src/dev/test.ts",
16
- "start:pg": "npx tsx ./src/tests/northwind/pgTest.ts",
17
- "start:mysql": "npx tsx ./src/tests/northwind/mysqlTest.ts",
18
- "start:sqlite": "npx tsx ./src/tests/northwind/sqliteTest.ts",
19
- "benchmark": "npx tsx ./src/tests/benchmarks/generatorsBenchmark.ts",
20
- "publish": "npm publish package.tgz"
21
- },
22
- "author": "Drizzle Team",
23
- "license": "Apache-2.0",
24
- "bugs": {
25
- "url": "https://github.com/drizzle-team/drizzle-orm/issues"
26
- },
27
- "keywords": [
28
- "drizzle",
29
- "orm",
30
- "pg",
31
- "mysql",
32
- "postgresql",
33
- "postgres",
34
- "sqlite",
35
- "database",
36
- "sql",
37
- "typescript",
38
- "ts",
39
- "drizzle-orm",
40
- "drizzle-seed",
41
- "seeding",
42
- "seed"
43
- ],
44
- "repository": {
45
- "type": "git",
46
- "url": "git+https://github.com/drizzle-team/drizzle-orm.git"
47
- },
48
- "publishConfig": {
49
- "provenance": true
50
- },
51
- "sideEffects": false,
52
- "description": "A package to seed your database using Drizzle ORM",
53
- "exports": {
54
- ".": {
55
- "import": {
56
- "types": "./index.d.mts",
57
- "default": "./index.mjs"
58
- },
59
- "require": {
60
- "types": "./index.d.cjs",
61
- "default": "./index.cjs"
62
- },
63
- "types": "./index.d.ts",
64
- "default": "./index.mjs"
65
- }
66
- },
67
- "peerDependencies": {
68
- "drizzle-orm": ">=1.0.0-beta.1"
69
- },
70
- "peerDependenciesMeta": {
71
- "drizzle-orm": {
72
- "optional": false
73
- }
74
- },
75
- "devDependencies": {
76
- "@arethetypeswrong/cli": "^0.16.1",
77
- "@electric-sql/pglite": "^0.2.12",
78
- "@rollup/plugin-terser": "^0.4.4",
79
- "@rollup/plugin-typescript": "^11.1.6",
80
- "@types/async-retry": "^1.4.8",
81
- "@types/better-sqlite3": "^7.6.11",
82
- "@types/dockerode": "^3.3.31",
83
- "@types/mssql": "^9.1.4",
84
- "@types/node": "^22.5.4",
85
- "@types/pg": "^8.11.6",
86
- "@types/uuid": "^10.0.0",
87
- "async-retry": "^1.3.3",
88
- "better-sqlite3": "^11.1.2",
89
- "cpy": "^11.1.0",
90
- "dockerode": "^4.0.6",
91
- "dotenv": "^16.4.5",
92
- "drizzle-kit": "workspace:./drizzle-kit/dist",
93
- "drizzle-orm": "workspace:./drizzle-orm/dist",
94
- "get-port": "^7.1.0",
95
- "mssql": "^11.0.1",
96
- "mysql2": "^3.14.1",
97
- "pg": "^8.12.0",
98
- "resolve-tspaths": "^0.8.19",
99
- "rollup": "^3.29.5",
100
- "tslib": "^2.7.0",
101
- "tsx": "^4.19.0",
102
- "uuid": "^10.0.0",
103
- "vitest": "^3.1.3",
104
- "zx": "^8.1.5"
105
- },
106
- "dependencies": {
107
- "pure-rand": "^6.1.0"
108
- }
2
+ "name": "drizzle-seed",
3
+ "version": "0.4.0-e6bdce6",
4
+ "main": "index.js",
5
+ "type": "module",
6
+ "scripts": {
7
+ "build": "tsc -p ./tsconfig.json && tsx scripts/build.ts",
8
+ "build:artifact": "pnpm run build",
9
+ "pack": "(cd dist && npm pack --pack-destination ..) && rm -f package.tgz && mv *.tgz package.tgz",
10
+ "pack:artifact": "pnpm run pack",
11
+ "test": "vitest --config ./vitest.config.ts",
12
+ "test:types": "cd type-tests && tsc -p ./../tsconfig.json",
13
+ "generate-for-tests:pg": "drizzle-kit generate --config=./src/tests/pg/drizzle.config.ts",
14
+ "generate-for-tests:mysql": "drizzle-kit generate --config=./src/tests/mysql/drizzle.config.ts",
15
+ "generate-for-tests:sqlite": "drizzle-kit generate --config=./src/tests/sqlite/drizzle.config.ts",
16
+ "generate": "drizzle-kit generate",
17
+ "start": "npx tsx ./src/dev/test.ts",
18
+ "start:pg": "npx tsx ./src/tests/northwind/pgTest.ts",
19
+ "start:mysql": "npx tsx ./src/tests/northwind/mysqlTest.ts",
20
+ "start:sqlite": "npx tsx ./src/tests/northwind/sqliteTest.ts",
21
+ "benchmark": "npx tsx ./src/tests/benchmarks/generatorsBenchmark.ts",
22
+ "publish": "npm publish package.tgz"
23
+ },
24
+ "author": "Drizzle Team",
25
+ "license": "Apache-2.0",
26
+ "bugs": {
27
+ "url": "https://github.com/drizzle-team/drizzle-orm/issues"
28
+ },
29
+ "keywords": [
30
+ "drizzle",
31
+ "orm",
32
+ "pg",
33
+ "mysql",
34
+ "postgresql",
35
+ "postgres",
36
+ "sqlite",
37
+ "database",
38
+ "sql",
39
+ "typescript",
40
+ "ts",
41
+ "drizzle-orm",
42
+ "drizzle-seed",
43
+ "seeding",
44
+ "seed"
45
+ ],
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/drizzle-team/drizzle-orm.git"
49
+ },
50
+ "publishConfig": {
51
+ "provenance": true
52
+ },
53
+ "sideEffects": false,
54
+ "description": "A package to seed your database using Drizzle ORM",
55
+ "exports": {
56
+ ".": {
57
+ "import": {
58
+ "types": "./index.d.mts",
59
+ "default": "./index.mjs"
60
+ },
61
+ "require": {
62
+ "types": "./index.d.cjs",
63
+ "default": "./index.cjs"
64
+ },
65
+ "types": "./index.d.ts",
66
+ "default": "./index.mjs"
67
+ }
68
+ },
69
+ "peerDependencies": {
70
+ "drizzle-orm": ">=1.0.0-beta.1"
71
+ },
72
+ "peerDependenciesMeta": {
73
+ "drizzle-orm": {
74
+ "optional": false
75
+ }
76
+ },
77
+ "devDependencies": {
78
+ "@arethetypeswrong/cli": "^0.16.1",
79
+ "@electric-sql/pglite": "^0.2.12",
80
+ "@rollup/plugin-terser": "^0.4.4",
81
+ "@rollup/plugin-typescript": "^11.1.6",
82
+ "@types/async-retry": "^1.4.8",
83
+ "@types/better-sqlite3": "^7.6.11",
84
+ "@types/dockerode": "^3.3.31",
85
+ "@types/mssql": "^9.1.4",
86
+ "@types/node": "^22.5.4",
87
+ "@types/pg": "^8.11.6",
88
+ "@types/uuid": "^10.0.0",
89
+ "async-retry": "^1.3.3",
90
+ "better-sqlite3": "^11.1.2",
91
+ "cpy": "^11.1.0",
92
+ "dockerode": "^4.0.6",
93
+ "dotenv": "^16.4.5",
94
+ "drizzle-kit": "workspace:./drizzle-kit/dist",
95
+ "drizzle-orm": "workspace:./drizzle-orm/dist",
96
+ "get-port": "^7.1.0",
97
+ "mssql": "^11.0.1",
98
+ "mysql2": "^3.14.1",
99
+ "pg": "^8.12.0",
100
+ "resolve-tspaths": "^0.8.19",
101
+ "rollup": "^3.29.5",
102
+ "tslib": "^2.7.0",
103
+ "tsx": "^4.19.0",
104
+ "uuid": "^10.0.0",
105
+ "zx": "^8.1.5"
106
+ },
107
+ "dependencies": {
108
+ "pure-rand": "^6.1.0"
109
+ }
109
110
  }
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { PgDatabase, PgSchema } from 'drizzle-orm/pg-core';
3
3
  import { PgTable } from 'drizzle-orm/pg-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetPostgres: (db: PgDatabase<any, any>, pgTables: {
7
7
  [key: string]: PgTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedPostgres: (db: PgDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapPgTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapPgColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { PgDatabase, PgSchema } from 'drizzle-orm/pg-core';
3
3
  import { PgTable } from 'drizzle-orm/pg-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetPostgres: (db: PgDatabase<any, any>, pgTables: {
7
7
  [key: string]: PgTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedPostgres: (db: PgDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapPgTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapPgColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { PgDatabase, PgSchema } from 'drizzle-orm/pg-core';
3
3
  import { PgTable } from 'drizzle-orm/pg-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetPostgres: (db: PgDatabase<any, any>, pgTables: {
7
7
  [key: string]: PgTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedPostgres: (db: PgDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapPgTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapPgColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { SingleStoreDatabase, SingleStoreSchema } from 'drizzle-orm/singlestore-core';
3
3
  import { SingleStoreTable } from 'drizzle-orm/singlestore-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
7
7
  [key: string]: SingleStoreTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedSingleStore: (db: SingleStoreDatabase<any, any>, schema
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapSingleStoreTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapSingleStoreColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { SingleStoreDatabase, SingleStoreSchema } from 'drizzle-orm/singlestore-core';
3
3
  import { SingleStoreTable } from 'drizzle-orm/singlestore-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
7
7
  [key: string]: SingleStoreTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedSingleStore: (db: SingleStoreDatabase<any, any>, schema
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapSingleStoreTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapSingleStoreColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { SingleStoreDatabase, SingleStoreSchema } from 'drizzle-orm/singlestore-core';
3
3
  import { SingleStoreTable } from 'drizzle-orm/singlestore-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
7
7
  [key: string]: SingleStoreTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedSingleStore: (db: SingleStoreDatabase<any, any>, schema
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapSingleStoreTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapSingleStoreColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
3
3
  import { SQLiteTable } from 'drizzle-orm/sqlite-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetSqlite: (db: BaseSQLiteDatabase<any, any>, schema: {
7
7
  [key: string]: SQLiteTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedSqlite: (db: BaseSQLiteDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapSqliteTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapSqliteColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
3
3
  import { SQLiteTable } from 'drizzle-orm/sqlite-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetSqlite: (db: BaseSQLiteDatabase<any, any>, schema: {
7
7
  [key: string]: SQLiteTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedSqlite: (db: BaseSQLiteDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapSqliteTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapSqliteColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -2,7 +2,7 @@ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
3
3
  import { SQLiteTable } from 'drizzle-orm/sqlite-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
- import type { Table, TableConfigT } from '../types/tables.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
6
  export declare const resetSqlite: (db: BaseSQLiteDatabase<any, any>, schema: {
7
7
  [key: string]: SQLiteTable;
8
8
  }) => Promise<void>;
@@ -23,8 +23,6 @@ export declare const seedSqlite: (db: BaseSQLiteDatabase<any, any>, schema: {
23
23
  seed?: number;
24
24
  version?: number;
25
25
  }, refinements?: RefinementsType) => Promise<void>;
26
- export declare const mapSqliteTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
26
+ export declare const mapSqliteColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
27
  [key: string]: string;
28
- }, dbToTsColumnNamesMap: {
29
- [key: string]: string;
30
- }) => Table;
28
+ }) => Column[];
@@ -47,7 +47,7 @@ export type RefinementsType = Prettify<{
47
47
  [tableName: string]: {
48
48
  count?: number;
49
49
  columns: {
50
- [columnName: string]: AbstractGenerator<{}>;
50
+ [columnName: string]: AbstractGenerator<{}> | false;
51
51
  };
52
52
  with?: {
53
53
  [tableName: string]: number | {
@@ -47,7 +47,7 @@ export type RefinementsType = Prettify<{
47
47
  [tableName: string]: {
48
48
  count?: number;
49
49
  columns: {
50
- [columnName: string]: AbstractGenerator<{}>;
50
+ [columnName: string]: AbstractGenerator<{}> | false;
51
51
  };
52
52
  with?: {
53
53
  [tableName: string]: number | {
@@ -47,7 +47,7 @@ export type RefinementsType = Prettify<{
47
47
  [tableName: string]: {
48
48
  count?: number;
49
49
  columns: {
50
- [columnName: string]: AbstractGenerator<{}>;
50
+ [columnName: string]: AbstractGenerator<{}> | false;
51
51
  };
52
52
  with?: {
53
53
  [tableName: string]: number | {
@@ -1,10 +1,10 @@
1
1
  import type { AnyColumn } from 'drizzle-orm';
2
- import type { CockroachTable, ForeignKey as CockroachFK } from 'drizzle-orm/cockroach-core';
3
- import type { ForeignKey as MsSqlFK, MsSqlTable } from 'drizzle-orm/mssql-core';
4
- import type { ForeignKey as MySqlFK, MySqlTable } from 'drizzle-orm/mysql-core';
5
- import type { ForeignKey as PgFK, PgTable } from 'drizzle-orm/pg-core';
6
- import type { SingleStoreTable } from 'drizzle-orm/singlestore-core';
7
- import type { ForeignKey as SQLiteFK, SQLiteTable } from 'drizzle-orm/sqlite-core';
2
+ import type { CockroachTable, ForeignKey as CockroachFK, UniqueConstraint as CockroachUniCon } from 'drizzle-orm/cockroach-core';
3
+ import type { ForeignKey as MsSqlFK, MsSqlTable, UniqueConstraint as MsSqlUniCon } from 'drizzle-orm/mssql-core';
4
+ import type { ForeignKey as MySqlFK, MySqlTable, UniqueConstraint as MySqlUniCon } from 'drizzle-orm/mysql-core';
5
+ import type { ForeignKey as PgFK, PgTable, UniqueConstraint as PgUniCon } from 'drizzle-orm/pg-core';
6
+ import type { SingleStoreTable, UniqueConstraint as SingleStoreUniCon } from 'drizzle-orm/singlestore-core';
7
+ import type { ForeignKey as SQLiteFK, SQLiteTable, UniqueConstraint as SQLiteUniCon } from 'drizzle-orm/sqlite-core';
8
8
  export type Column = {
9
9
  name: string;
10
10
  dataType: string;
@@ -30,6 +30,7 @@ export type Column = {
30
30
  export type Table = {
31
31
  name: string;
32
32
  columns: Column[];
33
+ uniqueConstraints: string[][];
33
34
  primaryKeys: string[];
34
35
  };
35
36
  export type Relation = {
@@ -48,9 +49,11 @@ export type Prettify<T> = {
48
49
  } & {};
49
50
  export type DrizzleTable = PgTable | MySqlTable | SQLiteTable | CockroachTable | MsSqlTable | SingleStoreTable;
50
51
  export type DrizzleForeignKey = PgFK | MySqlFK | SQLiteFK | CockroachFK | MsSqlFK;
52
+ export type DrizzleUniqueConstraint = PgUniCon | MySqlUniCon | SQLiteUniCon | CockroachUniCon | MsSqlUniCon | SingleStoreUniCon;
51
53
  export type TableConfigT = {
52
54
  name: string;
53
55
  schema?: string;
54
56
  columns: AnyColumn[];
57
+ uniqueConstraints: DrizzleUniqueConstraint[];
55
58
  foreignKeys?: DrizzleForeignKey[];
56
59
  };
@@ -1,10 +1,10 @@
1
1
  import type { AnyColumn } from 'drizzle-orm';
2
- import type { CockroachTable, ForeignKey as CockroachFK } from 'drizzle-orm/cockroach-core';
3
- import type { ForeignKey as MsSqlFK, MsSqlTable } from 'drizzle-orm/mssql-core';
4
- import type { ForeignKey as MySqlFK, MySqlTable } from 'drizzle-orm/mysql-core';
5
- import type { ForeignKey as PgFK, PgTable } from 'drizzle-orm/pg-core';
6
- import type { SingleStoreTable } from 'drizzle-orm/singlestore-core';
7
- import type { ForeignKey as SQLiteFK, SQLiteTable } from 'drizzle-orm/sqlite-core';
2
+ import type { CockroachTable, ForeignKey as CockroachFK, UniqueConstraint as CockroachUniCon } from 'drizzle-orm/cockroach-core';
3
+ import type { ForeignKey as MsSqlFK, MsSqlTable, UniqueConstraint as MsSqlUniCon } from 'drizzle-orm/mssql-core';
4
+ import type { ForeignKey as MySqlFK, MySqlTable, UniqueConstraint as MySqlUniCon } from 'drizzle-orm/mysql-core';
5
+ import type { ForeignKey as PgFK, PgTable, UniqueConstraint as PgUniCon } from 'drizzle-orm/pg-core';
6
+ import type { SingleStoreTable, UniqueConstraint as SingleStoreUniCon } from 'drizzle-orm/singlestore-core';
7
+ import type { ForeignKey as SQLiteFK, SQLiteTable, UniqueConstraint as SQLiteUniCon } from 'drizzle-orm/sqlite-core';
8
8
  export type Column = {
9
9
  name: string;
10
10
  dataType: string;
@@ -30,6 +30,7 @@ export type Column = {
30
30
  export type Table = {
31
31
  name: string;
32
32
  columns: Column[];
33
+ uniqueConstraints: string[][];
33
34
  primaryKeys: string[];
34
35
  };
35
36
  export type Relation = {
@@ -48,9 +49,11 @@ export type Prettify<T> = {
48
49
  } & {};
49
50
  export type DrizzleTable = PgTable | MySqlTable | SQLiteTable | CockroachTable | MsSqlTable | SingleStoreTable;
50
51
  export type DrizzleForeignKey = PgFK | MySqlFK | SQLiteFK | CockroachFK | MsSqlFK;
52
+ export type DrizzleUniqueConstraint = PgUniCon | MySqlUniCon | SQLiteUniCon | CockroachUniCon | MsSqlUniCon | SingleStoreUniCon;
51
53
  export type TableConfigT = {
52
54
  name: string;
53
55
  schema?: string;
54
56
  columns: AnyColumn[];
57
+ uniqueConstraints: DrizzleUniqueConstraint[];
55
58
  foreignKeys?: DrizzleForeignKey[];
56
59
  };
package/types/tables.d.ts CHANGED
@@ -1,10 +1,10 @@
1
1
  import type { AnyColumn } from 'drizzle-orm';
2
- import type { CockroachTable, ForeignKey as CockroachFK } from 'drizzle-orm/cockroach-core';
3
- import type { ForeignKey as MsSqlFK, MsSqlTable } from 'drizzle-orm/mssql-core';
4
- import type { ForeignKey as MySqlFK, MySqlTable } from 'drizzle-orm/mysql-core';
5
- import type { ForeignKey as PgFK, PgTable } from 'drizzle-orm/pg-core';
6
- import type { SingleStoreTable } from 'drizzle-orm/singlestore-core';
7
- import type { ForeignKey as SQLiteFK, SQLiteTable } from 'drizzle-orm/sqlite-core';
2
+ import type { CockroachTable, ForeignKey as CockroachFK, UniqueConstraint as CockroachUniCon } from 'drizzle-orm/cockroach-core';
3
+ import type { ForeignKey as MsSqlFK, MsSqlTable, UniqueConstraint as MsSqlUniCon } from 'drizzle-orm/mssql-core';
4
+ import type { ForeignKey as MySqlFK, MySqlTable, UniqueConstraint as MySqlUniCon } from 'drizzle-orm/mysql-core';
5
+ import type { ForeignKey as PgFK, PgTable, UniqueConstraint as PgUniCon } from 'drizzle-orm/pg-core';
6
+ import type { SingleStoreTable, UniqueConstraint as SingleStoreUniCon } from 'drizzle-orm/singlestore-core';
7
+ import type { ForeignKey as SQLiteFK, SQLiteTable, UniqueConstraint as SQLiteUniCon } from 'drizzle-orm/sqlite-core';
8
8
  export type Column = {
9
9
  name: string;
10
10
  dataType: string;
@@ -30,6 +30,7 @@ export type Column = {
30
30
  export type Table = {
31
31
  name: string;
32
32
  columns: Column[];
33
+ uniqueConstraints: string[][];
33
34
  primaryKeys: string[];
34
35
  };
35
36
  export type Relation = {
@@ -48,9 +49,11 @@ export type Prettify<T> = {
48
49
  } & {};
49
50
  export type DrizzleTable = PgTable | MySqlTable | SQLiteTable | CockroachTable | MsSqlTable | SingleStoreTable;
50
51
  export type DrizzleForeignKey = PgFK | MySqlFK | SQLiteFK | CockroachFK | MsSqlFK;
52
+ export type DrizzleUniqueConstraint = PgUniCon | MySqlUniCon | SQLiteUniCon | CockroachUniCon | MsSqlUniCon | SingleStoreUniCon;
51
53
  export type TableConfigT = {
52
54
  name: string;
53
55
  schema?: string;
54
56
  columns: AnyColumn[];
57
+ uniqueConstraints: DrizzleUniqueConstraint[];
55
58
  foreignKeys?: DrizzleForeignKey[];
56
59
  };
package/utils.d.cts CHANGED
@@ -1,4 +1,3 @@
1
1
  import type { RelationWithReferences } from './types/tables';
2
2
  export declare const isRelationCyclic: (startRel: RelationWithReferences) => boolean;
3
- export declare const generateHashFromString: (s: string) => number;
4
3
  export declare const equalSets: (set1: Set<any>, set2: Set<any>) => boolean;
package/utils.d.mts CHANGED
@@ -1,4 +1,3 @@
1
1
  import type { RelationWithReferences } from './types/tables';
2
2
  export declare const isRelationCyclic: (startRel: RelationWithReferences) => boolean;
3
- export declare const generateHashFromString: (s: string) => number;
4
3
  export declare const equalSets: (set1: Set<any>, set2: Set<any>) => boolean;