drizzle-seed 0.3.2-f8a2f3c → 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.
- package/{services/SeedService.d.cts → SeedService.d.cts} +18 -26
- package/{services/SeedService.d.mts → SeedService.d.mts} +18 -26
- package/{services/SeedService.d.ts → SeedService.d.ts} +18 -26
- package/cockroach-core/index.d.cts +24 -0
- package/cockroach-core/index.d.mts +24 -0
- package/cockroach-core/index.d.ts +24 -0
- package/cockroach-core/selectGensForColumn.d.cts +3 -0
- package/cockroach-core/selectGensForColumn.d.mts +3 -0
- package/cockroach-core/selectGensForColumn.d.ts +3 -0
- package/{services → generators}/GeneratorFuncs.d.cts +311 -35
- package/{services → generators}/GeneratorFuncs.d.mts +311 -35
- package/{services → generators}/GeneratorFuncs.d.ts +311 -35
- package/{services → generators}/Generators.d.cts +149 -23
- package/{services → generators}/Generators.d.mts +149 -23
- package/{services → generators}/Generators.d.ts +149 -23
- package/generators/utils.d.cts +38 -0
- package/generators/utils.d.mts +38 -0
- package/generators/utils.d.ts +38 -0
- package/{services → generators}/versioning/v2.d.cts +1 -1
- package/{services → generators}/versioning/v2.d.mts +1 -1
- package/{services → generators}/versioning/v2.d.ts +1 -1
- package/index.cjs +2799 -1003
- package/index.cjs.map +1 -1
- package/index.d.cts +136 -81
- package/index.d.mts +136 -81
- package/index.d.ts +136 -81
- package/index.mjs +2813 -1016
- package/index.mjs.map +1 -1
- package/mssql-core/index.d.cts +24 -0
- package/mssql-core/index.d.mts +24 -0
- package/mssql-core/index.d.ts +24 -0
- package/mssql-core/selectGensForColumn.d.cts +2 -0
- package/mssql-core/selectGensForColumn.d.mts +2 -0
- package/mssql-core/selectGensForColumn.d.ts +2 -0
- package/mysql-core/index.d.cts +24 -0
- package/mysql-core/index.d.mts +24 -0
- package/mysql-core/index.d.ts +24 -0
- package/mysql-core/selectGensForColumn.d.cts +2 -0
- package/mysql-core/selectGensForColumn.d.mts +2 -0
- package/mysql-core/selectGensForColumn.d.ts +2 -0
- package/package.json +11 -7
- package/pg-core/index.d.cts +24 -0
- package/pg-core/index.d.mts +24 -0
- package/pg-core/index.d.ts +24 -0
- package/pg-core/selectGensForColumn.d.cts +3 -0
- package/pg-core/selectGensForColumn.d.mts +3 -0
- package/pg-core/selectGensForColumn.d.ts +3 -0
- package/singlestore-core/index.d.cts +24 -0
- package/singlestore-core/index.d.mts +24 -0
- package/singlestore-core/index.d.ts +24 -0
- package/singlestore-core/selectGensForColumn.d.cts +2 -0
- package/singlestore-core/selectGensForColumn.d.mts +2 -0
- package/singlestore-core/selectGensForColumn.d.ts +2 -0
- package/sqlite-core/index.d.cts +24 -0
- package/sqlite-core/index.d.mts +24 -0
- package/sqlite-core/index.d.ts +24 -0
- package/sqlite-core/selectGensForColumn.d.cts +2 -0
- package/sqlite-core/selectGensForColumn.d.mts +2 -0
- package/sqlite-core/selectGensForColumn.d.ts +2 -0
- package/types/seedService.d.cts +12 -2
- package/types/seedService.d.mts +12 -2
- package/types/seedService.d.ts +12 -2
- package/types/tables.d.cts +2 -0
- package/types/tables.d.mts +2 -0
- package/types/tables.d.ts +2 -0
- package/utils.d.cts +4 -0
- package/utils.d.mts +4 -0
- package/utils.d.ts +4 -0
- package/services/utils.d.cts +0 -23
- package/services/utils.d.mts +0 -23
- package/services/utils.d.ts +0 -23
- /package/{services → generators}/apiVersion.d.cts +0 -0
- /package/{services → generators}/apiVersion.d.mts +0 -0
- /package/{services → generators}/apiVersion.d.ts +0 -0
package/index.d.cts
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import { Relations } from 'drizzle-orm';
|
|
2
|
-
import type { MySqlColumn, MySqlSchema } from 'drizzle-orm/mysql-core';
|
|
3
|
-
import { MySqlDatabase
|
|
4
|
-
import type { PgColumn, PgSchema } from 'drizzle-orm/pg-core';
|
|
5
|
-
import { PgDatabase
|
|
6
|
-
import type { SQLiteColumn } from 'drizzle-orm/sqlite-core';
|
|
7
|
-
import { BaseSQLiteDatabase
|
|
8
|
-
import type {
|
|
9
|
-
import {
|
|
10
|
-
import type {
|
|
1
|
+
import type { Relations } from 'drizzle-orm';
|
|
2
|
+
import type { MySqlColumn, MySqlSchema, MySqlTable } from 'drizzle-orm/mysql-core';
|
|
3
|
+
import { MySqlDatabase } from 'drizzle-orm/mysql-core';
|
|
4
|
+
import type { PgColumn, PgSchema, PgTable } from 'drizzle-orm/pg-core';
|
|
5
|
+
import { PgDatabase } from 'drizzle-orm/pg-core';
|
|
6
|
+
import type { SQLiteColumn, SQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
7
|
+
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
8
|
+
import type { MsSqlColumn, MsSqlSchema, MsSqlTable } from 'drizzle-orm/mssql-core';
|
|
9
|
+
import { MsSqlDatabase } from 'drizzle-orm/mssql-core';
|
|
10
|
+
import type { CockroachColumn, CockroachSchema, CockroachTable } from 'drizzle-orm/cockroach-core';
|
|
11
|
+
import { CockroachDatabase } from 'drizzle-orm/cockroach-core';
|
|
12
|
+
import type { SingleStoreColumn, SingleStoreSchema, SingleStoreTable } from 'drizzle-orm/singlestore-core';
|
|
13
|
+
import { SingleStoreDatabase } from 'drizzle-orm/singlestore-core';
|
|
14
|
+
import { generatorsFuncs, generatorsFuncsV2 } from './generators/GeneratorFuncs.js';
|
|
15
|
+
import type { AbstractGenerator } from './generators/Generators.js';
|
|
11
16
|
import type { DrizzleStudioObjectType, DrizzleStudioRelationType } from './types/drizzleStudio.js';
|
|
12
|
-
import type { RefinementsType } from './types/seedService.js';
|
|
13
|
-
|
|
14
|
-
type InferCallbackType<DB extends
|
|
15
|
-
[key: string]:
|
|
17
|
+
import type { DbType, RefinementsType } from './types/seedService.js';
|
|
18
|
+
type SchemaValuesType = PgTable | PgSchema | MySqlTable | MySqlSchema | SQLiteTable | MsSqlTable | MsSqlSchema | CockroachTable | CockroachSchema | SingleStoreTable | SingleStoreSchema | Relations | any;
|
|
19
|
+
type InferCallbackType<DB extends DbType, SCHEMA extends {
|
|
20
|
+
[key: string]: SchemaValuesType;
|
|
16
21
|
}> = DB extends PgDatabase<any, any> ? SCHEMA extends {
|
|
17
|
-
[key: string]:
|
|
22
|
+
[key: string]: SchemaValuesType;
|
|
18
23
|
} ? {
|
|
19
24
|
[table in keyof SCHEMA as SCHEMA[table] extends PgTable ? table : never]?: {
|
|
20
25
|
count?: number;
|
|
21
26
|
columns?: {
|
|
22
|
-
[column in keyof SCHEMA[table] as SCHEMA[table][column] extends PgColumn ? column : never]?: AbstractGenerator<any
|
|
27
|
+
[column in keyof SCHEMA[table] as SCHEMA[table][column] extends PgColumn ? column : never]?: AbstractGenerator<any>;
|
|
23
28
|
};
|
|
24
29
|
with?: {
|
|
25
30
|
[refTable in keyof SCHEMA as SCHEMA[refTable] extends PgTable ? refTable : never]?: number | {
|
|
@@ -29,7 +34,7 @@ type InferCallbackType<DB extends PgDatabase<any, any> | MySqlDatabase<any, any>
|
|
|
29
34
|
};
|
|
30
35
|
};
|
|
31
36
|
} : {} : DB extends MySqlDatabase<any, any> ? SCHEMA extends {
|
|
32
|
-
[key: string]:
|
|
37
|
+
[key: string]: SchemaValuesType;
|
|
33
38
|
} ? {
|
|
34
39
|
[table in keyof SCHEMA as SCHEMA[table] extends MySqlTable ? table : never]?: {
|
|
35
40
|
count?: number;
|
|
@@ -44,7 +49,7 @@ type InferCallbackType<DB extends PgDatabase<any, any> | MySqlDatabase<any, any>
|
|
|
44
49
|
};
|
|
45
50
|
};
|
|
46
51
|
} : {} : DB extends BaseSQLiteDatabase<any, any> ? SCHEMA extends {
|
|
47
|
-
[key: string]:
|
|
52
|
+
[key: string]: SchemaValuesType;
|
|
48
53
|
} ? {
|
|
49
54
|
[table in keyof SCHEMA as SCHEMA[table] extends SQLiteTable ? table : never]?: {
|
|
50
55
|
count?: number;
|
|
@@ -58,9 +63,54 @@ type InferCallbackType<DB extends PgDatabase<any, any> | MySqlDatabase<any, any>
|
|
|
58
63
|
}[];
|
|
59
64
|
};
|
|
60
65
|
};
|
|
66
|
+
} : {} : DB extends MsSqlDatabase<any, any> ? SCHEMA extends {
|
|
67
|
+
[key: string]: SchemaValuesType;
|
|
68
|
+
} ? {
|
|
69
|
+
[table in keyof SCHEMA as SCHEMA[table] extends MsSqlTable ? table : never]?: {
|
|
70
|
+
count?: number;
|
|
71
|
+
columns?: {
|
|
72
|
+
[column in keyof SCHEMA[table] as SCHEMA[table][column] extends MsSqlColumn ? column : never]?: AbstractGenerator<any>;
|
|
73
|
+
};
|
|
74
|
+
with?: {
|
|
75
|
+
[refTable in keyof SCHEMA as SCHEMA[refTable] extends MsSqlTable ? refTable : never]?: number | {
|
|
76
|
+
weight: number;
|
|
77
|
+
count: number | number[];
|
|
78
|
+
}[];
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
} : {} : DB extends CockroachDatabase<any, any> ? SCHEMA extends {
|
|
82
|
+
[key: string]: SchemaValuesType;
|
|
83
|
+
} ? {
|
|
84
|
+
[table in keyof SCHEMA as SCHEMA[table] extends CockroachTable ? table : never]?: {
|
|
85
|
+
count?: number;
|
|
86
|
+
columns?: {
|
|
87
|
+
[column in keyof SCHEMA[table] as SCHEMA[table][column] extends CockroachColumn ? column : never]?: AbstractGenerator<any>;
|
|
88
|
+
};
|
|
89
|
+
with?: {
|
|
90
|
+
[refTable in keyof SCHEMA as SCHEMA[refTable] extends CockroachTable ? refTable : never]?: number | {
|
|
91
|
+
weight: number;
|
|
92
|
+
count: number | number[];
|
|
93
|
+
}[];
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
} : {} : DB extends SingleStoreDatabase<any, any> ? SCHEMA extends {
|
|
97
|
+
[key: string]: SchemaValuesType;
|
|
98
|
+
} ? {
|
|
99
|
+
[table in keyof SCHEMA as SCHEMA[table] extends SingleStoreTable ? table : never]?: {
|
|
100
|
+
count?: number;
|
|
101
|
+
columns?: {
|
|
102
|
+
[column in keyof SCHEMA[table] as SCHEMA[table][column] extends SingleStoreColumn ? column : never]?: AbstractGenerator<any>;
|
|
103
|
+
};
|
|
104
|
+
with?: {
|
|
105
|
+
[refTable in keyof SCHEMA as SCHEMA[refTable] extends SingleStoreTable ? refTable : never]?: number | {
|
|
106
|
+
weight: number;
|
|
107
|
+
count: number | number[];
|
|
108
|
+
}[];
|
|
109
|
+
};
|
|
110
|
+
};
|
|
61
111
|
} : {} : {};
|
|
62
|
-
declare class SeedPromise<DB extends
|
|
63
|
-
[key: string]:
|
|
112
|
+
declare class SeedPromise<DB extends DbType, SCHEMA extends {
|
|
113
|
+
[key: string]: SchemaValuesType;
|
|
64
114
|
}, VERSION extends string | undefined> implements Promise<void> {
|
|
65
115
|
private db;
|
|
66
116
|
private schema;
|
|
@@ -82,121 +132,115 @@ export declare function getGeneratorsFunctions(): {
|
|
|
82
132
|
default: (args_0: {
|
|
83
133
|
defaultValue: unknown;
|
|
84
134
|
arraySize?: number;
|
|
85
|
-
}) => import("./
|
|
135
|
+
}) => import("./generators/Generators.js").GenerateDefault;
|
|
86
136
|
valuesFromArray: (args_0: {
|
|
87
|
-
values: (
|
|
137
|
+
values: import("./types/seedService.js").GeneratedValueType[] | {
|
|
88
138
|
weight: number;
|
|
89
|
-
values: (
|
|
139
|
+
values: import("./types/seedService.js").GeneratedValueType[];
|
|
90
140
|
}[];
|
|
91
141
|
isUnique?: boolean;
|
|
92
142
|
arraySize?: number;
|
|
93
|
-
}) => import("./
|
|
94
|
-
intPrimaryKey: (...args: [] | [{}]) => import("./
|
|
143
|
+
}) => import("./generators/Generators.js").GenerateValuesFromArray;
|
|
144
|
+
intPrimaryKey: (...args: [] | [{}]) => import("./generators/Generators.js").GenerateIntPrimaryKey;
|
|
95
145
|
number: (...args: [] | [{
|
|
96
146
|
minValue?: number;
|
|
97
147
|
maxValue?: number;
|
|
98
148
|
precision?: number;
|
|
99
149
|
isUnique?: boolean;
|
|
100
150
|
arraySize?: number;
|
|
101
|
-
}]) => import("./
|
|
151
|
+
}]) => import("./generators/Generators.js").GenerateNumber;
|
|
102
152
|
int: (...args: [] | [{
|
|
103
153
|
minValue?: number | bigint;
|
|
104
154
|
maxValue?: number | bigint;
|
|
105
155
|
isUnique?: boolean;
|
|
106
156
|
arraySize?: number;
|
|
107
|
-
}]) => import("./
|
|
157
|
+
}]) => import("./generators/Generators.js").GenerateInt;
|
|
108
158
|
boolean: (...args: [] | [{
|
|
109
159
|
arraySize?: number;
|
|
110
|
-
}]) => import("./
|
|
160
|
+
}]) => import("./generators/Generators.js").GenerateBoolean;
|
|
111
161
|
date: (...args: [] | [{
|
|
112
162
|
minDate?: string | Date;
|
|
113
163
|
maxDate?: string | Date;
|
|
114
164
|
arraySize?: number;
|
|
115
|
-
}]) => import("./
|
|
165
|
+
}]) => import("./generators/Generators.js").GenerateDate;
|
|
116
166
|
time: (...args: [] | [{
|
|
117
|
-
minTime?: string | Date;
|
|
118
|
-
maxTime?: string | Date;
|
|
119
167
|
arraySize?: number;
|
|
120
|
-
}]) => import("./
|
|
168
|
+
}]) => import("./generators/Generators.js").GenerateTime;
|
|
121
169
|
timestamp: (...args: [] | [{
|
|
122
|
-
minTimestamp?: string | Date;
|
|
123
|
-
maxTimestamp?: string | Date;
|
|
124
170
|
arraySize?: number;
|
|
125
|
-
}]) => import("./
|
|
171
|
+
}]) => import("./generators/Generators.js").GenerateTimestamp;
|
|
126
172
|
datetime: (...args: [] | [{
|
|
127
|
-
minDatetime?: string | Date;
|
|
128
|
-
maxDatetime?: string | Date;
|
|
129
173
|
arraySize?: number;
|
|
130
|
-
}]) => import("./
|
|
174
|
+
}]) => import("./generators/Generators.js").GenerateDatetime;
|
|
131
175
|
year: (...args: [] | [{
|
|
132
176
|
arraySize?: number;
|
|
133
|
-
}]) => import("./
|
|
177
|
+
}]) => import("./generators/Generators.js").GenerateYear;
|
|
134
178
|
json: (...args: [] | [{
|
|
135
179
|
arraySize?: number;
|
|
136
|
-
}]) => import("./
|
|
180
|
+
}]) => import("./generators/Generators.js").GenerateJson;
|
|
137
181
|
interval: (...args: [] | [{
|
|
138
182
|
fields?: "year" | "month" | "day" | "hour" | "minute" | "second" | "year to month" | "day to hour" | "day to minute" | "day to second" | "hour to minute" | "hour to second" | "minute to second";
|
|
139
183
|
isUnique?: boolean;
|
|
140
184
|
arraySize?: number;
|
|
141
|
-
}]) => import("./
|
|
185
|
+
}]) => import("./generators/Generators.js").GenerateInterval;
|
|
142
186
|
string: (...args: [] | [{
|
|
143
187
|
isUnique?: boolean;
|
|
144
188
|
arraySize?: number;
|
|
145
|
-
}]) => import("./
|
|
189
|
+
}]) => import("./generators/Generators.js").GenerateString;
|
|
146
190
|
uuid: (...args: [] | [{
|
|
147
191
|
arraySize?: number;
|
|
148
|
-
}]) => import("./
|
|
192
|
+
}]) => import("./generators/Generators.js").GenerateUUID;
|
|
149
193
|
firstName: (...args: [] | [{
|
|
150
194
|
isUnique?: boolean;
|
|
151
195
|
arraySize?: number;
|
|
152
|
-
}]) => import("./
|
|
196
|
+
}]) => import("./generators/Generators.js").GenerateFirstName;
|
|
153
197
|
lastName: (...args: [] | [{
|
|
154
198
|
isUnique?: boolean;
|
|
155
199
|
arraySize?: number;
|
|
156
|
-
}]) => import("./
|
|
200
|
+
}]) => import("./generators/Generators.js").GenerateLastName;
|
|
157
201
|
fullName: (...args: [] | [{
|
|
158
202
|
isUnique?: boolean;
|
|
159
203
|
arraySize?: number;
|
|
160
|
-
}]) => import("./
|
|
204
|
+
}]) => import("./generators/Generators.js").GenerateFullName;
|
|
161
205
|
email: (...args: [] | [{
|
|
162
206
|
arraySize?: number;
|
|
163
|
-
}]) => import("./
|
|
207
|
+
}]) => import("./generators/Generators.js").GenerateEmail;
|
|
164
208
|
phoneNumber: (...args: [] | [{
|
|
165
209
|
template?: string;
|
|
166
210
|
prefixes?: string[];
|
|
167
211
|
generatedDigitsNumbers?: number | number[];
|
|
168
212
|
arraySize?: number;
|
|
169
|
-
}]) => import("./
|
|
213
|
+
}]) => import("./generators/Generators.js").GeneratePhoneNumber;
|
|
170
214
|
country: (...args: [] | [{
|
|
171
215
|
isUnique?: boolean;
|
|
172
216
|
arraySize?: number;
|
|
173
|
-
}]) => import("./
|
|
217
|
+
}]) => import("./generators/Generators.js").GenerateCountry;
|
|
174
218
|
city: (...args: [] | [{
|
|
175
219
|
isUnique?: boolean;
|
|
176
220
|
arraySize?: number;
|
|
177
|
-
}]) => import("./
|
|
221
|
+
}]) => import("./generators/Generators.js").GenerateCity;
|
|
178
222
|
streetAddress: (...args: [] | [{
|
|
179
223
|
isUnique?: boolean;
|
|
180
224
|
arraySize?: number;
|
|
181
|
-
}]) => import("./
|
|
225
|
+
}]) => import("./generators/Generators.js").GenerateStreetAddress;
|
|
182
226
|
jobTitle: (...args: [] | [{
|
|
183
227
|
arraySize?: number;
|
|
184
|
-
}]) => import("./
|
|
228
|
+
}]) => import("./generators/Generators.js").GenerateJobTitle;
|
|
185
229
|
postcode: (...args: [] | [{
|
|
186
230
|
isUnique?: boolean;
|
|
187
231
|
arraySize?: number;
|
|
188
|
-
}]) => import("./
|
|
232
|
+
}]) => import("./generators/Generators.js").GeneratePostcode;
|
|
189
233
|
state: (...args: [] | [{
|
|
190
234
|
arraySize?: number;
|
|
191
|
-
}]) => import("./
|
|
235
|
+
}]) => import("./generators/Generators.js").GenerateState;
|
|
192
236
|
companyName: (...args: [] | [{
|
|
193
237
|
isUnique?: boolean;
|
|
194
238
|
arraySize?: number;
|
|
195
|
-
}]) => import("./
|
|
239
|
+
}]) => import("./generators/Generators.js").GenerateCompanyName;
|
|
196
240
|
loremIpsum: (...args: [] | [{
|
|
197
241
|
sentencesCount?: number;
|
|
198
242
|
arraySize?: number;
|
|
199
|
-
}]) => import("./
|
|
243
|
+
}]) => import("./generators/Generators.js").GenerateLoremIpsum;
|
|
200
244
|
point: (...args: [] | [{
|
|
201
245
|
isUnique?: boolean;
|
|
202
246
|
minXValue?: number;
|
|
@@ -204,7 +248,7 @@ export declare function getGeneratorsFunctions(): {
|
|
|
204
248
|
minYValue?: number;
|
|
205
249
|
maxYValue?: number;
|
|
206
250
|
arraySize?: number;
|
|
207
|
-
}]) => import("./
|
|
251
|
+
}]) => import("./generators/Generators.js").GeneratePoint;
|
|
208
252
|
line: (...args: [] | [{
|
|
209
253
|
isUnique?: boolean;
|
|
210
254
|
minAValue?: number;
|
|
@@ -214,14 +258,40 @@ export declare function getGeneratorsFunctions(): {
|
|
|
214
258
|
minCValue?: number;
|
|
215
259
|
maxCValue?: number;
|
|
216
260
|
arraySize?: number;
|
|
217
|
-
}]) => import("./
|
|
261
|
+
}]) => import("./generators/Generators.js").GenerateLine;
|
|
218
262
|
weightedRandom: (args_0: {
|
|
219
263
|
weight: number;
|
|
220
264
|
value: AbstractGenerator<any>;
|
|
221
|
-
}[]) => import("./
|
|
265
|
+
}[]) => import("./generators/Generators.js").WeightedRandomGenerator;
|
|
266
|
+
bitString: (...args: [] | [{
|
|
267
|
+
dimensions?: number;
|
|
268
|
+
isUnique?: boolean;
|
|
269
|
+
arraySize?: number;
|
|
270
|
+
}]) => import("./generators/Generators.js").GenerateBitString;
|
|
271
|
+
inet: (...args: [] | [{
|
|
272
|
+
ipAddress?: "ipv4" | "ipv6";
|
|
273
|
+
includeCidr?: boolean;
|
|
274
|
+
isUnique?: boolean;
|
|
275
|
+
arraySize?: number;
|
|
276
|
+
}]) => import("./generators/Generators.js").GenerateInet;
|
|
277
|
+
geometry: (...args: [] | [{
|
|
278
|
+
type?: "point";
|
|
279
|
+
srid?: 4326 | 3857;
|
|
280
|
+
decimalPlaces?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
281
|
+
isUnique?: boolean;
|
|
282
|
+
arraySize?: number;
|
|
283
|
+
}]) => import("./generators/Generators.js").GenerateGeometry;
|
|
284
|
+
vector: (...args: [] | [{
|
|
285
|
+
dimensions?: number;
|
|
286
|
+
minValue?: number;
|
|
287
|
+
maxValue?: number;
|
|
288
|
+
decimalPlaces?: number;
|
|
289
|
+
isUnique?: boolean;
|
|
290
|
+
arraySize?: number;
|
|
291
|
+
}]) => import("./generators/Generators.js").GenerateVector;
|
|
222
292
|
};
|
|
223
293
|
export declare function seedForDrizzleStudio({ sqlDialect, drizzleStudioObject, drizzleStudioRelations, schemasRefinements, options }: {
|
|
224
|
-
sqlDialect: 'postgresql' | 'mysql' | 'sqlite';
|
|
294
|
+
sqlDialect: 'postgresql' | 'mysql' | 'sqlite' | 'mssql' | 'cockroach' | 'singlestore';
|
|
225
295
|
drizzleStudioObject: DrizzleStudioObjectType;
|
|
226
296
|
drizzleStudioRelations: DrizzleStudioRelationType[];
|
|
227
297
|
schemasRefinements?: {
|
|
@@ -263,7 +333,7 @@ export declare function seedForDrizzleStudio({ sqlDialect, drizzleStudioObject,
|
|
|
263
333
|
* // seeding with count and seed specified
|
|
264
334
|
* await seed(db, schema, { count: 100000, seed: 1 });
|
|
265
335
|
*
|
|
266
|
-
* //
|
|
336
|
+
* //seeding using refine
|
|
267
337
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
268
338
|
* users: {
|
|
269
339
|
* columns: {
|
|
@@ -284,21 +354,10 @@ export declare function seedForDrizzleStudio({ sqlDialect, drizzleStudioObject,
|
|
|
284
354
|
* },
|
|
285
355
|
* }));
|
|
286
356
|
*
|
|
287
|
-
* // seeding while ignoring column
|
|
288
|
-
* await seed(db, schema).refine((funcs) => ({
|
|
289
|
-
* users: {
|
|
290
|
-
* count: 5,
|
|
291
|
-
* columns: {
|
|
292
|
-
* name: funcs.fullName(),
|
|
293
|
-
* photo: false, // the photo column will not be seeded, allowing the database to use its default value.
|
|
294
|
-
* },
|
|
295
|
-
* },
|
|
296
|
-
* }));
|
|
297
|
-
*
|
|
298
357
|
* ```
|
|
299
358
|
*/
|
|
300
|
-
export declare function seed<DB extends
|
|
301
|
-
[key: string]:
|
|
359
|
+
export declare function seed<DB extends DbType, SCHEMA extends {
|
|
360
|
+
[key: string]: SchemaValuesType;
|
|
302
361
|
}, VERSION extends '2' | '1' | undefined>(db: DB, schema: SCHEMA, options?: {
|
|
303
362
|
count?: number;
|
|
304
363
|
seed?: number;
|
|
@@ -342,17 +401,13 @@ export declare function seed<DB extends PgDatabase<any, any> | MySqlDatabase<any
|
|
|
342
401
|
* @example
|
|
343
402
|
* ```ts
|
|
344
403
|
* await reset(db, schema);
|
|
345
|
-
*
|
|
346
|
-
* // Alternatively, you can provide an object containing your tables
|
|
347
|
-
* // as the `schema` parameter when calling `reset`.
|
|
348
|
-
* await reset(db, { users });
|
|
349
404
|
* ```
|
|
350
405
|
*/
|
|
351
|
-
export declare function reset<DB extends
|
|
352
|
-
[key: string]:
|
|
406
|
+
export declare function reset<DB extends DbType, SCHEMA extends {
|
|
407
|
+
[key: string]: SchemaValuesType;
|
|
353
408
|
}>(db: DB, schema: SCHEMA): Promise<void>;
|
|
354
409
|
export { default as cities } from './datasets/cityNames.js';
|
|
355
410
|
export { default as countries } from './datasets/countries.js';
|
|
356
411
|
export { default as firstNames } from './datasets/firstNames.js';
|
|
357
412
|
export { default as lastNames } from './datasets/lastNames.js';
|
|
358
|
-
export { SeedService } from './
|
|
413
|
+
export { SeedService } from './SeedService.js';
|