drizzle-seed 0.3.2-f8a2f3c → 0.4.0-02522e1

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 (83) hide show
  1. package/{services/SeedService.d.cts → SeedService.d.cts} +19 -26
  2. package/{services/SeedService.d.mts → SeedService.d.mts} +19 -26
  3. package/{services/SeedService.d.ts → SeedService.d.ts} +19 -26
  4. package/cockroach-core/index.d.cts +28 -0
  5. package/cockroach-core/index.d.mts +28 -0
  6. package/cockroach-core/index.d.ts +28 -0
  7. package/cockroach-core/selectGensForColumn.d.cts +3 -0
  8. package/cockroach-core/selectGensForColumn.d.mts +3 -0
  9. package/cockroach-core/selectGensForColumn.d.ts +3 -0
  10. package/common.d.cts +23 -0
  11. package/common.d.mts +23 -0
  12. package/common.d.ts +23 -0
  13. package/{services → generators}/GeneratorFuncs.d.cts +1194 -58
  14. package/{services → generators}/GeneratorFuncs.d.mts +1194 -58
  15. package/{services → generators}/GeneratorFuncs.d.ts +1194 -58
  16. package/{services → generators}/Generators.d.cts +286 -55
  17. package/{services → generators}/Generators.d.mts +286 -55
  18. package/{services → generators}/Generators.d.ts +286 -55
  19. package/generators/apiVersion.d.cts +1 -0
  20. package/generators/apiVersion.d.mts +1 -0
  21. package/generators/apiVersion.d.ts +1 -0
  22. package/generators/utils.d.cts +38 -0
  23. package/generators/utils.d.mts +38 -0
  24. package/generators/utils.d.ts +38 -0
  25. package/{services → generators}/versioning/v2.d.cts +13 -6
  26. package/{services → generators}/versioning/v2.d.mts +13 -6
  27. package/{services → generators}/versioning/v2.d.ts +13 -6
  28. package/generators/versioning/v3.d.cts +10 -0
  29. package/generators/versioning/v3.d.mts +10 -0
  30. package/generators/versioning/v3.d.ts +10 -0
  31. package/index.cjs +3195 -1463
  32. package/index.cjs.map +1 -1
  33. package/index.d.cts +94 -125
  34. package/index.d.mts +94 -125
  35. package/index.d.ts +94 -125
  36. package/index.mjs +3200 -1467
  37. package/index.mjs.map +1 -1
  38. package/mssql-core/index.d.cts +24 -0
  39. package/mssql-core/index.d.mts +24 -0
  40. package/mssql-core/index.d.ts +24 -0
  41. package/mssql-core/selectGensForColumn.d.cts +2 -0
  42. package/mssql-core/selectGensForColumn.d.mts +2 -0
  43. package/mssql-core/selectGensForColumn.d.ts +2 -0
  44. package/mysql-core/index.d.cts +28 -0
  45. package/mysql-core/index.d.mts +28 -0
  46. package/mysql-core/index.d.ts +28 -0
  47. package/mysql-core/selectGensForColumn.d.cts +2 -0
  48. package/mysql-core/selectGensForColumn.d.mts +2 -0
  49. package/mysql-core/selectGensForColumn.d.ts +2 -0
  50. package/package.json +108 -103
  51. package/pg-core/index.d.cts +28 -0
  52. package/pg-core/index.d.mts +28 -0
  53. package/pg-core/index.d.ts +28 -0
  54. package/pg-core/selectGensForColumn.d.cts +3 -0
  55. package/pg-core/selectGensForColumn.d.mts +3 -0
  56. package/pg-core/selectGensForColumn.d.ts +3 -0
  57. package/singlestore-core/index.d.cts +28 -0
  58. package/singlestore-core/index.d.mts +28 -0
  59. package/singlestore-core/index.d.ts +28 -0
  60. package/singlestore-core/selectGensForColumn.d.cts +2 -0
  61. package/singlestore-core/selectGensForColumn.d.mts +2 -0
  62. package/singlestore-core/selectGensForColumn.d.ts +2 -0
  63. package/sqlite-core/index.d.cts +28 -0
  64. package/sqlite-core/index.d.mts +28 -0
  65. package/sqlite-core/index.d.ts +28 -0
  66. package/sqlite-core/selectGensForColumn.d.cts +2 -0
  67. package/sqlite-core/selectGensForColumn.d.mts +2 -0
  68. package/sqlite-core/selectGensForColumn.d.ts +2 -0
  69. package/types/seedService.d.cts +11 -1
  70. package/types/seedService.d.mts +11 -1
  71. package/types/seedService.d.ts +11 -1
  72. package/types/tables.d.cts +20 -0
  73. package/types/tables.d.mts +20 -0
  74. package/types/tables.d.ts +20 -0
  75. package/utils.d.cts +3 -0
  76. package/utils.d.mts +3 -0
  77. package/utils.d.ts +3 -0
  78. package/services/apiVersion.d.cts +0 -1
  79. package/services/apiVersion.d.mts +0 -1
  80. package/services/apiVersion.d.ts +0 -1
  81. package/services/utils.d.cts +0 -23
  82. package/services/utils.d.mts +0 -23
  83. package/services/utils.d.ts +0 -23
@@ -0,0 +1,24 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { MsSqlDatabase, MsSqlSchema } from 'drizzle-orm/mssql-core';
3
+ import { MsSqlTable } from 'drizzle-orm/mssql-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ export declare const resetMsSql: (db: MsSqlDatabase<any, any>, schema: {
6
+ [key: string]: MsSqlTable;
7
+ }) => Promise<void>;
8
+ export declare const filterMsSqlTables: (schema: {
9
+ [key: string]: MsSqlTable | MsSqlSchema | Relations | any;
10
+ }) => {
11
+ mssqlSchema: {
12
+ [k: string]: MsSqlTable<import("drizzle-orm/mssql-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
13
+ };
14
+ mssqlTables: {
15
+ [k: string]: MsSqlTable<import("drizzle-orm/mssql-core").TableConfig>;
16
+ };
17
+ };
18
+ export declare const seedMsSql: (db: MsSqlDatabase<any, any>, schema: {
19
+ [key: string]: MsSqlTable | MsSqlSchema | Relations | any;
20
+ }, options?: {
21
+ count?: number;
22
+ seed?: number;
23
+ version?: number;
24
+ }, refinements?: RefinementsType) => Promise<void>;
@@ -0,0 +1,24 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { MsSqlDatabase, MsSqlSchema } from 'drizzle-orm/mssql-core';
3
+ import { MsSqlTable } from 'drizzle-orm/mssql-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ export declare const resetMsSql: (db: MsSqlDatabase<any, any>, schema: {
6
+ [key: string]: MsSqlTable;
7
+ }) => Promise<void>;
8
+ export declare const filterMsSqlTables: (schema: {
9
+ [key: string]: MsSqlTable | MsSqlSchema | Relations | any;
10
+ }) => {
11
+ mssqlSchema: {
12
+ [k: string]: MsSqlTable<import("drizzle-orm/mssql-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
13
+ };
14
+ mssqlTables: {
15
+ [k: string]: MsSqlTable<import("drizzle-orm/mssql-core").TableConfig>;
16
+ };
17
+ };
18
+ export declare const seedMsSql: (db: MsSqlDatabase<any, any>, schema: {
19
+ [key: string]: MsSqlTable | MsSqlSchema | Relations | any;
20
+ }, options?: {
21
+ count?: number;
22
+ seed?: number;
23
+ version?: number;
24
+ }, refinements?: RefinementsType) => Promise<void>;
@@ -0,0 +1,24 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { MsSqlDatabase, MsSqlSchema } from 'drizzle-orm/mssql-core';
3
+ import { MsSqlTable } from 'drizzle-orm/mssql-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ export declare const resetMsSql: (db: MsSqlDatabase<any, any>, schema: {
6
+ [key: string]: MsSqlTable;
7
+ }) => Promise<void>;
8
+ export declare const filterMsSqlTables: (schema: {
9
+ [key: string]: MsSqlTable | MsSqlSchema | Relations | any;
10
+ }) => {
11
+ mssqlSchema: {
12
+ [k: string]: MsSqlTable<import("drizzle-orm/mssql-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
13
+ };
14
+ mssqlTables: {
15
+ [k: string]: MsSqlTable<import("drizzle-orm/mssql-core").TableConfig>;
16
+ };
17
+ };
18
+ export declare const seedMsSql: (db: MsSqlDatabase<any, any>, schema: {
19
+ [key: string]: MsSqlTable | MsSqlSchema | Relations | any;
20
+ }, options?: {
21
+ count?: number;
22
+ seed?: number;
23
+ version?: number;
24
+ }, refinements?: RefinementsType) => Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { Column, Table } from '../types/tables.js';
2
+ export declare const selectGeneratorForMssqlColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateDatetime | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | undefined;
@@ -0,0 +1,2 @@
1
+ import type { Column, Table } from '../types/tables.js';
2
+ export declare const selectGeneratorForMssqlColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateDatetime | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | undefined;
@@ -0,0 +1,2 @@
1
+ import type { Column, Table } from '../types/tables.js';
2
+ export declare const selectGeneratorForMssqlColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateDatetime | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | undefined;
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { MySqlDatabase, MySqlSchema } from 'drizzle-orm/mysql-core';
3
+ import { MySqlTable } from 'drizzle-orm/mysql-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetMySql: (db: MySqlDatabase<any, any>, schema: {
7
+ [key: string]: MySqlTable;
8
+ }) => Promise<void>;
9
+ export declare const filterMysqlTables: (schema: {
10
+ [key: string]: MySqlTable | MySqlSchema | Relations | any;
11
+ }) => {
12
+ mysqlSchema: {
13
+ [k: string]: MySqlTable<import("drizzle-orm/mysql-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ mysqlTables: {
16
+ [k: string]: MySqlTable<import("drizzle-orm/mysql-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedMySql: (db: MySqlDatabase<any, any>, schema: {
20
+ [key: string]: MySqlTable | MySqlSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapMySqlColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { MySqlDatabase, MySqlSchema } from 'drizzle-orm/mysql-core';
3
+ import { MySqlTable } from 'drizzle-orm/mysql-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetMySql: (db: MySqlDatabase<any, any>, schema: {
7
+ [key: string]: MySqlTable;
8
+ }) => Promise<void>;
9
+ export declare const filterMysqlTables: (schema: {
10
+ [key: string]: MySqlTable | MySqlSchema | Relations | any;
11
+ }) => {
12
+ mysqlSchema: {
13
+ [k: string]: MySqlTable<import("drizzle-orm/mysql-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ mysqlTables: {
16
+ [k: string]: MySqlTable<import("drizzle-orm/mysql-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedMySql: (db: MySqlDatabase<any, any>, schema: {
20
+ [key: string]: MySqlTable | MySqlSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapMySqlColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { MySqlDatabase, MySqlSchema } from 'drizzle-orm/mysql-core';
3
+ import { MySqlTable } from 'drizzle-orm/mysql-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetMySql: (db: MySqlDatabase<any, any>, schema: {
7
+ [key: string]: MySqlTable;
8
+ }) => Promise<void>;
9
+ export declare const filterMysqlTables: (schema: {
10
+ [key: string]: MySqlTable | MySqlSchema | Relations | any;
11
+ }) => {
12
+ mysqlSchema: {
13
+ [k: string]: MySqlTable<import("drizzle-orm/mysql-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ mysqlTables: {
16
+ [k: string]: MySqlTable<import("drizzle-orm/mysql-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedMySql: (db: MySqlDatabase<any, any>, schema: {
20
+ [key: string]: MySqlTable | MySqlSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapMySqlColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,2 @@
1
+ import type { Column, Table } from '../types/tables.js';
2
+ export declare const selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateDatetime | import("../generators/Generators.js").GenerateYear | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | undefined;
@@ -0,0 +1,2 @@
1
+ import type { Column, Table } from '../types/tables.js';
2
+ export declare const selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateDatetime | import("../generators/Generators.js").GenerateYear | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | undefined;
@@ -0,0 +1,2 @@
1
+ import type { Column, Table } from '../types/tables.js';
2
+ export declare const selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateDatetime | import("../generators/Generators.js").GenerateYear | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | undefined;
package/package.json CHANGED
@@ -1,105 +1,110 @@
1
1
  {
2
- "name": "drizzle-seed",
3
- "version": "0.3.2-f8a2f3c",
4
- "main": "index.js",
5
- "type": "module",
6
- "scripts": {
7
- "build": "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",
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": ">=0.36.4"
69
- },
70
- "peerDependenciesMeta": {
71
- "drizzle-orm": {
72
- "optional": true
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/better-sqlite3": "^7.6.11",
81
- "@types/dockerode": "^3.3.31",
82
- "@types/node": "^22.5.4",
83
- "@types/pg": "^8.11.6",
84
- "@types/uuid": "^10.0.0",
85
- "better-sqlite3": "^11.1.2",
86
- "cpy": "^11.1.0",
87
- "dockerode": "^4.0.2",
88
- "dotenv": "^16.4.5",
89
- "drizzle-kit": "workspace:./drizzle-kit/dist",
90
- "drizzle-orm": "workspace:./drizzle-orm/dist",
91
- "get-port": "^7.1.0",
92
- "mysql2": "^3.3.3",
93
- "pg": "^8.12.0",
94
- "resolve-tspaths": "^0.8.19",
95
- "rollup": "^4.21.2",
96
- "tslib": "^2.7.0",
97
- "tsx": "^4.19.0",
98
- "uuid": "^10.0.0",
99
- "vitest": "^2.0.5",
100
- "zx": "^8.1.5"
101
- },
102
- "dependencies": {
103
- "pure-rand": "^6.1.0"
104
- }
2
+ "name": "drizzle-seed",
3
+ "version": "0.4.0-02522e1",
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
+ }
105
110
  }
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { PgDatabase, PgSchema } from 'drizzle-orm/pg-core';
3
+ import { PgTable } from 'drizzle-orm/pg-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetPostgres: (db: PgDatabase<any, any>, pgTables: {
7
+ [key: string]: PgTable;
8
+ }) => Promise<void>;
9
+ export declare const filterPgSchema: (schema: {
10
+ [key: string]: PgTable | PgSchema | Relations | any;
11
+ }) => {
12
+ pgSchema: {
13
+ [k: string]: PgTable<import("drizzle-orm/pg-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ pgTables: {
16
+ [k: string]: PgTable<import("drizzle-orm/pg-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedPostgres: (db: PgDatabase<any, any>, schema: {
20
+ [key: string]: PgTable | PgSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapPgColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { PgDatabase, PgSchema } from 'drizzle-orm/pg-core';
3
+ import { PgTable } from 'drizzle-orm/pg-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetPostgres: (db: PgDatabase<any, any>, pgTables: {
7
+ [key: string]: PgTable;
8
+ }) => Promise<void>;
9
+ export declare const filterPgSchema: (schema: {
10
+ [key: string]: PgTable | PgSchema | Relations | any;
11
+ }) => {
12
+ pgSchema: {
13
+ [k: string]: PgTable<import("drizzle-orm/pg-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ pgTables: {
16
+ [k: string]: PgTable<import("drizzle-orm/pg-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedPostgres: (db: PgDatabase<any, any>, schema: {
20
+ [key: string]: PgTable | PgSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapPgColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { PgDatabase, PgSchema } from 'drizzle-orm/pg-core';
3
+ import { PgTable } from 'drizzle-orm/pg-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetPostgres: (db: PgDatabase<any, any>, pgTables: {
7
+ [key: string]: PgTable;
8
+ }) => Promise<void>;
9
+ export declare const filterPgSchema: (schema: {
10
+ [key: string]: PgTable | PgSchema | Relations | any;
11
+ }) => {
12
+ pgSchema: {
13
+ [k: string]: PgTable<import("drizzle-orm/pg-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ pgTables: {
16
+ [k: string]: PgTable<import("drizzle-orm/pg-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedPostgres: (db: PgDatabase<any, any>, schema: {
20
+ [key: string]: PgTable | PgSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapPgColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,3 @@
1
+ import type { GenerateInterval } from '../generators/Generators.js';
2
+ import type { Column, Table } from '../types/tables.js';
3
+ export declare const selectGeneratorForPostgresColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateArray | import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | GenerateInterval | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | import("../generators/Generators.js").GenerateUUID | import("../generators/Generators.js").GeneratePoint | import("../generators/Generators.js").GenerateLine | import("../generators/Generators.js").GenerateBitString | import("../generators/Generators.js").GenerateInet | import("../generators/Generators.js").GenerateGeometry | import("../generators/Generators.js").GenerateVector | undefined;
@@ -0,0 +1,3 @@
1
+ import type { GenerateInterval } from '../generators/Generators.js';
2
+ import type { Column, Table } from '../types/tables.js';
3
+ export declare const selectGeneratorForPostgresColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateArray | import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | GenerateInterval | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | import("../generators/Generators.js").GenerateUUID | import("../generators/Generators.js").GeneratePoint | import("../generators/Generators.js").GenerateLine | import("../generators/Generators.js").GenerateBitString | import("../generators/Generators.js").GenerateInet | import("../generators/Generators.js").GenerateGeometry | import("../generators/Generators.js").GenerateVector | undefined;
@@ -0,0 +1,3 @@
1
+ import type { GenerateInterval } from '../generators/Generators.js';
2
+ import type { Column, Table } from '../types/tables.js';
3
+ export declare const selectGeneratorForPostgresColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateArray | import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | GenerateInterval | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | import("../generators/Generators.js").GenerateUUID | import("../generators/Generators.js").GeneratePoint | import("../generators/Generators.js").GenerateLine | import("../generators/Generators.js").GenerateBitString | import("../generators/Generators.js").GenerateInet | import("../generators/Generators.js").GenerateGeometry | import("../generators/Generators.js").GenerateVector | undefined;
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { SingleStoreDatabase, SingleStoreSchema } from 'drizzle-orm/singlestore-core';
3
+ import { SingleStoreTable } from 'drizzle-orm/singlestore-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
7
+ [key: string]: SingleStoreTable;
8
+ }) => Promise<void>;
9
+ export declare const filterSingleStoreTables: (schema: {
10
+ [key: string]: SingleStoreTable | SingleStoreSchema | Relations | any;
11
+ }) => {
12
+ singleStoreSchema: {
13
+ [k: string]: SingleStoreTable<import("drizzle-orm/singlestore-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ singleStoreTables: {
16
+ [k: string]: SingleStoreTable<import("drizzle-orm/singlestore-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
20
+ [key: string]: SingleStoreTable | SingleStoreSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapSingleStoreColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { SingleStoreDatabase, SingleStoreSchema } from 'drizzle-orm/singlestore-core';
3
+ import { SingleStoreTable } from 'drizzle-orm/singlestore-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
7
+ [key: string]: SingleStoreTable;
8
+ }) => Promise<void>;
9
+ export declare const filterSingleStoreTables: (schema: {
10
+ [key: string]: SingleStoreTable | SingleStoreSchema | Relations | any;
11
+ }) => {
12
+ singleStoreSchema: {
13
+ [k: string]: SingleStoreTable<import("drizzle-orm/singlestore-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ singleStoreTables: {
16
+ [k: string]: SingleStoreTable<import("drizzle-orm/singlestore-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
20
+ [key: string]: SingleStoreTable | SingleStoreSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapSingleStoreColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { SingleStoreDatabase, SingleStoreSchema } from 'drizzle-orm/singlestore-core';
3
+ import { SingleStoreTable } from 'drizzle-orm/singlestore-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
7
+ [key: string]: SingleStoreTable;
8
+ }) => Promise<void>;
9
+ export declare const filterSingleStoreTables: (schema: {
10
+ [key: string]: SingleStoreTable | SingleStoreSchema | Relations | any;
11
+ }) => {
12
+ singleStoreSchema: {
13
+ [k: string]: SingleStoreTable<import("drizzle-orm/singlestore-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ singleStoreTables: {
16
+ [k: string]: SingleStoreTable<import("drizzle-orm/singlestore-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedSingleStore: (db: SingleStoreDatabase<any, any>, schema: {
20
+ [key: string]: SingleStoreTable | SingleStoreSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapSingleStoreColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,2 @@
1
+ import type { Column, Table } from '../types/tables.js';
2
+ export declare const selectGeneratorForSingleStoreColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateDatetime | import("../generators/Generators.js").GenerateYear | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | import("../generators/Generators.js").GenerateVector | undefined;