drizzle-seed 0.3.2-b5a9650 → 0.4.0-aca84cf

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 (74) hide show
  1. package/{services/SeedService.d.cts → SeedService.d.cts} +18 -35
  2. package/{services/SeedService.d.mts → SeedService.d.mts} +18 -35
  3. package/{services/SeedService.d.ts → SeedService.d.ts} +18 -35
  4. package/cockroach-core/index.d.cts +24 -0
  5. package/cockroach-core/index.d.mts +24 -0
  6. package/cockroach-core/index.d.ts +24 -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/{services → generators}/GeneratorFuncs.d.cts +311 -35
  11. package/{services → generators}/GeneratorFuncs.d.mts +311 -35
  12. package/{services → generators}/GeneratorFuncs.d.ts +311 -35
  13. package/{services → generators}/Generators.d.cts +149 -23
  14. package/{services → generators}/Generators.d.mts +149 -23
  15. package/{services → generators}/Generators.d.ts +149 -23
  16. package/generators/utils.d.cts +38 -0
  17. package/generators/utils.d.mts +38 -0
  18. package/generators/utils.d.ts +38 -0
  19. package/{services → generators}/versioning/v2.d.cts +1 -1
  20. package/{services → generators}/versioning/v2.d.mts +1 -1
  21. package/{services → generators}/versioning/v2.d.ts +1 -1
  22. package/index.cjs +2800 -1060
  23. package/index.cjs.map +1 -1
  24. package/index.d.cts +136 -81
  25. package/index.d.mts +136 -81
  26. package/index.d.ts +136 -81
  27. package/index.mjs +2813 -1072
  28. package/index.mjs.map +1 -1
  29. package/mssql-core/index.d.cts +24 -0
  30. package/mssql-core/index.d.mts +24 -0
  31. package/mssql-core/index.d.ts +24 -0
  32. package/mssql-core/selectGensForColumn.d.cts +2 -0
  33. package/mssql-core/selectGensForColumn.d.mts +2 -0
  34. package/mssql-core/selectGensForColumn.d.ts +2 -0
  35. package/mysql-core/index.d.cts +24 -0
  36. package/mysql-core/index.d.mts +24 -0
  37. package/mysql-core/index.d.ts +24 -0
  38. package/mysql-core/selectGensForColumn.d.cts +2 -0
  39. package/mysql-core/selectGensForColumn.d.mts +2 -0
  40. package/mysql-core/selectGensForColumn.d.ts +2 -0
  41. package/package.json +6 -2
  42. package/pg-core/index.d.cts +24 -0
  43. package/pg-core/index.d.mts +24 -0
  44. package/pg-core/index.d.ts +24 -0
  45. package/pg-core/selectGensForColumn.d.cts +3 -0
  46. package/pg-core/selectGensForColumn.d.mts +3 -0
  47. package/pg-core/selectGensForColumn.d.ts +3 -0
  48. package/singlestore-core/index.d.cts +24 -0
  49. package/singlestore-core/index.d.mts +24 -0
  50. package/singlestore-core/index.d.ts +24 -0
  51. package/singlestore-core/selectGensForColumn.d.cts +2 -0
  52. package/singlestore-core/selectGensForColumn.d.mts +2 -0
  53. package/singlestore-core/selectGensForColumn.d.ts +2 -0
  54. package/sqlite-core/index.d.cts +24 -0
  55. package/sqlite-core/index.d.mts +24 -0
  56. package/sqlite-core/index.d.ts +24 -0
  57. package/sqlite-core/selectGensForColumn.d.cts +2 -0
  58. package/sqlite-core/selectGensForColumn.d.mts +2 -0
  59. package/sqlite-core/selectGensForColumn.d.ts +2 -0
  60. package/types/seedService.d.cts +12 -2
  61. package/types/seedService.d.mts +12 -2
  62. package/types/seedService.d.ts +12 -2
  63. package/types/tables.d.cts +2 -0
  64. package/types/tables.d.mts +2 -0
  65. package/types/tables.d.ts +2 -0
  66. package/utils.d.cts +4 -0
  67. package/utils.d.mts +4 -0
  68. package/utils.d.ts +4 -0
  69. package/services/utils.d.cts +0 -27
  70. package/services/utils.d.mts +0 -27
  71. package/services/utils.d.ts +0 -27
  72. /package/{services → generators}/apiVersion.d.cts +0 -0
  73. /package/{services → generators}/apiVersion.d.mts +0 -0
  74. /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,35 +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
- updateColumnSequence: ({ db, columnConfig: { schemaName, tableName, columnName, valueToUpdate } }: {
134
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
135
- columnConfig: {
136
- schemaName?: string;
137
- tableName: string;
138
- columnName: string;
139
- valueToUpdate?: number | bigint;
140
- };
141
- }) => Promise<void>;
142
125
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
143
126
  generatedValues: {
144
- [columnName: string]: number | string | boolean | undefined;
127
+ [columnName: string]: GeneratedValueType;
145
128
  }[];
146
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
129
+ db: DbType;
147
130
  schema: {
148
- [key: string]: PgTable | MySqlTable | SQLiteTable;
131
+ [key: string]: TableType;
149
132
  };
150
133
  tableName: string;
151
134
  override: boolean;
152
135
  }) => Promise<any>;
153
136
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
154
137
  generatedValues: {
155
- [columnName: string]: number | string | boolean | undefined;
138
+ [columnName: string]: GeneratedValueType;
156
139
  }[];
157
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
140
+ db: DbType;
158
141
  schema: {
159
- [key: string]: PgTable | MySqlTable | SQLiteTable;
142
+ [key: string]: TableType;
160
143
  };
161
144
  tableName: string;
162
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,35 +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
- updateColumnSequence: ({ db, columnConfig: { schemaName, tableName, columnName, valueToUpdate } }: {
134
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
135
- columnConfig: {
136
- schemaName?: string;
137
- tableName: string;
138
- columnName: string;
139
- valueToUpdate?: number | bigint;
140
- };
141
- }) => Promise<void>;
142
125
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
143
126
  generatedValues: {
144
- [columnName: string]: number | string | boolean | undefined;
127
+ [columnName: string]: GeneratedValueType;
145
128
  }[];
146
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
129
+ db: DbType;
147
130
  schema: {
148
- [key: string]: PgTable | MySqlTable | SQLiteTable;
131
+ [key: string]: TableType;
149
132
  };
150
133
  tableName: string;
151
134
  override: boolean;
152
135
  }) => Promise<any>;
153
136
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
154
137
  generatedValues: {
155
- [columnName: string]: number | string | boolean | undefined;
138
+ [columnName: string]: GeneratedValueType;
156
139
  }[];
157
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
140
+ db: DbType;
158
141
  schema: {
159
- [key: string]: PgTable | MySqlTable | SQLiteTable;
142
+ [key: string]: TableType;
160
143
  };
161
144
  tableName: string;
162
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,35 +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
- updateColumnSequence: ({ db, columnConfig: { schemaName, tableName, columnName, valueToUpdate } }: {
134
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
135
- columnConfig: {
136
- schemaName?: string;
137
- tableName: string;
138
- columnName: string;
139
- valueToUpdate?: number | bigint;
140
- };
141
- }) => Promise<void>;
142
125
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
143
126
  generatedValues: {
144
- [columnName: string]: number | string | boolean | undefined;
127
+ [columnName: string]: GeneratedValueType;
145
128
  }[];
146
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
129
+ db: DbType;
147
130
  schema: {
148
- [key: string]: PgTable | MySqlTable | SQLiteTable;
131
+ [key: string]: TableType;
149
132
  };
150
133
  tableName: string;
151
134
  override: boolean;
152
135
  }) => Promise<any>;
153
136
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
154
137
  generatedValues: {
155
- [columnName: string]: number | string | boolean | undefined;
138
+ [columnName: string]: GeneratedValueType;
156
139
  }[];
157
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
140
+ db: DbType;
158
141
  schema: {
159
- [key: string]: PgTable | MySqlTable | SQLiteTable;
142
+ [key: string]: TableType;
160
143
  };
161
144
  tableName: string;
162
145
  uniqueNotNullColName: string;
@@ -0,0 +1,24 @@
1
+ import { Relations } from 'drizzle-orm';
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
+ export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
6
+ [key: string]: CockroachTable;
7
+ }) => Promise<void>;
8
+ export declare const filterCockroachSchema: (schema: {
9
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
10
+ }) => {
11
+ cockroachSchema: {
12
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
13
+ };
14
+ cockroachTables: {
15
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
16
+ };
17
+ };
18
+ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
19
+ [key: string]: CockroachTable | CockroachSchema | 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';
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
+ export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
6
+ [key: string]: CockroachTable;
7
+ }) => Promise<void>;
8
+ export declare const filterCockroachSchema: (schema: {
9
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
10
+ }) => {
11
+ cockroachSchema: {
12
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
13
+ };
14
+ cockroachTables: {
15
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
16
+ };
17
+ };
18
+ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
19
+ [key: string]: CockroachTable | CockroachSchema | 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';
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
+ export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
6
+ [key: string]: CockroachTable;
7
+ }) => Promise<void>;
8
+ export declare const filterCockroachSchema: (schema: {
9
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
10
+ }) => {
11
+ cockroachSchema: {
12
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
13
+ };
14
+ cockroachTables: {
15
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
16
+ };
17
+ };
18
+ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
19
+ [key: string]: CockroachTable | CockroachSchema | Relations | any;
20
+ }, options?: {
21
+ count?: number;
22
+ seed?: number;
23
+ version?: number;
24
+ }, refinements?: RefinementsType) => Promise<void>;
@@ -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;