drizzle-seed 0.3.2-f8a2f3c → 0.4.0-08e4e66

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 (77) hide show
  1. package/{services/SeedService.d.cts → SeedService.d.cts} +18 -26
  2. package/{services/SeedService.d.mts → SeedService.d.mts} +18 -26
  3. package/{services/SeedService.d.ts → SeedService.d.ts} +18 -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 +312 -59
  14. package/{services → generators}/GeneratorFuncs.d.mts +312 -59
  15. package/{services → generators}/GeneratorFuncs.d.ts +312 -59
  16. package/{services → generators}/Generators.d.cts +277 -54
  17. package/{services → generators}/Generators.d.mts +277 -54
  18. package/{services → generators}/Generators.d.ts +277 -54
  19. package/generators/utils.d.cts +38 -0
  20. package/generators/utils.d.mts +38 -0
  21. package/generators/utils.d.ts +38 -0
  22. package/{services → generators}/versioning/v2.d.cts +13 -6
  23. package/{services → generators}/versioning/v2.d.mts +13 -6
  24. package/{services → generators}/versioning/v2.d.ts +13 -6
  25. package/index.cjs +3156 -1472
  26. package/index.cjs.map +1 -1
  27. package/index.d.cts +92 -123
  28. package/index.d.mts +92 -123
  29. package/index.d.ts +92 -123
  30. package/index.mjs +3161 -1476
  31. package/index.mjs.map +1 -1
  32. package/mssql-core/index.d.cts +24 -0
  33. package/mssql-core/index.d.mts +24 -0
  34. package/mssql-core/index.d.ts +24 -0
  35. package/mssql-core/selectGensForColumn.d.cts +2 -0
  36. package/mssql-core/selectGensForColumn.d.mts +2 -0
  37. package/mssql-core/selectGensForColumn.d.ts +2 -0
  38. package/mysql-core/index.d.cts +28 -0
  39. package/mysql-core/index.d.mts +28 -0
  40. package/mysql-core/index.d.ts +28 -0
  41. package/mysql-core/selectGensForColumn.d.cts +2 -0
  42. package/mysql-core/selectGensForColumn.d.mts +2 -0
  43. package/mysql-core/selectGensForColumn.d.ts +2 -0
  44. package/package.json +13 -9
  45. package/pg-core/index.d.cts +28 -0
  46. package/pg-core/index.d.mts +28 -0
  47. package/pg-core/index.d.ts +28 -0
  48. package/pg-core/selectGensForColumn.d.cts +3 -0
  49. package/pg-core/selectGensForColumn.d.mts +3 -0
  50. package/pg-core/selectGensForColumn.d.ts +3 -0
  51. package/singlestore-core/index.d.cts +28 -0
  52. package/singlestore-core/index.d.mts +28 -0
  53. package/singlestore-core/index.d.ts +28 -0
  54. package/singlestore-core/selectGensForColumn.d.cts +2 -0
  55. package/singlestore-core/selectGensForColumn.d.mts +2 -0
  56. package/singlestore-core/selectGensForColumn.d.ts +2 -0
  57. package/sqlite-core/index.d.cts +28 -0
  58. package/sqlite-core/index.d.mts +28 -0
  59. package/sqlite-core/index.d.ts +28 -0
  60. package/sqlite-core/selectGensForColumn.d.cts +2 -0
  61. package/sqlite-core/selectGensForColumn.d.mts +2 -0
  62. package/sqlite-core/selectGensForColumn.d.ts +2 -0
  63. package/types/seedService.d.cts +12 -2
  64. package/types/seedService.d.mts +12 -2
  65. package/types/seedService.d.ts +12 -2
  66. package/types/tables.d.cts +20 -0
  67. package/types/tables.d.mts +20 -0
  68. package/types/tables.d.ts +20 -0
  69. package/utils.d.cts +4 -0
  70. package/utils.d.mts +4 -0
  71. package/utils.d.ts +4 -0
  72. package/services/utils.d.cts +0 -23
  73. package/services/utils.d.mts +0 -23
  74. package/services/utils.d.ts +0 -23
  75. /package/{services → generators}/apiVersion.d.cts +0 -0
  76. /package/{services → generators}/apiVersion.d.mts +0 -0
  77. /package/{services → generators}/apiVersion.d.ts +0 -0
@@ -1,12 +1,6 @@
1
- import type { MySqlTable } from 'drizzle-orm/mysql-core';
2
- import { MySqlDatabase } from 'drizzle-orm/mysql-core';
3
- import type { PgTable } from 'drizzle-orm/pg-core';
4
- import { PgDatabase } from 'drizzle-orm/pg-core';
5
- import type { SQLiteTable } from 'drizzle-orm/sqlite-core';
6
- import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
7
- import type { GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType } from '../types/seedService.js';
8
- import type { Column, Prettify, Relation, Table } from '../types/tables.js';
9
- import type { AbstractGenerator, GenerateArray, GenerateInterval } from './Generators.js';
1
+ import type { AbstractGenerator } from './generators/Generators.js';
2
+ import type { DbType, GeneratedValueType, GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType, TableType } from './types/seedService.js';
3
+ import type { Prettify, Relation, Table } from './types/tables.js';
10
4
  export declare class SeedService {
11
5
  static readonly entityKind: string;
12
6
  private defaultCountForTable;
@@ -14,8 +8,9 @@ export declare class SeedService {
14
8
  private postgresMaxParametersNumber;
15
9
  private mysqlMaxParametersNumber;
16
10
  private sqliteMaxParametersNumber;
11
+ private mssqlMaxParametersNumber;
17
12
  private version?;
18
- generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite", tables: Table[], relations: (Relation & {
13
+ generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
19
14
  isCyclic: boolean;
20
15
  })[], refinements?: RefinementsType, options?: {
21
16
  count?: number;
@@ -61,9 +56,6 @@ export declare class SeedService {
61
56
  weight: number;
62
57
  count: number | number[];
63
58
  }[], count: number, seed: number) => number;
64
- selectGeneratorForPostgresColumn: (table: Table, col: Column) => GenerateArray | import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | GenerateInterval | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | import("./Generators.js").GenerateUUID | import("./Generators.js").GeneratePoint | import("./Generators.js").GenerateLine | undefined;
65
- selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateDatetime | import("./Generators.js").GenerateYear | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
66
- selectGeneratorForSqlite: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
67
59
  filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
68
60
  filteredTablesGenerators: {
69
61
  tableName: string;
@@ -88,8 +80,8 @@ export declare class SeedService {
88
80
  };
89
81
  generateTablesValues: (relations: (Relation & {
90
82
  isCyclic: boolean;
91
- })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>, schema?: {
92
- [key: string]: PgTable | MySqlTable | SQLiteTable;
83
+ })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
84
+ [key: string]: TableType;
93
85
  }, options?: {
94
86
  count?: number;
95
87
  seed?: number;
@@ -100,7 +92,7 @@ export declare class SeedService {
100
92
  tablesValues?: {
101
93
  tableName: string;
102
94
  rows: {
103
- [columnName: string]: string | number | boolean | undefined;
95
+ [columnName: string]: GeneratedValueType;
104
96
  }[];
105
97
  }[];
106
98
  tablesUniqueNotNullColumn?: {
@@ -111,14 +103,14 @@ export declare class SeedService {
111
103
  }) => Promise<{
112
104
  tableName: string;
113
105
  rows: {
114
- [columnName: string]: string | number | boolean | undefined;
106
+ [columnName: string]: GeneratedValueType;
115
107
  }[];
116
108
  }[]>;
117
109
  generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
118
110
  tableGenerators: Prettify<TableGeneratorsType>;
119
- db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
111
+ db?: DbType;
120
112
  schema?: {
121
- [key: string]: PgTable | MySqlTable | SQLiteTable;
113
+ [key: string]: TableType;
122
114
  };
123
115
  tableName?: string;
124
116
  count?: number;
@@ -128,26 +120,26 @@ export declare class SeedService {
128
120
  uniqueNotNullColName?: string;
129
121
  batchSize?: number;
130
122
  }) => Promise<{
131
- [columnName: string]: string | number | boolean | undefined;
123
+ [columnName: string]: GeneratedValueType;
132
124
  }[]>;
133
125
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
134
126
  generatedValues: {
135
- [columnName: string]: number | string | boolean | undefined;
127
+ [columnName: string]: GeneratedValueType;
136
128
  }[];
137
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
129
+ db: DbType;
138
130
  schema: {
139
- [key: string]: PgTable | MySqlTable | SQLiteTable;
131
+ [key: string]: TableType;
140
132
  };
141
133
  tableName: string;
142
134
  override: boolean;
143
135
  }) => Promise<any>;
144
136
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
145
137
  generatedValues: {
146
- [columnName: string]: number | string | boolean | undefined;
138
+ [columnName: string]: GeneratedValueType;
147
139
  }[];
148
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
140
+ db: DbType;
149
141
  schema: {
150
- [key: string]: PgTable | MySqlTable | SQLiteTable;
142
+ [key: string]: TableType;
151
143
  };
152
144
  tableName: string;
153
145
  uniqueNotNullColName: string;
@@ -1,12 +1,6 @@
1
- import type { MySqlTable } from 'drizzle-orm/mysql-core';
2
- import { MySqlDatabase } from 'drizzle-orm/mysql-core';
3
- import type { PgTable } from 'drizzle-orm/pg-core';
4
- import { PgDatabase } from 'drizzle-orm/pg-core';
5
- import type { SQLiteTable } from 'drizzle-orm/sqlite-core';
6
- import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
7
- import type { GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType } from '../types/seedService.js';
8
- import type { Column, Prettify, Relation, Table } from '../types/tables.js';
9
- import type { AbstractGenerator, GenerateArray, GenerateInterval } from './Generators.js';
1
+ import type { AbstractGenerator } from './generators/Generators.js';
2
+ import type { DbType, GeneratedValueType, GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType, TableType } from './types/seedService.js';
3
+ import type { Prettify, Relation, Table } from './types/tables.js';
10
4
  export declare class SeedService {
11
5
  static readonly entityKind: string;
12
6
  private defaultCountForTable;
@@ -14,8 +8,9 @@ export declare class SeedService {
14
8
  private postgresMaxParametersNumber;
15
9
  private mysqlMaxParametersNumber;
16
10
  private sqliteMaxParametersNumber;
11
+ private mssqlMaxParametersNumber;
17
12
  private version?;
18
- generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite", tables: Table[], relations: (Relation & {
13
+ generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
19
14
  isCyclic: boolean;
20
15
  })[], refinements?: RefinementsType, options?: {
21
16
  count?: number;
@@ -61,9 +56,6 @@ export declare class SeedService {
61
56
  weight: number;
62
57
  count: number | number[];
63
58
  }[], count: number, seed: number) => number;
64
- selectGeneratorForPostgresColumn: (table: Table, col: Column) => GenerateArray | import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | GenerateInterval | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | import("./Generators.js").GenerateUUID | import("./Generators.js").GeneratePoint | import("./Generators.js").GenerateLine | undefined;
65
- selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateDatetime | import("./Generators.js").GenerateYear | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
66
- selectGeneratorForSqlite: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
67
59
  filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
68
60
  filteredTablesGenerators: {
69
61
  tableName: string;
@@ -88,8 +80,8 @@ export declare class SeedService {
88
80
  };
89
81
  generateTablesValues: (relations: (Relation & {
90
82
  isCyclic: boolean;
91
- })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>, schema?: {
92
- [key: string]: PgTable | MySqlTable | SQLiteTable;
83
+ })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
84
+ [key: string]: TableType;
93
85
  }, options?: {
94
86
  count?: number;
95
87
  seed?: number;
@@ -100,7 +92,7 @@ export declare class SeedService {
100
92
  tablesValues?: {
101
93
  tableName: string;
102
94
  rows: {
103
- [columnName: string]: string | number | boolean | undefined;
95
+ [columnName: string]: GeneratedValueType;
104
96
  }[];
105
97
  }[];
106
98
  tablesUniqueNotNullColumn?: {
@@ -111,14 +103,14 @@ export declare class SeedService {
111
103
  }) => Promise<{
112
104
  tableName: string;
113
105
  rows: {
114
- [columnName: string]: string | number | boolean | undefined;
106
+ [columnName: string]: GeneratedValueType;
115
107
  }[];
116
108
  }[]>;
117
109
  generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
118
110
  tableGenerators: Prettify<TableGeneratorsType>;
119
- db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
111
+ db?: DbType;
120
112
  schema?: {
121
- [key: string]: PgTable | MySqlTable | SQLiteTable;
113
+ [key: string]: TableType;
122
114
  };
123
115
  tableName?: string;
124
116
  count?: number;
@@ -128,26 +120,26 @@ export declare class SeedService {
128
120
  uniqueNotNullColName?: string;
129
121
  batchSize?: number;
130
122
  }) => Promise<{
131
- [columnName: string]: string | number | boolean | undefined;
123
+ [columnName: string]: GeneratedValueType;
132
124
  }[]>;
133
125
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
134
126
  generatedValues: {
135
- [columnName: string]: number | string | boolean | undefined;
127
+ [columnName: string]: GeneratedValueType;
136
128
  }[];
137
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
129
+ db: DbType;
138
130
  schema: {
139
- [key: string]: PgTable | MySqlTable | SQLiteTable;
131
+ [key: string]: TableType;
140
132
  };
141
133
  tableName: string;
142
134
  override: boolean;
143
135
  }) => Promise<any>;
144
136
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
145
137
  generatedValues: {
146
- [columnName: string]: number | string | boolean | undefined;
138
+ [columnName: string]: GeneratedValueType;
147
139
  }[];
148
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
140
+ db: DbType;
149
141
  schema: {
150
- [key: string]: PgTable | MySqlTable | SQLiteTable;
142
+ [key: string]: TableType;
151
143
  };
152
144
  tableName: string;
153
145
  uniqueNotNullColName: string;
@@ -1,12 +1,6 @@
1
- import type { MySqlTable } from 'drizzle-orm/mysql-core';
2
- import { MySqlDatabase } from 'drizzle-orm/mysql-core';
3
- import type { PgTable } from 'drizzle-orm/pg-core';
4
- import { PgDatabase } from 'drizzle-orm/pg-core';
5
- import type { SQLiteTable } from 'drizzle-orm/sqlite-core';
6
- import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
7
- import type { GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType } from '../types/seedService.js';
8
- import type { Column, Prettify, Relation, Table } from '../types/tables.js';
9
- import type { AbstractGenerator, GenerateArray, GenerateInterval } from './Generators.js';
1
+ import type { AbstractGenerator } from './generators/Generators.js';
2
+ import type { DbType, GeneratedValueType, GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType, TableType } from './types/seedService.js';
3
+ import type { Prettify, Relation, Table } from './types/tables.js';
10
4
  export declare class SeedService {
11
5
  static readonly entityKind: string;
12
6
  private defaultCountForTable;
@@ -14,8 +8,9 @@ export declare class SeedService {
14
8
  private postgresMaxParametersNumber;
15
9
  private mysqlMaxParametersNumber;
16
10
  private sqliteMaxParametersNumber;
11
+ private mssqlMaxParametersNumber;
17
12
  private version?;
18
- generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite", tables: Table[], relations: (Relation & {
13
+ generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
19
14
  isCyclic: boolean;
20
15
  })[], refinements?: RefinementsType, options?: {
21
16
  count?: number;
@@ -61,9 +56,6 @@ export declare class SeedService {
61
56
  weight: number;
62
57
  count: number | number[];
63
58
  }[], count: number, seed: number) => number;
64
- selectGeneratorForPostgresColumn: (table: Table, col: Column) => GenerateArray | import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | GenerateInterval | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | import("./Generators.js").GenerateUUID | import("./Generators.js").GeneratePoint | import("./Generators.js").GenerateLine | undefined;
65
- selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateDatetime | import("./Generators.js").GenerateYear | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
66
- selectGeneratorForSqlite: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
67
59
  filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
68
60
  filteredTablesGenerators: {
69
61
  tableName: string;
@@ -88,8 +80,8 @@ export declare class SeedService {
88
80
  };
89
81
  generateTablesValues: (relations: (Relation & {
90
82
  isCyclic: boolean;
91
- })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>, schema?: {
92
- [key: string]: PgTable | MySqlTable | SQLiteTable;
83
+ })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
84
+ [key: string]: TableType;
93
85
  }, options?: {
94
86
  count?: number;
95
87
  seed?: number;
@@ -100,7 +92,7 @@ export declare class SeedService {
100
92
  tablesValues?: {
101
93
  tableName: string;
102
94
  rows: {
103
- [columnName: string]: string | number | boolean | undefined;
95
+ [columnName: string]: GeneratedValueType;
104
96
  }[];
105
97
  }[];
106
98
  tablesUniqueNotNullColumn?: {
@@ -111,14 +103,14 @@ export declare class SeedService {
111
103
  }) => Promise<{
112
104
  tableName: string;
113
105
  rows: {
114
- [columnName: string]: string | number | boolean | undefined;
106
+ [columnName: string]: GeneratedValueType;
115
107
  }[];
116
108
  }[]>;
117
109
  generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
118
110
  tableGenerators: Prettify<TableGeneratorsType>;
119
- db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
111
+ db?: DbType;
120
112
  schema?: {
121
- [key: string]: PgTable | MySqlTable | SQLiteTable;
113
+ [key: string]: TableType;
122
114
  };
123
115
  tableName?: string;
124
116
  count?: number;
@@ -128,26 +120,26 @@ export declare class SeedService {
128
120
  uniqueNotNullColName?: string;
129
121
  batchSize?: number;
130
122
  }) => Promise<{
131
- [columnName: string]: string | number | boolean | undefined;
123
+ [columnName: string]: GeneratedValueType;
132
124
  }[]>;
133
125
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
134
126
  generatedValues: {
135
- [columnName: string]: number | string | boolean | undefined;
127
+ [columnName: string]: GeneratedValueType;
136
128
  }[];
137
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
129
+ db: DbType;
138
130
  schema: {
139
- [key: string]: PgTable | MySqlTable | SQLiteTable;
131
+ [key: string]: TableType;
140
132
  };
141
133
  tableName: string;
142
134
  override: boolean;
143
135
  }) => Promise<any>;
144
136
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
145
137
  generatedValues: {
146
- [columnName: string]: number | string | boolean | undefined;
138
+ [columnName: string]: GeneratedValueType;
147
139
  }[];
148
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
140
+ db: DbType;
149
141
  schema: {
150
- [key: string]: PgTable | MySqlTable | SQLiteTable;
142
+ [key: string]: TableType;
151
143
  };
152
144
  tableName: string;
153
145
  uniqueNotNullColName: string;
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
3
+ import { CockroachTable } from 'drizzle-orm/cockroach-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
7
+ [key: string]: CockroachTable;
8
+ }) => Promise<void>;
9
+ export declare const filterCockroachSchema: (schema: {
10
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
11
+ }) => {
12
+ cockroachSchema: {
13
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ cockroachTables: {
16
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
20
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapCockroachColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
3
+ import { CockroachTable } from 'drizzle-orm/cockroach-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
7
+ [key: string]: CockroachTable;
8
+ }) => Promise<void>;
9
+ export declare const filterCockroachSchema: (schema: {
10
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
11
+ }) => {
12
+ cockroachSchema: {
13
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ cockroachTables: {
16
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
20
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapCockroachColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
27
+ [key: string]: string;
28
+ }) => Column[];
@@ -0,0 +1,28 @@
1
+ import { Relations } from 'drizzle-orm/_relations';
2
+ import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
3
+ import { CockroachTable } from 'drizzle-orm/cockroach-core';
4
+ import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Column, TableConfigT } from '../types/tables.js';
6
+ export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
7
+ [key: string]: CockroachTable;
8
+ }) => Promise<void>;
9
+ export declare const filterCockroachSchema: (schema: {
10
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
11
+ }) => {
12
+ cockroachSchema: {
13
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
14
+ };
15
+ cockroachTables: {
16
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
17
+ };
18
+ };
19
+ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
20
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
21
+ }, options?: {
22
+ count?: number;
23
+ seed?: number;
24
+ version?: number;
25
+ }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapCockroachColumns: (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 selectGeneratorForCockroachColumn: (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").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 selectGeneratorForCockroachColumn: (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").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 selectGeneratorForCockroachColumn: (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").GenerateBitString | import("../generators/Generators.js").GenerateInet | import("../generators/Generators.js").GenerateGeometry | import("../generators/Generators.js").GenerateVector | undefined;
package/common.d.cts ADDED
@@ -0,0 +1,23 @@
1
+ import { type Relations } from 'drizzle-orm/_relations';
2
+ import type { Column, DrizzleTable, RelationWithReferences, Table, TableConfigT } from './types/tables.js';
3
+ export declare const getSchemaInfo: (drizzleTablesAndRelations: {
4
+ [key: string]: DrizzleTable | Relations;
5
+ }, drizzleTables: {
6
+ [key: string]: DrizzleTable;
7
+ }, mapColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
8
+ [key: string]: string;
9
+ }) => Column[]) => {
10
+ tables: Table[];
11
+ relations: {
12
+ isCyclic: boolean;
13
+ type?: "one" | "many";
14
+ table: string;
15
+ columns: string[];
16
+ refTable: string;
17
+ refColumns: string[];
18
+ refTableRels: RelationWithReferences[];
19
+ }[];
20
+ tableRelations: {
21
+ [tableName: string]: RelationWithReferences[];
22
+ };
23
+ };
package/common.d.mts ADDED
@@ -0,0 +1,23 @@
1
+ import { type Relations } from 'drizzle-orm/_relations';
2
+ import type { Column, DrizzleTable, RelationWithReferences, Table, TableConfigT } from './types/tables.js';
3
+ export declare const getSchemaInfo: (drizzleTablesAndRelations: {
4
+ [key: string]: DrizzleTable | Relations;
5
+ }, drizzleTables: {
6
+ [key: string]: DrizzleTable;
7
+ }, mapColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
8
+ [key: string]: string;
9
+ }) => Column[]) => {
10
+ tables: Table[];
11
+ relations: {
12
+ isCyclic: boolean;
13
+ type?: "one" | "many";
14
+ table: string;
15
+ columns: string[];
16
+ refTable: string;
17
+ refColumns: string[];
18
+ refTableRels: RelationWithReferences[];
19
+ }[];
20
+ tableRelations: {
21
+ [tableName: string]: RelationWithReferences[];
22
+ };
23
+ };
package/common.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ import { type Relations } from 'drizzle-orm/_relations';
2
+ import type { Column, DrizzleTable, RelationWithReferences, Table, TableConfigT } from './types/tables.js';
3
+ export declare const getSchemaInfo: (drizzleTablesAndRelations: {
4
+ [key: string]: DrizzleTable | Relations;
5
+ }, drizzleTables: {
6
+ [key: string]: DrizzleTable;
7
+ }, mapColumns: (tableConfig: TableConfigT, dbToTsColumnNamesMap: {
8
+ [key: string]: string;
9
+ }) => Column[]) => {
10
+ tables: Table[];
11
+ relations: {
12
+ isCyclic: boolean;
13
+ type?: "one" | "many";
14
+ table: string;
15
+ columns: string[];
16
+ refTable: string;
17
+ refColumns: string[];
18
+ refTableRels: RelationWithReferences[];
19
+ }[];
20
+ tableRelations: {
21
+ [tableName: string]: RelationWithReferences[];
22
+ };
23
+ };