drizzle-seed 0.3.2-b5a9650 → 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 -35
  2. package/{services/SeedService.d.mts → SeedService.d.mts} +19 -35
  3. package/{services/SeedService.d.ts → SeedService.d.ts} +19 -35
  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 +3196 -1520
  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 +3201 -1524
  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 -27
  82. package/services/utils.d.mts +0 -27
  83. package/services/utils.d.ts +0 -27
@@ -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,10 @@ 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
+ private hashFromStringGenerator;
14
+ generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
19
15
  isCyclic: boolean;
20
16
  })[], refinements?: RefinementsType, options?: {
21
17
  count?: number;
@@ -61,9 +57,6 @@ export declare class SeedService {
61
57
  weight: number;
62
58
  count: number | number[];
63
59
  }[], 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
60
  filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
68
61
  filteredTablesGenerators: {
69
62
  tableName: string;
@@ -88,8 +81,8 @@ export declare class SeedService {
88
81
  };
89
82
  generateTablesValues: (relations: (Relation & {
90
83
  isCyclic: boolean;
91
- })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>, schema?: {
92
- [key: string]: PgTable | MySqlTable | SQLiteTable;
84
+ })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
85
+ [key: string]: TableType;
93
86
  }, options?: {
94
87
  count?: number;
95
88
  seed?: number;
@@ -100,7 +93,7 @@ export declare class SeedService {
100
93
  tablesValues?: {
101
94
  tableName: string;
102
95
  rows: {
103
- [columnName: string]: string | number | boolean | undefined;
96
+ [columnName: string]: GeneratedValueType;
104
97
  }[];
105
98
  }[];
106
99
  tablesUniqueNotNullColumn?: {
@@ -111,14 +104,14 @@ export declare class SeedService {
111
104
  }) => Promise<{
112
105
  tableName: string;
113
106
  rows: {
114
- [columnName: string]: string | number | boolean | undefined;
107
+ [columnName: string]: GeneratedValueType;
115
108
  }[];
116
109
  }[]>;
117
110
  generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
118
111
  tableGenerators: Prettify<TableGeneratorsType>;
119
- db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
112
+ db?: DbType;
120
113
  schema?: {
121
- [key: string]: PgTable | MySqlTable | SQLiteTable;
114
+ [key: string]: TableType;
122
115
  };
123
116
  tableName?: string;
124
117
  count?: number;
@@ -128,35 +121,26 @@ export declare class SeedService {
128
121
  uniqueNotNullColName?: string;
129
122
  batchSize?: number;
130
123
  }) => Promise<{
131
- [columnName: string]: string | number | boolean | undefined;
124
+ [columnName: string]: GeneratedValueType;
132
125
  }[]>;
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
126
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
143
127
  generatedValues: {
144
- [columnName: string]: number | string | boolean | undefined;
128
+ [columnName: string]: GeneratedValueType;
145
129
  }[];
146
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
130
+ db: DbType;
147
131
  schema: {
148
- [key: string]: PgTable | MySqlTable | SQLiteTable;
132
+ [key: string]: TableType;
149
133
  };
150
134
  tableName: string;
151
135
  override: boolean;
152
136
  }) => Promise<any>;
153
137
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
154
138
  generatedValues: {
155
- [columnName: string]: number | string | boolean | undefined;
139
+ [columnName: string]: GeneratedValueType;
156
140
  }[];
157
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
141
+ db: DbType;
158
142
  schema: {
159
- [key: string]: PgTable | MySqlTable | SQLiteTable;
143
+ [key: string]: TableType;
160
144
  };
161
145
  tableName: string;
162
146
  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,10 @@ 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
+ private hashFromStringGenerator;
14
+ generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
19
15
  isCyclic: boolean;
20
16
  })[], refinements?: RefinementsType, options?: {
21
17
  count?: number;
@@ -61,9 +57,6 @@ export declare class SeedService {
61
57
  weight: number;
62
58
  count: number | number[];
63
59
  }[], 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
60
  filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
68
61
  filteredTablesGenerators: {
69
62
  tableName: string;
@@ -88,8 +81,8 @@ export declare class SeedService {
88
81
  };
89
82
  generateTablesValues: (relations: (Relation & {
90
83
  isCyclic: boolean;
91
- })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>, schema?: {
92
- [key: string]: PgTable | MySqlTable | SQLiteTable;
84
+ })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
85
+ [key: string]: TableType;
93
86
  }, options?: {
94
87
  count?: number;
95
88
  seed?: number;
@@ -100,7 +93,7 @@ export declare class SeedService {
100
93
  tablesValues?: {
101
94
  tableName: string;
102
95
  rows: {
103
- [columnName: string]: string | number | boolean | undefined;
96
+ [columnName: string]: GeneratedValueType;
104
97
  }[];
105
98
  }[];
106
99
  tablesUniqueNotNullColumn?: {
@@ -111,14 +104,14 @@ export declare class SeedService {
111
104
  }) => Promise<{
112
105
  tableName: string;
113
106
  rows: {
114
- [columnName: string]: string | number | boolean | undefined;
107
+ [columnName: string]: GeneratedValueType;
115
108
  }[];
116
109
  }[]>;
117
110
  generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
118
111
  tableGenerators: Prettify<TableGeneratorsType>;
119
- db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
112
+ db?: DbType;
120
113
  schema?: {
121
- [key: string]: PgTable | MySqlTable | SQLiteTable;
114
+ [key: string]: TableType;
122
115
  };
123
116
  tableName?: string;
124
117
  count?: number;
@@ -128,35 +121,26 @@ export declare class SeedService {
128
121
  uniqueNotNullColName?: string;
129
122
  batchSize?: number;
130
123
  }) => Promise<{
131
- [columnName: string]: string | number | boolean | undefined;
124
+ [columnName: string]: GeneratedValueType;
132
125
  }[]>;
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
126
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
143
127
  generatedValues: {
144
- [columnName: string]: number | string | boolean | undefined;
128
+ [columnName: string]: GeneratedValueType;
145
129
  }[];
146
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
130
+ db: DbType;
147
131
  schema: {
148
- [key: string]: PgTable | MySqlTable | SQLiteTable;
132
+ [key: string]: TableType;
149
133
  };
150
134
  tableName: string;
151
135
  override: boolean;
152
136
  }) => Promise<any>;
153
137
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
154
138
  generatedValues: {
155
- [columnName: string]: number | string | boolean | undefined;
139
+ [columnName: string]: GeneratedValueType;
156
140
  }[];
157
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
141
+ db: DbType;
158
142
  schema: {
159
- [key: string]: PgTable | MySqlTable | SQLiteTable;
143
+ [key: string]: TableType;
160
144
  };
161
145
  tableName: string;
162
146
  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,10 @@ 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
+ private hashFromStringGenerator;
14
+ generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
19
15
  isCyclic: boolean;
20
16
  })[], refinements?: RefinementsType, options?: {
21
17
  count?: number;
@@ -61,9 +57,6 @@ export declare class SeedService {
61
57
  weight: number;
62
58
  count: number | number[];
63
59
  }[], 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
60
  filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
68
61
  filteredTablesGenerators: {
69
62
  tableName: string;
@@ -88,8 +81,8 @@ export declare class SeedService {
88
81
  };
89
82
  generateTablesValues: (relations: (Relation & {
90
83
  isCyclic: boolean;
91
- })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>, schema?: {
92
- [key: string]: PgTable | MySqlTable | SQLiteTable;
84
+ })[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
85
+ [key: string]: TableType;
93
86
  }, options?: {
94
87
  count?: number;
95
88
  seed?: number;
@@ -100,7 +93,7 @@ export declare class SeedService {
100
93
  tablesValues?: {
101
94
  tableName: string;
102
95
  rows: {
103
- [columnName: string]: string | number | boolean | undefined;
96
+ [columnName: string]: GeneratedValueType;
104
97
  }[];
105
98
  }[];
106
99
  tablesUniqueNotNullColumn?: {
@@ -111,14 +104,14 @@ export declare class SeedService {
111
104
  }) => Promise<{
112
105
  tableName: string;
113
106
  rows: {
114
- [columnName: string]: string | number | boolean | undefined;
107
+ [columnName: string]: GeneratedValueType;
115
108
  }[];
116
109
  }[]>;
117
110
  generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
118
111
  tableGenerators: Prettify<TableGeneratorsType>;
119
- db?: PgDatabase<any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
112
+ db?: DbType;
120
113
  schema?: {
121
- [key: string]: PgTable | MySqlTable | SQLiteTable;
114
+ [key: string]: TableType;
122
115
  };
123
116
  tableName?: string;
124
117
  count?: number;
@@ -128,35 +121,26 @@ export declare class SeedService {
128
121
  uniqueNotNullColName?: string;
129
122
  batchSize?: number;
130
123
  }) => Promise<{
131
- [columnName: string]: string | number | boolean | undefined;
124
+ [columnName: string]: GeneratedValueType;
132
125
  }[]>;
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
126
  insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
143
127
  generatedValues: {
144
- [columnName: string]: number | string | boolean | undefined;
128
+ [columnName: string]: GeneratedValueType;
145
129
  }[];
146
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
130
+ db: DbType;
147
131
  schema: {
148
- [key: string]: PgTable | MySqlTable | SQLiteTable;
132
+ [key: string]: TableType;
149
133
  };
150
134
  tableName: string;
151
135
  override: boolean;
152
136
  }) => Promise<any>;
153
137
  updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
154
138
  generatedValues: {
155
- [columnName: string]: number | string | boolean | undefined;
139
+ [columnName: string]: GeneratedValueType;
156
140
  }[];
157
- db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
141
+ db: DbType;
158
142
  schema: {
159
- [key: string]: PgTable | MySqlTable | SQLiteTable;
143
+ [key: string]: TableType;
160
144
  };
161
145
  tableName: string;
162
146
  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
+ };