drizzle-seed 0.3.2-f8a2f3c → 0.4.0-08e4e66
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +28 -0
- package/cockroach-core/index.d.mts +28 -0
- package/cockroach-core/index.d.ts +28 -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/common.d.cts +23 -0
- package/common.d.mts +23 -0
- package/common.d.ts +23 -0
- package/{services → generators}/GeneratorFuncs.d.cts +312 -59
- package/{services → generators}/GeneratorFuncs.d.mts +312 -59
- package/{services → generators}/GeneratorFuncs.d.ts +312 -59
- package/{services → generators}/Generators.d.cts +277 -54
- package/{services → generators}/Generators.d.mts +277 -54
- package/{services → generators}/Generators.d.ts +277 -54
- 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 +13 -6
- package/{services → generators}/versioning/v2.d.mts +13 -6
- package/{services → generators}/versioning/v2.d.ts +13 -6
- package/index.cjs +3156 -1472
- package/index.cjs.map +1 -1
- package/index.d.cts +92 -123
- package/index.d.mts +92 -123
- package/index.d.ts +92 -123
- package/index.mjs +3161 -1476
- 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 +28 -0
- package/mysql-core/index.d.mts +28 -0
- package/mysql-core/index.d.ts +28 -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 +13 -9
- package/pg-core/index.d.cts +28 -0
- package/pg-core/index.d.mts +28 -0
- package/pg-core/index.d.ts +28 -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 +28 -0
- package/singlestore-core/index.d.mts +28 -0
- package/singlestore-core/index.d.ts +28 -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 +28 -0
- package/sqlite-core/index.d.mts +28 -0
- package/sqlite-core/index.d.ts +28 -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 +20 -0
- package/types/tables.d.mts +20 -0
- package/types/tables.d.ts +20 -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.mts
CHANGED
|
@@ -1,66 +1,42 @@
|
|
|
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/_relations';
|
|
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
|
|
15
|
-
[key: string]:
|
|
16
|
-
}> = DB extends PgDatabase<any, any> ? SCHEMA extends {
|
|
17
|
-
[key: string]: PgTable | PgSchema | MySqlTable | MySqlSchema | SQLiteTable | Relations;
|
|
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 RefineTypes<SCHEMA, TableT, ColumnT> = SCHEMA extends {
|
|
20
|
+
[key: string]: SchemaValuesType;
|
|
18
21
|
} ? {
|
|
19
|
-
[
|
|
22
|
+
[fieldName in keyof SCHEMA as SCHEMA[fieldName] extends TableT ? fieldName : never]?: {
|
|
20
23
|
count?: number;
|
|
21
24
|
columns?: {
|
|
22
|
-
[column in keyof SCHEMA[
|
|
25
|
+
[column in keyof SCHEMA[fieldName] as SCHEMA[fieldName][column] extends ColumnT ? column : never]?: AbstractGenerator<any>;
|
|
23
26
|
};
|
|
24
27
|
with?: {
|
|
25
|
-
[refTable in keyof SCHEMA as SCHEMA[refTable] extends
|
|
28
|
+
[refTable in keyof SCHEMA as SCHEMA[refTable] extends TableT ? refTable : never]?: number | {
|
|
26
29
|
weight: number;
|
|
27
30
|
count: number | number[];
|
|
28
31
|
}[];
|
|
29
32
|
};
|
|
30
33
|
};
|
|
31
|
-
} : {}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
[column in keyof SCHEMA[table] as SCHEMA[table][column] extends MySqlColumn ? column : never]?: AbstractGenerator<any>;
|
|
38
|
-
};
|
|
39
|
-
with?: {
|
|
40
|
-
[refTable in keyof SCHEMA as SCHEMA[refTable] extends MySqlTable ? refTable : never]?: number | {
|
|
41
|
-
weight: number;
|
|
42
|
-
count: number | number[];
|
|
43
|
-
}[];
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
} : {} : DB extends BaseSQLiteDatabase<any, any> ? SCHEMA extends {
|
|
47
|
-
[key: string]: PgTable | PgSchema | MySqlTable | MySqlSchema | SQLiteTable | Relations;
|
|
48
|
-
} ? {
|
|
49
|
-
[table in keyof SCHEMA as SCHEMA[table] extends SQLiteTable ? table : never]?: {
|
|
50
|
-
count?: number;
|
|
51
|
-
columns?: {
|
|
52
|
-
[column in keyof SCHEMA[table] as SCHEMA[table][column] extends SQLiteColumn ? column : never]?: AbstractGenerator<any>;
|
|
53
|
-
};
|
|
54
|
-
with?: {
|
|
55
|
-
[refTable in keyof SCHEMA as SCHEMA[refTable] extends SQLiteTable ? refTable : never]?: number | {
|
|
56
|
-
weight: number;
|
|
57
|
-
count: number | number[];
|
|
58
|
-
}[];
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
} : {} : {};
|
|
62
|
-
declare class SeedPromise<DB extends PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any> | LibSQLDatabase<any>, SCHEMA extends {
|
|
63
|
-
[key: string]: PgTable | PgSchema | MySqlTable | MySqlSchema | SQLiteTable | Relations;
|
|
34
|
+
} : {};
|
|
35
|
+
type InferCallbackType<DB extends DbType, SCHEMA extends {
|
|
36
|
+
[key: string]: SchemaValuesType;
|
|
37
|
+
}> = DB extends PgDatabase<any, any> ? RefineTypes<SCHEMA, PgTable, PgColumn> : DB extends MySqlDatabase<any, any> ? RefineTypes<SCHEMA, MySqlTable, MySqlColumn> : DB extends BaseSQLiteDatabase<any, any> ? RefineTypes<SCHEMA, SQLiteTable, SQLiteColumn> : DB extends MsSqlDatabase<any, any> ? RefineTypes<SCHEMA, MsSqlTable, MsSqlColumn> : DB extends CockroachDatabase<any, any> ? RefineTypes<SCHEMA, CockroachTable, CockroachColumn> : DB extends SingleStoreDatabase<any, any> ? RefineTypes<SCHEMA, SingleStoreTable, SingleStoreColumn> : {};
|
|
38
|
+
declare class SeedPromise<DB extends DbType, SCHEMA extends {
|
|
39
|
+
[key: string]: SchemaValuesType;
|
|
64
40
|
}, VERSION extends string | undefined> implements Promise<void> {
|
|
65
41
|
private db;
|
|
66
42
|
private schema;
|
|
@@ -82,121 +58,103 @@ export declare function getGeneratorsFunctions(): {
|
|
|
82
58
|
default: (args_0: {
|
|
83
59
|
defaultValue: unknown;
|
|
84
60
|
arraySize?: number;
|
|
85
|
-
}) => import("./
|
|
86
|
-
valuesFromArray: (args_0:
|
|
87
|
-
|
|
88
|
-
weight: number;
|
|
89
|
-
values: (number | string | boolean | undefined)[];
|
|
90
|
-
}[];
|
|
91
|
-
isUnique?: boolean;
|
|
92
|
-
arraySize?: number;
|
|
93
|
-
}) => import("./services/Generators.js").GenerateValuesFromArray;
|
|
94
|
-
intPrimaryKey: (...args: [] | [{}]) => import("./services/Generators.js").GenerateIntPrimaryKey;
|
|
61
|
+
}) => import("./generators/Generators.js").GenerateDefault;
|
|
62
|
+
valuesFromArray: (args_0: import("./generators/Generators.js").GenerateValuesFromArrayT) => import("./generators/Generators.js").GenerateValuesFromArray;
|
|
63
|
+
intPrimaryKey: (...args: [] | [{}]) => import("./generators/Generators.js").GenerateIntPrimaryKey;
|
|
95
64
|
number: (...args: [] | [{
|
|
96
65
|
minValue?: number;
|
|
97
66
|
maxValue?: number;
|
|
98
67
|
precision?: number;
|
|
99
68
|
isUnique?: boolean;
|
|
100
69
|
arraySize?: number;
|
|
101
|
-
}]) => import("./
|
|
70
|
+
}]) => import("./generators/Generators.js").GenerateNumber;
|
|
102
71
|
int: (...args: [] | [{
|
|
103
72
|
minValue?: number | bigint;
|
|
104
73
|
maxValue?: number | bigint;
|
|
105
74
|
isUnique?: boolean;
|
|
106
75
|
arraySize?: number;
|
|
107
|
-
}]) => import("./
|
|
76
|
+
}]) => import("./generators/Generators.js").GenerateInt;
|
|
108
77
|
boolean: (...args: [] | [{
|
|
109
78
|
arraySize?: number;
|
|
110
|
-
}]) => import("./
|
|
79
|
+
}]) => import("./generators/Generators.js").GenerateBoolean;
|
|
111
80
|
date: (...args: [] | [{
|
|
112
81
|
minDate?: string | Date;
|
|
113
82
|
maxDate?: string | Date;
|
|
114
83
|
arraySize?: number;
|
|
115
|
-
}]) => import("./
|
|
84
|
+
}]) => import("./generators/Generators.js").GenerateDate;
|
|
116
85
|
time: (...args: [] | [{
|
|
117
|
-
minTime?: string | Date;
|
|
118
|
-
maxTime?: string | Date;
|
|
119
86
|
arraySize?: number;
|
|
120
|
-
}]) => import("./
|
|
87
|
+
}]) => import("./generators/Generators.js").GenerateTime;
|
|
121
88
|
timestamp: (...args: [] | [{
|
|
122
|
-
minTimestamp?: string | Date;
|
|
123
|
-
maxTimestamp?: string | Date;
|
|
124
89
|
arraySize?: number;
|
|
125
|
-
}]) => import("./
|
|
90
|
+
}]) => import("./generators/Generators.js").GenerateTimestamp;
|
|
126
91
|
datetime: (...args: [] | [{
|
|
127
|
-
minDatetime?: string | Date;
|
|
128
|
-
maxDatetime?: string | Date;
|
|
129
92
|
arraySize?: number;
|
|
130
|
-
}]) => import("./
|
|
93
|
+
}]) => import("./generators/Generators.js").GenerateDatetime;
|
|
131
94
|
year: (...args: [] | [{
|
|
132
95
|
arraySize?: number;
|
|
133
|
-
}]) => import("./
|
|
96
|
+
}]) => import("./generators/Generators.js").GenerateYear;
|
|
134
97
|
json: (...args: [] | [{
|
|
135
98
|
arraySize?: number;
|
|
136
|
-
}]) => import("./
|
|
99
|
+
}]) => import("./generators/Generators.js").GenerateJson;
|
|
137
100
|
interval: (...args: [] | [{
|
|
138
101
|
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
102
|
isUnique?: boolean;
|
|
140
103
|
arraySize?: number;
|
|
141
|
-
}]) => import("./
|
|
104
|
+
}]) => import("./generators/Generators.js").GenerateInterval;
|
|
142
105
|
string: (...args: [] | [{
|
|
143
106
|
isUnique?: boolean;
|
|
144
107
|
arraySize?: number;
|
|
145
|
-
}]) => import("./
|
|
108
|
+
}]) => import("./generators/Generators.js").GenerateString;
|
|
146
109
|
uuid: (...args: [] | [{
|
|
147
110
|
arraySize?: number;
|
|
148
|
-
}]) => import("./
|
|
111
|
+
}]) => import("./generators/Generators.js").GenerateUUID;
|
|
149
112
|
firstName: (...args: [] | [{
|
|
150
113
|
isUnique?: boolean;
|
|
151
114
|
arraySize?: number;
|
|
152
|
-
}]) => import("./
|
|
115
|
+
}]) => import("./generators/Generators.js").GenerateFirstName;
|
|
153
116
|
lastName: (...args: [] | [{
|
|
154
117
|
isUnique?: boolean;
|
|
155
118
|
arraySize?: number;
|
|
156
|
-
}]) => import("./
|
|
119
|
+
}]) => import("./generators/Generators.js").GenerateLastName;
|
|
157
120
|
fullName: (...args: [] | [{
|
|
158
121
|
isUnique?: boolean;
|
|
159
122
|
arraySize?: number;
|
|
160
|
-
}]) => import("./
|
|
123
|
+
}]) => import("./generators/Generators.js").GenerateFullName;
|
|
161
124
|
email: (...args: [] | [{
|
|
162
125
|
arraySize?: number;
|
|
163
|
-
}]) => import("./
|
|
164
|
-
phoneNumber: (...args: [] | [
|
|
165
|
-
template?: string;
|
|
166
|
-
prefixes?: string[];
|
|
167
|
-
generatedDigitsNumbers?: number | number[];
|
|
168
|
-
arraySize?: number;
|
|
169
|
-
}]) => import("./services/Generators.js").GeneratePhoneNumber;
|
|
126
|
+
}]) => import("./generators/Generators.js").GenerateEmail;
|
|
127
|
+
phoneNumber: (...args: [] | [import("./generators/Generators.js").GeneratePhoneNumberT]) => import("./generators/Generators.js").GeneratePhoneNumber;
|
|
170
128
|
country: (...args: [] | [{
|
|
171
129
|
isUnique?: boolean;
|
|
172
130
|
arraySize?: number;
|
|
173
|
-
}]) => import("./
|
|
131
|
+
}]) => import("./generators/Generators.js").GenerateCountry;
|
|
174
132
|
city: (...args: [] | [{
|
|
175
133
|
isUnique?: boolean;
|
|
176
134
|
arraySize?: number;
|
|
177
|
-
}]) => import("./
|
|
135
|
+
}]) => import("./generators/Generators.js").GenerateCity;
|
|
178
136
|
streetAddress: (...args: [] | [{
|
|
179
137
|
isUnique?: boolean;
|
|
180
138
|
arraySize?: number;
|
|
181
|
-
}]) => import("./
|
|
139
|
+
}]) => import("./generators/Generators.js").GenerateStreetAddress;
|
|
182
140
|
jobTitle: (...args: [] | [{
|
|
183
141
|
arraySize?: number;
|
|
184
|
-
}]) => import("./
|
|
142
|
+
}]) => import("./generators/Generators.js").GenerateJobTitle;
|
|
185
143
|
postcode: (...args: [] | [{
|
|
186
144
|
isUnique?: boolean;
|
|
187
145
|
arraySize?: number;
|
|
188
|
-
}]) => import("./
|
|
146
|
+
}]) => import("./generators/Generators.js").GeneratePostcode;
|
|
189
147
|
state: (...args: [] | [{
|
|
190
148
|
arraySize?: number;
|
|
191
|
-
}]) => import("./
|
|
149
|
+
}]) => import("./generators/Generators.js").GenerateState;
|
|
192
150
|
companyName: (...args: [] | [{
|
|
193
151
|
isUnique?: boolean;
|
|
194
152
|
arraySize?: number;
|
|
195
|
-
}]) => import("./
|
|
153
|
+
}]) => import("./generators/Generators.js").GenerateCompanyName;
|
|
196
154
|
loremIpsum: (...args: [] | [{
|
|
197
155
|
sentencesCount?: number;
|
|
198
156
|
arraySize?: number;
|
|
199
|
-
}]) => import("./
|
|
157
|
+
}]) => import("./generators/Generators.js").GenerateLoremIpsum;
|
|
200
158
|
point: (...args: [] | [{
|
|
201
159
|
isUnique?: boolean;
|
|
202
160
|
minXValue?: number;
|
|
@@ -204,7 +162,7 @@ export declare function getGeneratorsFunctions(): {
|
|
|
204
162
|
minYValue?: number;
|
|
205
163
|
maxYValue?: number;
|
|
206
164
|
arraySize?: number;
|
|
207
|
-
}]) => import("./
|
|
165
|
+
}]) => import("./generators/Generators.js").GeneratePoint;
|
|
208
166
|
line: (...args: [] | [{
|
|
209
167
|
isUnique?: boolean;
|
|
210
168
|
minAValue?: number;
|
|
@@ -214,14 +172,40 @@ export declare function getGeneratorsFunctions(): {
|
|
|
214
172
|
minCValue?: number;
|
|
215
173
|
maxCValue?: number;
|
|
216
174
|
arraySize?: number;
|
|
217
|
-
}]) => import("./
|
|
175
|
+
}]) => import("./generators/Generators.js").GenerateLine;
|
|
218
176
|
weightedRandom: (args_0: {
|
|
219
177
|
weight: number;
|
|
220
178
|
value: AbstractGenerator<any>;
|
|
221
|
-
}[]) => import("./
|
|
179
|
+
}[]) => import("./generators/Generators.js").WeightedRandomGenerator;
|
|
180
|
+
bitString: (...args: [] | [{
|
|
181
|
+
dimensions?: number;
|
|
182
|
+
isUnique?: boolean;
|
|
183
|
+
arraySize?: number;
|
|
184
|
+
}]) => import("./generators/Generators.js").GenerateBitString;
|
|
185
|
+
inet: (...args: [] | [{
|
|
186
|
+
ipAddress?: "ipv4" | "ipv6";
|
|
187
|
+
includeCidr?: boolean;
|
|
188
|
+
isUnique?: boolean;
|
|
189
|
+
arraySize?: number;
|
|
190
|
+
}]) => import("./generators/Generators.js").GenerateInet;
|
|
191
|
+
geometry: (...args: [] | [{
|
|
192
|
+
type?: "point";
|
|
193
|
+
srid?: 4326 | 3857;
|
|
194
|
+
decimalPlaces?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
195
|
+
isUnique?: boolean;
|
|
196
|
+
arraySize?: number;
|
|
197
|
+
}]) => import("./generators/Generators.js").GenerateGeometry;
|
|
198
|
+
vector: (...args: [] | [{
|
|
199
|
+
dimensions?: number;
|
|
200
|
+
minValue?: number;
|
|
201
|
+
maxValue?: number;
|
|
202
|
+
decimalPlaces?: number;
|
|
203
|
+
isUnique?: boolean;
|
|
204
|
+
arraySize?: number;
|
|
205
|
+
}]) => import("./generators/Generators.js").GenerateVector;
|
|
222
206
|
};
|
|
223
207
|
export declare function seedForDrizzleStudio({ sqlDialect, drizzleStudioObject, drizzleStudioRelations, schemasRefinements, options }: {
|
|
224
|
-
sqlDialect: 'postgresql' | 'mysql' | 'sqlite';
|
|
208
|
+
sqlDialect: 'postgresql' | 'mysql' | 'sqlite' | 'mssql' | 'cockroach' | 'singlestore';
|
|
225
209
|
drizzleStudioObject: DrizzleStudioObjectType;
|
|
226
210
|
drizzleStudioRelations: DrizzleStudioRelationType[];
|
|
227
211
|
schemasRefinements?: {
|
|
@@ -263,7 +247,7 @@ export declare function seedForDrizzleStudio({ sqlDialect, drizzleStudioObject,
|
|
|
263
247
|
* // seeding with count and seed specified
|
|
264
248
|
* await seed(db, schema, { count: 100000, seed: 1 });
|
|
265
249
|
*
|
|
266
|
-
* //
|
|
250
|
+
* //seeding using refine
|
|
267
251
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
268
252
|
* users: {
|
|
269
253
|
* columns: {
|
|
@@ -284,21 +268,10 @@ export declare function seedForDrizzleStudio({ sqlDialect, drizzleStudioObject,
|
|
|
284
268
|
* },
|
|
285
269
|
* }));
|
|
286
270
|
*
|
|
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
271
|
* ```
|
|
299
272
|
*/
|
|
300
|
-
export declare function seed<DB extends
|
|
301
|
-
[key: string]:
|
|
273
|
+
export declare function seed<DB extends DbType, SCHEMA extends {
|
|
274
|
+
[key: string]: SchemaValuesType;
|
|
302
275
|
}, VERSION extends '2' | '1' | undefined>(db: DB, schema: SCHEMA, options?: {
|
|
303
276
|
count?: number;
|
|
304
277
|
seed?: number;
|
|
@@ -342,17 +315,13 @@ export declare function seed<DB extends PgDatabase<any, any> | MySqlDatabase<any
|
|
|
342
315
|
* @example
|
|
343
316
|
* ```ts
|
|
344
317
|
* 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
318
|
* ```
|
|
350
319
|
*/
|
|
351
|
-
export declare function reset<DB extends
|
|
352
|
-
[key: string]:
|
|
320
|
+
export declare function reset<DB extends DbType, SCHEMA extends {
|
|
321
|
+
[key: string]: SchemaValuesType;
|
|
353
322
|
}>(db: DB, schema: SCHEMA): Promise<void>;
|
|
354
323
|
export { default as cities } from './datasets/cityNames.js';
|
|
355
324
|
export { default as countries } from './datasets/countries.js';
|
|
356
325
|
export { default as firstNames } from './datasets/firstNames.js';
|
|
357
326
|
export { default as lastNames } from './datasets/lastNames.js';
|
|
358
|
-
export { SeedService } from './
|
|
327
|
+
export { SeedService } from './SeedService.js';
|