drizzle-seed 1.0.0-beta.2-278d7e6 → 1.0.0-beta.2-9848003
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/SeedService.d.cts +3 -12
- package/SeedService.d.mts +3 -12
- package/SeedService.d.ts +3 -12
- package/cockroach-core/index.d.cts +2 -2
- package/cockroach-core/index.d.mts +2 -2
- package/cockroach-core/index.d.ts +2 -2
- package/cockroach-core/selectGensForColumn.d.cts +3 -3
- package/cockroach-core/selectGensForColumn.d.mts +3 -3
- package/cockroach-core/selectGensForColumn.d.ts +3 -3
- package/common.d.cts +1 -1
- package/common.d.mts +1 -1
- package/common.d.ts +1 -1
- package/generators/GeneratorFuncs.d.cts +20 -950
- package/generators/GeneratorFuncs.d.mts +20 -950
- package/generators/GeneratorFuncs.d.ts +20 -950
- package/generators/Generators.d.cts +2 -29
- package/generators/Generators.d.mts +2 -29
- package/generators/Generators.d.ts +2 -29
- package/generators/apiVersion.d.cts +1 -1
- package/generators/apiVersion.d.mts +1 -1
- package/generators/apiVersion.d.ts +1 -1
- package/generators/utils.d.cts +0 -1
- package/generators/utils.d.mts +0 -1
- package/generators/utils.d.ts +0 -1
- package/generators/versioning/v2.d.cts +1 -1
- package/generators/versioning/v2.d.mts +1 -1
- package/generators/versioning/v2.d.ts +1 -1
- package/generators/versioning/v3.d.cts +1 -1
- package/generators/versioning/v3.d.mts +1 -1
- package/generators/versioning/v3.d.ts +1 -1
- package/index.cjs +26 -286
- package/index.cjs.map +1 -1
- package/index.d.cts +47 -68
- package/index.d.mts +47 -68
- package/index.d.ts +47 -68
- package/index.mjs +28 -288
- package/index.mjs.map +1 -1
- package/mssql-core/index.d.cts +1 -1
- package/mssql-core/index.d.mts +1 -1
- package/mssql-core/index.d.ts +1 -1
- package/mssql-core/selectGensForColumn.d.cts +2 -2
- package/mssql-core/selectGensForColumn.d.mts +2 -2
- package/mssql-core/selectGensForColumn.d.ts +2 -2
- package/mysql-core/index.d.cts +2 -2
- package/mysql-core/index.d.mts +2 -2
- package/mysql-core/index.d.ts +2 -2
- package/mysql-core/selectGensForColumn.d.cts +2 -2
- package/mysql-core/selectGensForColumn.d.mts +2 -2
- package/mysql-core/selectGensForColumn.d.ts +2 -2
- package/package.json +3 -5
- package/pg-core/index.d.cts +2 -2
- package/pg-core/index.d.mts +2 -2
- package/pg-core/index.d.ts +2 -2
- package/pg-core/selectGensForColumn.d.cts +3 -3
- package/pg-core/selectGensForColumn.d.mts +3 -3
- package/pg-core/selectGensForColumn.d.ts +3 -3
- package/singlestore-core/index.d.cts +2 -2
- package/singlestore-core/index.d.mts +2 -2
- package/singlestore-core/index.d.ts +2 -2
- package/singlestore-core/selectGensForColumn.d.cts +2 -2
- package/singlestore-core/selectGensForColumn.d.mts +2 -2
- package/singlestore-core/selectGensForColumn.d.ts +2 -2
- package/sqlite-core/index.d.cts +2 -2
- package/sqlite-core/index.d.mts +2 -2
- package/sqlite-core/index.d.ts +2 -2
- package/sqlite-core/selectGensForColumn.d.cts +2 -2
- package/sqlite-core/selectGensForColumn.d.mts +2 -2
- package/sqlite-core/selectGensForColumn.d.ts +2 -2
- package/types/seedService.d.cts +2 -2
- package/types/seedService.d.mts +2 -2
- package/types/seedService.d.ts +2 -2
- package/utils.d.cts +0 -4
- package/utils.d.mts +0 -4
- package/utils.d.ts +0 -4
- package/generators/versioning/v4.d.cts +0 -16
- package/generators/versioning/v4.d.mts +0 -16
- package/generators/versioning/v4.d.ts +0 -16
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { AbstractGenerator } from './Generators.
|
|
2
|
-
import { GenerateArray, GenerateBitString, GenerateBoolean, GenerateCity, GenerateCompanyName, GenerateCompositeUniqueKey, GenerateCountry, GenerateDate, GenerateDatetime, GenerateDefault, GenerateEmail, GenerateEnum, GenerateFirstName, GenerateFullName, GenerateGeometry, GenerateHashFromString, GenerateInet, GenerateInt, GenerateInterval, GenerateIntPrimaryKey, GenerateJobTitle, GenerateJson, GenerateLastName, GenerateLine, GenerateLoremIpsum, GenerateNumber, GeneratePhoneNumber, GeneratePoint, GeneratePostcode, GenerateSelfRelationsValuesFromArray, GenerateState, GenerateStreetAddress, GenerateString, GenerateTime, GenerateTimestamp, GenerateUniqueBitString, GenerateUniqueCity, GenerateUniqueCompanyName, GenerateUniqueCountry, GenerateUniqueFirstName, GenerateUniqueFullName, GenerateUniqueGeometry, GenerateUniqueInet, GenerateUniqueInt, GenerateUniqueInterval, GenerateUniqueLastName, GenerateUniqueLine, GenerateUniqueNumber, GenerateUniquePoint, GenerateUniquePostcode, GenerateUniqueStreetAddress, GenerateUniqueString, GenerateUniqueVector, GenerateUUID, GenerateValuesFromArray, GenerateVector, GenerateWeightedCount, GenerateYear, HollowGenerator, WeightedRandomGenerator } from './Generators.
|
|
3
|
-
import { GenerateStringV2, GenerateUniqueIntervalV2, GenerateUniqueStringV2 } from './versioning/v2.
|
|
4
|
-
import { GenerateHashFromStringV3 } from './versioning/v3.
|
|
5
|
-
import { GenerateUUIDV4 } from './versioning/v4.ts';
|
|
1
|
+
import type { AbstractGenerator } from './Generators.js';
|
|
2
|
+
import { GenerateArray, GenerateBitString, GenerateBoolean, GenerateCity, GenerateCompanyName, GenerateCompositeUniqueKey, GenerateCountry, GenerateDate, GenerateDatetime, GenerateDefault, GenerateEmail, GenerateEnum, GenerateFirstName, GenerateFullName, GenerateGeometry, GenerateHashFromString, GenerateInet, GenerateInt, GenerateInterval, GenerateIntPrimaryKey, GenerateJobTitle, GenerateJson, GenerateLastName, GenerateLine, GenerateLoremIpsum, GenerateNumber, GeneratePhoneNumber, GeneratePoint, GeneratePostcode, GenerateSelfRelationsValuesFromArray, GenerateState, GenerateStreetAddress, GenerateString, GenerateTime, GenerateTimestamp, GenerateUniqueBitString, GenerateUniqueCity, GenerateUniqueCompanyName, GenerateUniqueCountry, GenerateUniqueFirstName, GenerateUniqueFullName, GenerateUniqueGeometry, GenerateUniqueInet, GenerateUniqueInt, GenerateUniqueInterval, GenerateUniqueLastName, GenerateUniqueLine, GenerateUniqueNumber, GenerateUniquePoint, GenerateUniquePostcode, GenerateUniqueStreetAddress, GenerateUniqueString, GenerateUniqueVector, GenerateUUID, GenerateValuesFromArray, GenerateVector, GenerateWeightedCount, GenerateYear, HollowGenerator, WeightedRandomGenerator } from './Generators.js';
|
|
3
|
+
import { GenerateStringV2, GenerateUniqueIntervalV2, GenerateUniqueStringV2 } from './versioning/v2.js';
|
|
4
|
+
import { GenerateHashFromStringV3 } from './versioning/v3.js';
|
|
6
5
|
export declare const generatorsFuncs: {
|
|
7
6
|
/**
|
|
8
7
|
* generates same given value each time the generator is called.
|
|
@@ -64,7 +63,7 @@ export declare const generatorsFuncs: {
|
|
|
64
63
|
*
|
|
65
64
|
* ```
|
|
66
65
|
*/
|
|
67
|
-
valuesFromArray: (args_0: import("./Generators.
|
|
66
|
+
valuesFromArray: (args_0: import("./Generators.js").GenerateValuesFromArrayT) => GenerateValuesFromArray;
|
|
68
67
|
/**
|
|
69
68
|
* generates sequential integers starting with 1.
|
|
70
69
|
* @example
|
|
@@ -178,8 +177,6 @@ export declare const generatorsFuncs: {
|
|
|
178
177
|
}]) => GenerateDate;
|
|
179
178
|
/**
|
|
180
179
|
* generates time in 24 hours style.
|
|
181
|
-
* @param minTime - lower border of range.
|
|
182
|
-
* @param maxTime - upper border of range.
|
|
183
180
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
184
181
|
*
|
|
185
182
|
* @example
|
|
@@ -187,7 +184,7 @@ export declare const generatorsFuncs: {
|
|
|
187
184
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
188
185
|
* users: {
|
|
189
186
|
* columns: {
|
|
190
|
-
* birthTime: funcs.time(
|
|
187
|
+
* birthTime: funcs.time()
|
|
191
188
|
* },
|
|
192
189
|
* },
|
|
193
190
|
* }));
|
|
@@ -195,14 +192,10 @@ export declare const generatorsFuncs: {
|
|
|
195
192
|
* ```
|
|
196
193
|
*/
|
|
197
194
|
time: (...args: [] | [{
|
|
198
|
-
minTime?: string | Date;
|
|
199
|
-
maxTime?: string | Date;
|
|
200
195
|
arraySize?: number;
|
|
201
196
|
}]) => GenerateTime;
|
|
202
197
|
/**
|
|
203
198
|
* generates timestamps.
|
|
204
|
-
* @param minTimestamp - lower border of range.
|
|
205
|
-
* @param maxTimestamp - upper border of range.
|
|
206
199
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
207
200
|
*
|
|
208
201
|
* @example
|
|
@@ -210,7 +203,7 @@ export declare const generatorsFuncs: {
|
|
|
210
203
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
211
204
|
* orders: {
|
|
212
205
|
* columns: {
|
|
213
|
-
* shippedDate: funcs.timestamp(
|
|
206
|
+
* shippedDate: funcs.timestamp()
|
|
214
207
|
* },
|
|
215
208
|
* },
|
|
216
209
|
* }));
|
|
@@ -218,14 +211,10 @@ export declare const generatorsFuncs: {
|
|
|
218
211
|
* ```
|
|
219
212
|
*/
|
|
220
213
|
timestamp: (...args: [] | [{
|
|
221
|
-
minTimestamp?: string | Date;
|
|
222
|
-
maxTimestamp?: string | Date;
|
|
223
214
|
arraySize?: number;
|
|
224
215
|
}]) => GenerateTimestamp;
|
|
225
216
|
/**
|
|
226
217
|
* generates datetime objects.
|
|
227
|
-
* @param minDatetime - lower border of range.
|
|
228
|
-
* @param maxDatetime - upper border of range.
|
|
229
218
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
230
219
|
*
|
|
231
220
|
* @example
|
|
@@ -233,7 +222,7 @@ export declare const generatorsFuncs: {
|
|
|
233
222
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
234
223
|
* orders: {
|
|
235
224
|
* columns: {
|
|
236
|
-
* shippedDate: funcs.datetime(
|
|
225
|
+
* shippedDate: funcs.datetime()
|
|
237
226
|
* },
|
|
238
227
|
* },
|
|
239
228
|
* }));
|
|
@@ -241,8 +230,6 @@ export declare const generatorsFuncs: {
|
|
|
241
230
|
* ```
|
|
242
231
|
*/
|
|
243
232
|
datetime: (...args: [] | [{
|
|
244
|
-
minDatetime?: string | Date;
|
|
245
|
-
maxDatetime?: string | Date;
|
|
246
233
|
arraySize?: number;
|
|
247
234
|
}]) => GenerateDatetime;
|
|
248
235
|
/**
|
|
@@ -486,7 +473,7 @@ export declare const generatorsFuncs: {
|
|
|
486
473
|
*
|
|
487
474
|
* ```
|
|
488
475
|
*/
|
|
489
|
-
phoneNumber: (...args: [] | [import("./Generators.
|
|
476
|
+
phoneNumber: (...args: [] | [import("./Generators.js").GeneratePhoneNumberT]) => GeneratePhoneNumber;
|
|
490
477
|
/**
|
|
491
478
|
* generates country's names.
|
|
492
479
|
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
@@ -957,7 +944,7 @@ export declare const generatorsFuncsV2: {
|
|
|
957
944
|
*
|
|
958
945
|
* ```
|
|
959
946
|
*/
|
|
960
|
-
valuesFromArray: (args_0: import("./Generators.
|
|
947
|
+
valuesFromArray: (args_0: import("./Generators.js").GenerateValuesFromArrayT) => GenerateValuesFromArray;
|
|
961
948
|
/**
|
|
962
949
|
* generates sequential integers starting with 1.
|
|
963
950
|
* @example
|
|
@@ -1071,8 +1058,6 @@ export declare const generatorsFuncsV2: {
|
|
|
1071
1058
|
}]) => GenerateDate;
|
|
1072
1059
|
/**
|
|
1073
1060
|
* generates time in 24 hours style.
|
|
1074
|
-
* @param minTime - lower border of range.
|
|
1075
|
-
* @param maxTime - upper border of range.
|
|
1076
1061
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
1077
1062
|
*
|
|
1078
1063
|
* @example
|
|
@@ -1080,7 +1065,7 @@ export declare const generatorsFuncsV2: {
|
|
|
1080
1065
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
1081
1066
|
* users: {
|
|
1082
1067
|
* columns: {
|
|
1083
|
-
* birthTime: funcs.time(
|
|
1068
|
+
* birthTime: funcs.time()
|
|
1084
1069
|
* },
|
|
1085
1070
|
* },
|
|
1086
1071
|
* }));
|
|
@@ -1088,14 +1073,10 @@ export declare const generatorsFuncsV2: {
|
|
|
1088
1073
|
* ```
|
|
1089
1074
|
*/
|
|
1090
1075
|
time: (...args: [] | [{
|
|
1091
|
-
minTime?: string | Date;
|
|
1092
|
-
maxTime?: string | Date;
|
|
1093
1076
|
arraySize?: number;
|
|
1094
1077
|
}]) => GenerateTime;
|
|
1095
1078
|
/**
|
|
1096
1079
|
* generates timestamps.
|
|
1097
|
-
* @param minTimestamp - lower border of range.
|
|
1098
|
-
* @param maxTimestamp - upper border of range.
|
|
1099
1080
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
1100
1081
|
*
|
|
1101
1082
|
* @example
|
|
@@ -1103,7 +1084,7 @@ export declare const generatorsFuncsV2: {
|
|
|
1103
1084
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
1104
1085
|
* orders: {
|
|
1105
1086
|
* columns: {
|
|
1106
|
-
* shippedDate: funcs.timestamp(
|
|
1087
|
+
* shippedDate: funcs.timestamp()
|
|
1107
1088
|
* },
|
|
1108
1089
|
* },
|
|
1109
1090
|
* }));
|
|
@@ -1111,14 +1092,10 @@ export declare const generatorsFuncsV2: {
|
|
|
1111
1092
|
* ```
|
|
1112
1093
|
*/
|
|
1113
1094
|
timestamp: (...args: [] | [{
|
|
1114
|
-
minTimestamp?: string | Date;
|
|
1115
|
-
maxTimestamp?: string | Date;
|
|
1116
1095
|
arraySize?: number;
|
|
1117
1096
|
}]) => GenerateTimestamp;
|
|
1118
1097
|
/**
|
|
1119
1098
|
* generates datetime objects.
|
|
1120
|
-
* @param minDatetime - lower border of range.
|
|
1121
|
-
* @param maxDatetime - upper border of range.
|
|
1122
1099
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
1123
1100
|
*
|
|
1124
1101
|
* @example
|
|
@@ -1126,7 +1103,7 @@ export declare const generatorsFuncsV2: {
|
|
|
1126
1103
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
1127
1104
|
* orders: {
|
|
1128
1105
|
* columns: {
|
|
1129
|
-
* shippedDate: funcs.datetime(
|
|
1106
|
+
* shippedDate: funcs.datetime()
|
|
1130
1107
|
* },
|
|
1131
1108
|
* },
|
|
1132
1109
|
* }));
|
|
@@ -1134,8 +1111,6 @@ export declare const generatorsFuncsV2: {
|
|
|
1134
1111
|
* ```
|
|
1135
1112
|
*/
|
|
1136
1113
|
datetime: (...args: [] | [{
|
|
1137
|
-
minDatetime?: string | Date;
|
|
1138
|
-
maxDatetime?: string | Date;
|
|
1139
1114
|
arraySize?: number;
|
|
1140
1115
|
}]) => GenerateDatetime;
|
|
1141
1116
|
/**
|
|
@@ -1379,7 +1354,7 @@ export declare const generatorsFuncsV2: {
|
|
|
1379
1354
|
*
|
|
1380
1355
|
* ```
|
|
1381
1356
|
*/
|
|
1382
|
-
phoneNumber: (...args: [] | [import("./Generators.
|
|
1357
|
+
phoneNumber: (...args: [] | [import("./Generators.js").GeneratePhoneNumberT]) => GeneratePhoneNumber;
|
|
1383
1358
|
/**
|
|
1384
1359
|
* generates country's names.
|
|
1385
1360
|
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
@@ -1850,7 +1825,7 @@ export declare const generatorsFuncsV3: {
|
|
|
1850
1825
|
*
|
|
1851
1826
|
* ```
|
|
1852
1827
|
*/
|
|
1853
|
-
valuesFromArray: (args_0: import("./Generators.
|
|
1828
|
+
valuesFromArray: (args_0: import("./Generators.js").GenerateValuesFromArrayT) => GenerateValuesFromArray;
|
|
1854
1829
|
/**
|
|
1855
1830
|
* generates sequential integers starting with 1.
|
|
1856
1831
|
* @example
|
|
@@ -1964,8 +1939,6 @@ export declare const generatorsFuncsV3: {
|
|
|
1964
1939
|
}]) => GenerateDate;
|
|
1965
1940
|
/**
|
|
1966
1941
|
* generates time in 24 hours style.
|
|
1967
|
-
* @param minTime - lower border of range.
|
|
1968
|
-
* @param maxTime - upper border of range.
|
|
1969
1942
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
1970
1943
|
*
|
|
1971
1944
|
* @example
|
|
@@ -1973,7 +1946,7 @@ export declare const generatorsFuncsV3: {
|
|
|
1973
1946
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
1974
1947
|
* users: {
|
|
1975
1948
|
* columns: {
|
|
1976
|
-
* birthTime: funcs.time(
|
|
1949
|
+
* birthTime: funcs.time()
|
|
1977
1950
|
* },
|
|
1978
1951
|
* },
|
|
1979
1952
|
* }));
|
|
@@ -1981,14 +1954,10 @@ export declare const generatorsFuncsV3: {
|
|
|
1981
1954
|
* ```
|
|
1982
1955
|
*/
|
|
1983
1956
|
time: (...args: [] | [{
|
|
1984
|
-
minTime?: string | Date;
|
|
1985
|
-
maxTime?: string | Date;
|
|
1986
1957
|
arraySize?: number;
|
|
1987
1958
|
}]) => GenerateTime;
|
|
1988
1959
|
/**
|
|
1989
1960
|
* generates timestamps.
|
|
1990
|
-
* @param minTimestamp - lower border of range.
|
|
1991
|
-
* @param maxTimestamp - upper border of range.
|
|
1992
1961
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
1993
1962
|
*
|
|
1994
1963
|
* @example
|
|
@@ -1996,7 +1965,7 @@ export declare const generatorsFuncsV3: {
|
|
|
1996
1965
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
1997
1966
|
* orders: {
|
|
1998
1967
|
* columns: {
|
|
1999
|
-
* shippedDate: funcs.timestamp(
|
|
1968
|
+
* shippedDate: funcs.timestamp()
|
|
2000
1969
|
* },
|
|
2001
1970
|
* },
|
|
2002
1971
|
* }));
|
|
@@ -2004,14 +1973,10 @@ export declare const generatorsFuncsV3: {
|
|
|
2004
1973
|
* ```
|
|
2005
1974
|
*/
|
|
2006
1975
|
timestamp: (...args: [] | [{
|
|
2007
|
-
minTimestamp?: string | Date;
|
|
2008
|
-
maxTimestamp?: string | Date;
|
|
2009
1976
|
arraySize?: number;
|
|
2010
1977
|
}]) => GenerateTimestamp;
|
|
2011
1978
|
/**
|
|
2012
1979
|
* generates datetime objects.
|
|
2013
|
-
* @param minDatetime - lower border of range.
|
|
2014
|
-
* @param maxDatetime - upper border of range.
|
|
2015
1980
|
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2016
1981
|
*
|
|
2017
1982
|
* @example
|
|
@@ -2019,7 +1984,7 @@ export declare const generatorsFuncsV3: {
|
|
|
2019
1984
|
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2020
1985
|
* orders: {
|
|
2021
1986
|
* columns: {
|
|
2022
|
-
* shippedDate: funcs.datetime(
|
|
1987
|
+
* shippedDate: funcs.datetime()
|
|
2023
1988
|
* },
|
|
2024
1989
|
* },
|
|
2025
1990
|
* }));
|
|
@@ -2027,8 +1992,6 @@ export declare const generatorsFuncsV3: {
|
|
|
2027
1992
|
* ```
|
|
2028
1993
|
*/
|
|
2029
1994
|
datetime: (...args: [] | [{
|
|
2030
|
-
minDatetime?: string | Date;
|
|
2031
|
-
maxDatetime?: string | Date;
|
|
2032
1995
|
arraySize?: number;
|
|
2033
1996
|
}]) => GenerateDatetime;
|
|
2034
1997
|
/**
|
|
@@ -2272,900 +2235,7 @@ export declare const generatorsFuncsV3: {
|
|
|
2272
2235
|
*
|
|
2273
2236
|
* ```
|
|
2274
2237
|
*/
|
|
2275
|
-
phoneNumber: (...args: [] | [import("./Generators.
|
|
2276
|
-
/**
|
|
2277
|
-
* generates country's names.
|
|
2278
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2279
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2280
|
-
*
|
|
2281
|
-
* @example
|
|
2282
|
-
* ```ts
|
|
2283
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2284
|
-
* users: {
|
|
2285
|
-
* columns: {
|
|
2286
|
-
* country: funcs.country({isUnique: false})
|
|
2287
|
-
* },
|
|
2288
|
-
* },
|
|
2289
|
-
* }));
|
|
2290
|
-
* ```
|
|
2291
|
-
*/
|
|
2292
|
-
country: (...args: [] | [{
|
|
2293
|
-
isUnique?: boolean;
|
|
2294
|
-
arraySize?: number;
|
|
2295
|
-
}]) => GenerateCountry;
|
|
2296
|
-
/**
|
|
2297
|
-
* generates city's names.
|
|
2298
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2299
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2300
|
-
*
|
|
2301
|
-
* @example
|
|
2302
|
-
* ```ts
|
|
2303
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2304
|
-
* users: {
|
|
2305
|
-
* columns: {
|
|
2306
|
-
* city: funcs.city({isUnique: false})
|
|
2307
|
-
* },
|
|
2308
|
-
* },
|
|
2309
|
-
* }));
|
|
2310
|
-
* ```
|
|
2311
|
-
*/
|
|
2312
|
-
city: (...args: [] | [{
|
|
2313
|
-
isUnique?: boolean;
|
|
2314
|
-
arraySize?: number;
|
|
2315
|
-
}]) => GenerateCity;
|
|
2316
|
-
/**
|
|
2317
|
-
* generates street address.
|
|
2318
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2319
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2320
|
-
*
|
|
2321
|
-
* @example
|
|
2322
|
-
* ```ts
|
|
2323
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2324
|
-
* users: {
|
|
2325
|
-
* columns: {
|
|
2326
|
-
* streetAddress: funcs.streetAddress({isUnique: true})
|
|
2327
|
-
* },
|
|
2328
|
-
* },
|
|
2329
|
-
* }));
|
|
2330
|
-
* ```
|
|
2331
|
-
*/
|
|
2332
|
-
streetAddress: (...args: [] | [{
|
|
2333
|
-
isUnique?: boolean;
|
|
2334
|
-
arraySize?: number;
|
|
2335
|
-
}]) => GenerateStreetAddress;
|
|
2336
|
-
/**
|
|
2337
|
-
* generates job titles.
|
|
2338
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2339
|
-
*
|
|
2340
|
-
* @example
|
|
2341
|
-
* ```ts
|
|
2342
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2343
|
-
* users: {
|
|
2344
|
-
* columns: {
|
|
2345
|
-
* jobTitle: funcs.jobTitle()
|
|
2346
|
-
* },
|
|
2347
|
-
* },
|
|
2348
|
-
* }));
|
|
2349
|
-
* ```
|
|
2350
|
-
*/
|
|
2351
|
-
jobTitle: (...args: [] | [{
|
|
2352
|
-
arraySize?: number;
|
|
2353
|
-
}]) => GenerateJobTitle;
|
|
2354
|
-
/**
|
|
2355
|
-
* generates postal codes.
|
|
2356
|
-
*
|
|
2357
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2358
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2359
|
-
*
|
|
2360
|
-
* @example
|
|
2361
|
-
* ```ts
|
|
2362
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2363
|
-
* users: {
|
|
2364
|
-
* columns: {
|
|
2365
|
-
* postcode: funcs.postcode({isUnique: true})
|
|
2366
|
-
* },
|
|
2367
|
-
* },
|
|
2368
|
-
* }));
|
|
2369
|
-
* ```
|
|
2370
|
-
*/
|
|
2371
|
-
postcode: (...args: [] | [{
|
|
2372
|
-
isUnique?: boolean;
|
|
2373
|
-
arraySize?: number;
|
|
2374
|
-
}]) => GeneratePostcode;
|
|
2375
|
-
/**
|
|
2376
|
-
* generates states of America.
|
|
2377
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2378
|
-
*
|
|
2379
|
-
* @example
|
|
2380
|
-
* ```ts
|
|
2381
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2382
|
-
* users: {
|
|
2383
|
-
* columns: {
|
|
2384
|
-
* state: funcs.state()
|
|
2385
|
-
* },
|
|
2386
|
-
* },
|
|
2387
|
-
* }));
|
|
2388
|
-
* ```
|
|
2389
|
-
*/
|
|
2390
|
-
state: (...args: [] | [{
|
|
2391
|
-
arraySize?: number;
|
|
2392
|
-
}]) => GenerateState;
|
|
2393
|
-
/**
|
|
2394
|
-
* generates company's names.
|
|
2395
|
-
*
|
|
2396
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2397
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2398
|
-
*
|
|
2399
|
-
* @example
|
|
2400
|
-
* ```ts
|
|
2401
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2402
|
-
* users: {
|
|
2403
|
-
* columns: {
|
|
2404
|
-
* company: funcs.companyName({isUnique: true})
|
|
2405
|
-
* },
|
|
2406
|
-
* },
|
|
2407
|
-
* }));
|
|
2408
|
-
* ```
|
|
2409
|
-
*/
|
|
2410
|
-
companyName: (...args: [] | [{
|
|
2411
|
-
isUnique?: boolean;
|
|
2412
|
-
arraySize?: number;
|
|
2413
|
-
}]) => GenerateCompanyName;
|
|
2414
|
-
/**
|
|
2415
|
-
* generates 'lorem ipsum' text sentences.
|
|
2416
|
-
*
|
|
2417
|
-
* @param sentencesCount - number of sentences you want to generate as one generated value(string).
|
|
2418
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2419
|
-
*
|
|
2420
|
-
* @example
|
|
2421
|
-
* ```ts
|
|
2422
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2423
|
-
* posts: {
|
|
2424
|
-
* columns: {
|
|
2425
|
-
* content: funcs.loremIpsum({sentencesCount: 2})
|
|
2426
|
-
* },
|
|
2427
|
-
* },
|
|
2428
|
-
* }));
|
|
2429
|
-
* ```
|
|
2430
|
-
*/
|
|
2431
|
-
loremIpsum: (...args: [] | [{
|
|
2432
|
-
sentencesCount?: number;
|
|
2433
|
-
arraySize?: number;
|
|
2434
|
-
}]) => GenerateLoremIpsum;
|
|
2435
|
-
/**
|
|
2436
|
-
* generates 2D points within specified ranges for x and y coordinates.
|
|
2437
|
-
*
|
|
2438
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2439
|
-
* @param minXValue - lower bound of range for x coordinate.
|
|
2440
|
-
* @param maxXValue - upper bound of range for x coordinate.
|
|
2441
|
-
* @param minYValue - lower bound of range for y coordinate.
|
|
2442
|
-
* @param maxYValue - upper bound of range for y coordinate.
|
|
2443
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2444
|
-
*
|
|
2445
|
-
* @example
|
|
2446
|
-
* ```ts
|
|
2447
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2448
|
-
* triangles: {
|
|
2449
|
-
* columns: {
|
|
2450
|
-
* pointCoords: funcs.point({
|
|
2451
|
-
* isUnique: true,
|
|
2452
|
-
* minXValue: -5, maxXValue:20,
|
|
2453
|
-
* minYValue: 0, maxYValue: 30
|
|
2454
|
-
* })
|
|
2455
|
-
* },
|
|
2456
|
-
* },
|
|
2457
|
-
* }));
|
|
2458
|
-
* ```
|
|
2459
|
-
*/
|
|
2460
|
-
point: (...args: [] | [{
|
|
2461
|
-
isUnique?: boolean;
|
|
2462
|
-
minXValue?: number;
|
|
2463
|
-
maxXValue?: number;
|
|
2464
|
-
minYValue?: number;
|
|
2465
|
-
maxYValue?: number;
|
|
2466
|
-
arraySize?: number;
|
|
2467
|
-
}]) => GeneratePoint;
|
|
2468
|
-
/**
|
|
2469
|
-
* generates 2D lines within specified ranges for a, b and c parameters of line.
|
|
2470
|
-
*
|
|
2471
|
-
* ```
|
|
2472
|
-
* line equation: a*x + b*y + c = 0
|
|
2473
|
-
* ```
|
|
2474
|
-
*
|
|
2475
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2476
|
-
* @param minAValue - lower bound of range for a parameter.
|
|
2477
|
-
* @param maxAValue - upper bound of range for x parameter.
|
|
2478
|
-
* @param minBValue - lower bound of range for y parameter.
|
|
2479
|
-
* @param maxBValue - upper bound of range for y parameter.
|
|
2480
|
-
* @param minCValue - lower bound of range for y parameter.
|
|
2481
|
-
* @param maxCValue - upper bound of range for y parameter.
|
|
2482
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2483
|
-
*
|
|
2484
|
-
* @example
|
|
2485
|
-
* ```ts
|
|
2486
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2487
|
-
* lines: {
|
|
2488
|
-
* columns: {
|
|
2489
|
-
* lineParams: funcs.point({
|
|
2490
|
-
* isUnique: true,
|
|
2491
|
-
* minAValue: -5, maxAValue:20,
|
|
2492
|
-
* minBValue: 0, maxBValue: 30,
|
|
2493
|
-
* minCValue: 0, maxCValue: 10
|
|
2494
|
-
* })
|
|
2495
|
-
* },
|
|
2496
|
-
* },
|
|
2497
|
-
* }));
|
|
2498
|
-
* ```
|
|
2499
|
-
*/
|
|
2500
|
-
line: (...args: [] | [{
|
|
2501
|
-
isUnique?: boolean;
|
|
2502
|
-
minAValue?: number;
|
|
2503
|
-
maxAValue?: number;
|
|
2504
|
-
minBValue?: number;
|
|
2505
|
-
maxBValue?: number;
|
|
2506
|
-
minCValue?: number;
|
|
2507
|
-
maxCValue?: number;
|
|
2508
|
-
arraySize?: number;
|
|
2509
|
-
}]) => GenerateLine;
|
|
2510
|
-
/**
|
|
2511
|
-
* gives you the opportunity to call different generators with different probabilities to generate values for one column.
|
|
2512
|
-
* @param params - array of generators with probabilities you would like to call them to generate values.
|
|
2513
|
-
*
|
|
2514
|
-
* @example
|
|
2515
|
-
* ```ts
|
|
2516
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2517
|
-
* posts: {
|
|
2518
|
-
* columns: {
|
|
2519
|
-
* content: funcs.weightedRandom([
|
|
2520
|
-
* {
|
|
2521
|
-
* weight: 0.6,
|
|
2522
|
-
* value: funcs.loremIpsum({ sentencesCount: 3 }),
|
|
2523
|
-
* },
|
|
2524
|
-
* {
|
|
2525
|
-
* weight: 0.4,
|
|
2526
|
-
* value: funcs.default({ defaultValue: "TODO" }),
|
|
2527
|
-
* },
|
|
2528
|
-
* ]),
|
|
2529
|
-
* },
|
|
2530
|
-
* },
|
|
2531
|
-
* }));
|
|
2532
|
-
* ```
|
|
2533
|
-
*/
|
|
2534
|
-
weightedRandom: (args_0: {
|
|
2535
|
-
weight: number;
|
|
2536
|
-
value: AbstractGenerator<any>;
|
|
2537
|
-
}[]) => WeightedRandomGenerator;
|
|
2538
|
-
/**
|
|
2539
|
-
* generates bit strings based on specified parameters
|
|
2540
|
-
*
|
|
2541
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2542
|
-
* @param arraySize - number of elements in each one-dimensional array (If specified, arrays will be generated).
|
|
2543
|
-
* @param dimensions - desired length of each bit string (e.g., `dimensions = 3` produces values like `'010'`).
|
|
2544
|
-
*
|
|
2545
|
-
* Defaults to the value of the database column bit-length.
|
|
2546
|
-
*
|
|
2547
|
-
* @example
|
|
2548
|
-
* ```ts
|
|
2549
|
-
* await seed(db, { bitStringTable: schema.bitStringTable }).refine((funcs) => ({
|
|
2550
|
-
* bitStringTable: {
|
|
2551
|
-
* count,
|
|
2552
|
-
* columns: {
|
|
2553
|
-
* bit: funcs.bitString({
|
|
2554
|
-
* dimensions: 12,
|
|
2555
|
-
* isUnique: true
|
|
2556
|
-
* }),
|
|
2557
|
-
* },
|
|
2558
|
-
* },
|
|
2559
|
-
* }));
|
|
2560
|
-
* ```
|
|
2561
|
-
*/
|
|
2562
|
-
bitString: (...args: [] | [{
|
|
2563
|
-
dimensions?: number;
|
|
2564
|
-
isUnique?: boolean;
|
|
2565
|
-
arraySize?: number;
|
|
2566
|
-
}]) => GenerateBitString;
|
|
2567
|
-
/**
|
|
2568
|
-
* generates ip addresses based on specified parameters
|
|
2569
|
-
*
|
|
2570
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2571
|
-
* @param arraySize - number of elements in each one-dimensional array (If specified, arrays will be generated).
|
|
2572
|
-
* @param ipAddress - type of IP address to generate — either "ipv4" or "ipv6".
|
|
2573
|
-
*
|
|
2574
|
-
* Defaults to `'ipv4'`.
|
|
2575
|
-
* @param includeCidr - determines whether generated IPs include a CIDR suffix.
|
|
2576
|
-
*
|
|
2577
|
-
* Defaults to `true`.
|
|
2578
|
-
*
|
|
2579
|
-
* @example
|
|
2580
|
-
* ```ts
|
|
2581
|
-
* await seed(db, { inetTable: schema.inetTable }).refine((funcs) => ({
|
|
2582
|
-
* inetTable: {
|
|
2583
|
-
* count,
|
|
2584
|
-
* columns: {
|
|
2585
|
-
* inet: funcs.inet({
|
|
2586
|
-
* ipAddress: 'ipv4',
|
|
2587
|
-
* includeCidr: true,
|
|
2588
|
-
* isUnique: true
|
|
2589
|
-
* }),
|
|
2590
|
-
* },
|
|
2591
|
-
* },
|
|
2592
|
-
* }));
|
|
2593
|
-
* ```
|
|
2594
|
-
*/
|
|
2595
|
-
inet: (...args: [] | [{
|
|
2596
|
-
ipAddress?: "ipv4" | "ipv6";
|
|
2597
|
-
includeCidr?: boolean;
|
|
2598
|
-
isUnique?: boolean;
|
|
2599
|
-
arraySize?: number;
|
|
2600
|
-
}]) => GenerateInet;
|
|
2601
|
-
/**
|
|
2602
|
-
* generates PostGIS geometry objects based on the given parameters.
|
|
2603
|
-
*
|
|
2604
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2605
|
-
* @param arraySize - number of elements in each one-dimensional array (If specified, arrays will be generated).
|
|
2606
|
-
* @param type - geometry type to generate; currently only `'point'` is supported.
|
|
2607
|
-
*
|
|
2608
|
-
* Defaults to `'point'`.
|
|
2609
|
-
* @param srid - Spatial Reference System Identifier: determines what type of point will be generated - either `4326` or `3857`.
|
|
2610
|
-
*
|
|
2611
|
-
* Defaults to `4326`.
|
|
2612
|
-
* @param decimalPlaces - number of decimal places for points when `srid` is `4326` (e.g., `decimalPlaces = 3` produces values like `'point(30.723 46.482)'`).
|
|
2613
|
-
*
|
|
2614
|
-
* Defaults to `6`.
|
|
2615
|
-
*
|
|
2616
|
-
* @example
|
|
2617
|
-
* ```ts
|
|
2618
|
-
* await seed(db, { geometryTable: schema.geometryTable }).refine((funcs) => ({
|
|
2619
|
-
* geometryTable: {
|
|
2620
|
-
* count,
|
|
2621
|
-
* columns: {
|
|
2622
|
-
* geometryPointTuple: funcs.geometry({
|
|
2623
|
-
* type: 'point',
|
|
2624
|
-
* srid: 4326,
|
|
2625
|
-
* decimalPlaces: 5,
|
|
2626
|
-
* isUnique: true
|
|
2627
|
-
* })
|
|
2628
|
-
* },
|
|
2629
|
-
* },
|
|
2630
|
-
* }));
|
|
2631
|
-
* ```
|
|
2632
|
-
*/
|
|
2633
|
-
geometry: (...args: [] | [{
|
|
2634
|
-
type?: "point";
|
|
2635
|
-
srid?: 4326 | 3857;
|
|
2636
|
-
decimalPlaces?: 1 | 2 | 3 | 4 | 5 | 6 | 7;
|
|
2637
|
-
isUnique?: boolean;
|
|
2638
|
-
arraySize?: number;
|
|
2639
|
-
}]) => GenerateGeometry;
|
|
2640
|
-
/**
|
|
2641
|
-
* generates vectors based on the provided parameters.
|
|
2642
|
-
*
|
|
2643
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2644
|
-
* @param arraySize - number of elements in each one-dimensional array (If specified, arrays will be generated).
|
|
2645
|
-
* @param decimalPlaces - number of decimal places for each vector element (e.g., `decimalPlaces = 3` produces values like `1.123`).
|
|
2646
|
-
*
|
|
2647
|
-
* Defaults to `2`.
|
|
2648
|
-
* @param dimensions - number of elements in each generated vector (e.g., `dimensions = 3` produces values like `[1,2,3]`).
|
|
2649
|
-
*
|
|
2650
|
-
* Defaults to the value of the database column’s dimensions.
|
|
2651
|
-
* @param minValue - minimum allowed value for each vector element.
|
|
2652
|
-
*
|
|
2653
|
-
* Defaults to `-1000`.
|
|
2654
|
-
* @param maxValue - maximum allowed value for each vector element.
|
|
2655
|
-
*
|
|
2656
|
-
* Defaults to `1000`.
|
|
2657
|
-
*
|
|
2658
|
-
* @example
|
|
2659
|
-
* ```ts
|
|
2660
|
-
* await seed(db, { vectorTable: schema.vectorTable }).refine((funcs) => ({
|
|
2661
|
-
* vectorTable: {
|
|
2662
|
-
* count,
|
|
2663
|
-
* columns: {
|
|
2664
|
-
* vector: funcs.vector({
|
|
2665
|
-
* decimalPlaces: 5,
|
|
2666
|
-
* dimensions: 12,
|
|
2667
|
-
* minValue: -100,
|
|
2668
|
-
* maxValue: 100,
|
|
2669
|
-
* isUnique: true
|
|
2670
|
-
* }),
|
|
2671
|
-
* },
|
|
2672
|
-
* },
|
|
2673
|
-
* }));
|
|
2674
|
-
* ```
|
|
2675
|
-
*/
|
|
2676
|
-
vector: (...args: [] | [{
|
|
2677
|
-
dimensions?: number;
|
|
2678
|
-
minValue?: number;
|
|
2679
|
-
maxValue?: number;
|
|
2680
|
-
decimalPlaces?: number;
|
|
2681
|
-
isUnique?: boolean;
|
|
2682
|
-
arraySize?: number;
|
|
2683
|
-
}]) => GenerateVector;
|
|
2684
|
-
};
|
|
2685
|
-
export declare const generatorsFuncsV4: {
|
|
2686
|
-
/**
|
|
2687
|
-
* generates same given value each time the generator is called.
|
|
2688
|
-
* @param defaultValue - value you want to generate
|
|
2689
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2690
|
-
*
|
|
2691
|
-
* @example
|
|
2692
|
-
* ```ts
|
|
2693
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2694
|
-
* posts: {
|
|
2695
|
-
* columns: {
|
|
2696
|
-
* content: funcs.default({ defaultValue: "post content" }),
|
|
2697
|
-
* },
|
|
2698
|
-
* },
|
|
2699
|
-
* }));
|
|
2700
|
-
* ```
|
|
2701
|
-
*/
|
|
2702
|
-
default: (args_0: {
|
|
2703
|
-
defaultValue: unknown;
|
|
2704
|
-
arraySize?: number;
|
|
2705
|
-
}) => GenerateDefault;
|
|
2706
|
-
/**
|
|
2707
|
-
* generates values from given array
|
|
2708
|
-
* @param values - array of values you want to generate. can be array of weighted values.
|
|
2709
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2710
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2711
|
-
*
|
|
2712
|
-
* @example
|
|
2713
|
-
* ```ts
|
|
2714
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2715
|
-
* posts: {
|
|
2716
|
-
* columns: {
|
|
2717
|
-
* title: funcs.valuesFromArray({
|
|
2718
|
-
* values: ["Title1", "Title2", "Title3", "Title4", "Title5"],
|
|
2719
|
-
* isUnique: true
|
|
2720
|
-
* }),
|
|
2721
|
-
* },
|
|
2722
|
-
* },
|
|
2723
|
-
* }));
|
|
2724
|
-
*
|
|
2725
|
-
* ```
|
|
2726
|
-
* weighted values example
|
|
2727
|
-
* @example
|
|
2728
|
-
* ```ts
|
|
2729
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2730
|
-
* posts: {
|
|
2731
|
-
* columns: {
|
|
2732
|
-
* title: funcs.valuesFromArray({
|
|
2733
|
-
* values: [
|
|
2734
|
-
* { weight: 0.35, values: ["Title1", "Title2"] },
|
|
2735
|
-
* { weight: 0.5, values: ["Title3", "Title4"] },
|
|
2736
|
-
* { weight: 0.15, values: ["Title5"] },
|
|
2737
|
-
* ],
|
|
2738
|
-
* isUnique: false
|
|
2739
|
-
* }),
|
|
2740
|
-
* },
|
|
2741
|
-
* },
|
|
2742
|
-
* }));
|
|
2743
|
-
*
|
|
2744
|
-
* ```
|
|
2745
|
-
*/
|
|
2746
|
-
valuesFromArray: (args_0: import("./Generators.ts").GenerateValuesFromArrayT) => GenerateValuesFromArray;
|
|
2747
|
-
/**
|
|
2748
|
-
* generates sequential integers starting with 1.
|
|
2749
|
-
* @example
|
|
2750
|
-
* ```ts
|
|
2751
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2752
|
-
* posts: {
|
|
2753
|
-
* columns: {
|
|
2754
|
-
* id: funcs.intPrimaryKey(),
|
|
2755
|
-
* },
|
|
2756
|
-
* },
|
|
2757
|
-
* }));
|
|
2758
|
-
*
|
|
2759
|
-
* ```
|
|
2760
|
-
*/
|
|
2761
|
-
intPrimaryKey: (...args: [] | [{}]) => GenerateIntPrimaryKey;
|
|
2762
|
-
/**
|
|
2763
|
-
* generates numbers with floating point in given range.
|
|
2764
|
-
* @param minValue - lower border of range.
|
|
2765
|
-
* @param maxValue - upper border of range.
|
|
2766
|
-
* @param precision - precision of generated number:
|
|
2767
|
-
* precision equals 10 means that values will be accurate to one tenth (1.2, 34.6);
|
|
2768
|
-
* precision equals 100 means that values will be accurate to one hundredth (1.23, 34.67).
|
|
2769
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2770
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2771
|
-
*
|
|
2772
|
-
* @example
|
|
2773
|
-
* ```ts
|
|
2774
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2775
|
-
* products: {
|
|
2776
|
-
* columns: {
|
|
2777
|
-
* unitPrice: funcs.number({ minValue: 10, maxValue: 120, precision: 100, isUnique: false }),
|
|
2778
|
-
* },
|
|
2779
|
-
* },
|
|
2780
|
-
* }));
|
|
2781
|
-
*
|
|
2782
|
-
* ```
|
|
2783
|
-
*/
|
|
2784
|
-
number: (...args: [] | [{
|
|
2785
|
-
minValue?: number;
|
|
2786
|
-
maxValue?: number;
|
|
2787
|
-
precision?: number;
|
|
2788
|
-
isUnique?: boolean;
|
|
2789
|
-
arraySize?: number;
|
|
2790
|
-
}]) => GenerateNumber;
|
|
2791
|
-
/**
|
|
2792
|
-
* generates integers within given range.
|
|
2793
|
-
* @param minValue - lower border of range.
|
|
2794
|
-
* @param maxValue - upper border of range.
|
|
2795
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2796
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2797
|
-
*
|
|
2798
|
-
* @example
|
|
2799
|
-
* ```ts
|
|
2800
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2801
|
-
* products: {
|
|
2802
|
-
* columns: {
|
|
2803
|
-
* unitsInStock: funcs.number({ minValue: 0, maxValue: 100, isUnique: false }),
|
|
2804
|
-
* },
|
|
2805
|
-
* },
|
|
2806
|
-
* }));
|
|
2807
|
-
*
|
|
2808
|
-
* ```
|
|
2809
|
-
*/
|
|
2810
|
-
int: (...args: [] | [{
|
|
2811
|
-
minValue?: number | bigint;
|
|
2812
|
-
maxValue?: number | bigint;
|
|
2813
|
-
isUnique?: boolean;
|
|
2814
|
-
arraySize?: number;
|
|
2815
|
-
}]) => GenerateInt;
|
|
2816
|
-
/**
|
|
2817
|
-
* generates boolean values(true or false)
|
|
2818
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2819
|
-
*
|
|
2820
|
-
* @example
|
|
2821
|
-
* ```ts
|
|
2822
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2823
|
-
* users: {
|
|
2824
|
-
* columns: {
|
|
2825
|
-
* isAvailable: funcs.boolean()
|
|
2826
|
-
* },
|
|
2827
|
-
* },
|
|
2828
|
-
* }));
|
|
2829
|
-
*
|
|
2830
|
-
* ```
|
|
2831
|
-
*/
|
|
2832
|
-
boolean: (...args: [] | [{
|
|
2833
|
-
arraySize?: number;
|
|
2834
|
-
}]) => GenerateBoolean;
|
|
2835
|
-
/**
|
|
2836
|
-
* generates date within given range.
|
|
2837
|
-
* @param minDate - lower border of range.
|
|
2838
|
-
* @param maxDate - upper border of range.
|
|
2839
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2840
|
-
*
|
|
2841
|
-
* @example
|
|
2842
|
-
* ```ts
|
|
2843
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2844
|
-
* users: {
|
|
2845
|
-
* columns: {
|
|
2846
|
-
* birthDate: funcs.date({ minDate: "1990-01-01", maxDate: "2010-12-31" })
|
|
2847
|
-
* },
|
|
2848
|
-
* },
|
|
2849
|
-
* }));
|
|
2850
|
-
*
|
|
2851
|
-
* ```
|
|
2852
|
-
*/
|
|
2853
|
-
date: (...args: [] | [{
|
|
2854
|
-
minDate?: string | Date;
|
|
2855
|
-
maxDate?: string | Date;
|
|
2856
|
-
arraySize?: number;
|
|
2857
|
-
}]) => GenerateDate;
|
|
2858
|
-
/**
|
|
2859
|
-
* generates time in 24 hours style.
|
|
2860
|
-
* @param minTime - lower border of range.
|
|
2861
|
-
* @param maxTime - upper border of range.
|
|
2862
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2863
|
-
*
|
|
2864
|
-
* @example
|
|
2865
|
-
* ```ts
|
|
2866
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2867
|
-
* users: {
|
|
2868
|
-
* columns: {
|
|
2869
|
-
* birthTime: funcs.time({ minTime: "11:12:13.141", maxTime: "15:16:17.181" })
|
|
2870
|
-
* },
|
|
2871
|
-
* },
|
|
2872
|
-
* }));
|
|
2873
|
-
*
|
|
2874
|
-
* ```
|
|
2875
|
-
*/
|
|
2876
|
-
time: (...args: [] | [{
|
|
2877
|
-
minTime?: string | Date;
|
|
2878
|
-
maxTime?: string | Date;
|
|
2879
|
-
arraySize?: number;
|
|
2880
|
-
}]) => GenerateTime;
|
|
2881
|
-
/**
|
|
2882
|
-
* generates timestamps.
|
|
2883
|
-
* @param minTimestamp - lower border of range.
|
|
2884
|
-
* @param maxTimestamp - upper border of range.
|
|
2885
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2886
|
-
*
|
|
2887
|
-
* @example
|
|
2888
|
-
* ```ts
|
|
2889
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2890
|
-
* orders: {
|
|
2891
|
-
* columns: {
|
|
2892
|
-
* shippedDate: funcs.timestamp({ minTimestamp: "2025-03-07T11:12:13.141", maxTimestamp: "2025-03-08T15:16:17.181" })
|
|
2893
|
-
* },
|
|
2894
|
-
* },
|
|
2895
|
-
* }));
|
|
2896
|
-
*
|
|
2897
|
-
* ```
|
|
2898
|
-
*/
|
|
2899
|
-
timestamp: (...args: [] | [{
|
|
2900
|
-
minTimestamp?: string | Date;
|
|
2901
|
-
maxTimestamp?: string | Date;
|
|
2902
|
-
arraySize?: number;
|
|
2903
|
-
}]) => GenerateTimestamp;
|
|
2904
|
-
/**
|
|
2905
|
-
* generates datetime objects.
|
|
2906
|
-
* @param minDatetime - lower border of range.
|
|
2907
|
-
* @param maxDatetime - upper border of range.
|
|
2908
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2909
|
-
*
|
|
2910
|
-
* @example
|
|
2911
|
-
* ```ts
|
|
2912
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2913
|
-
* orders: {
|
|
2914
|
-
* columns: {
|
|
2915
|
-
* shippedDate: funcs.datetime({ minDatetime: "2025-03-07T11:12:13.141", maxDatetime: "2025-03-08T15:16:17.181" })
|
|
2916
|
-
* },
|
|
2917
|
-
* },
|
|
2918
|
-
* }));
|
|
2919
|
-
*
|
|
2920
|
-
* ```
|
|
2921
|
-
*/
|
|
2922
|
-
datetime: (...args: [] | [{
|
|
2923
|
-
minDatetime?: string | Date;
|
|
2924
|
-
maxDatetime?: string | Date;
|
|
2925
|
-
arraySize?: number;
|
|
2926
|
-
}]) => GenerateDatetime;
|
|
2927
|
-
/**
|
|
2928
|
-
* generates years.
|
|
2929
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2930
|
-
*
|
|
2931
|
-
* @example
|
|
2932
|
-
* ```ts
|
|
2933
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2934
|
-
* users: {
|
|
2935
|
-
* columns: {
|
|
2936
|
-
* birthYear: funcs.year()
|
|
2937
|
-
* },
|
|
2938
|
-
* },
|
|
2939
|
-
* }));
|
|
2940
|
-
*
|
|
2941
|
-
* ```
|
|
2942
|
-
*/
|
|
2943
|
-
year: (...args: [] | [{
|
|
2944
|
-
arraySize?: number;
|
|
2945
|
-
}]) => GenerateYear;
|
|
2946
|
-
/**
|
|
2947
|
-
* generates json objects with fixed structure.
|
|
2948
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2949
|
-
*
|
|
2950
|
-
* json structure can equal this:
|
|
2951
|
-
* ```
|
|
2952
|
-
* {
|
|
2953
|
-
* email,
|
|
2954
|
-
* name,
|
|
2955
|
-
* isGraduated,
|
|
2956
|
-
* hasJob,
|
|
2957
|
-
* salary,
|
|
2958
|
-
* startedWorking,
|
|
2959
|
-
* visitedCountries,
|
|
2960
|
-
* }
|
|
2961
|
-
* ```
|
|
2962
|
-
* or this
|
|
2963
|
-
* ```
|
|
2964
|
-
* {
|
|
2965
|
-
* email,
|
|
2966
|
-
* name,
|
|
2967
|
-
* isGraduated,
|
|
2968
|
-
* hasJob,
|
|
2969
|
-
* visitedCountries,
|
|
2970
|
-
* }
|
|
2971
|
-
* ```
|
|
2972
|
-
*
|
|
2973
|
-
* @example
|
|
2974
|
-
* ```ts
|
|
2975
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2976
|
-
* users: {
|
|
2977
|
-
* columns: {
|
|
2978
|
-
* metadata: funcs.json()
|
|
2979
|
-
* },
|
|
2980
|
-
* },
|
|
2981
|
-
* }));
|
|
2982
|
-
* ```
|
|
2983
|
-
*/
|
|
2984
|
-
json: (...args: [] | [{
|
|
2985
|
-
arraySize?: number;
|
|
2986
|
-
}]) => GenerateJson;
|
|
2987
|
-
/**
|
|
2988
|
-
* generates time intervals.
|
|
2989
|
-
*
|
|
2990
|
-
* interval example: "1 years 12 days 5 minutes"
|
|
2991
|
-
*
|
|
2992
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
2993
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
2994
|
-
* @param fields - range of values you want to see in your intervals.
|
|
2995
|
-
* @example
|
|
2996
|
-
* ```ts
|
|
2997
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
2998
|
-
* users: {
|
|
2999
|
-
* columns: {
|
|
3000
|
-
* timeSpentOnWebsite: funcs.interval()
|
|
3001
|
-
* },
|
|
3002
|
-
* },
|
|
3003
|
-
* }));
|
|
3004
|
-
* ```
|
|
3005
|
-
*/
|
|
3006
|
-
interval: (...args: [] | [{
|
|
3007
|
-
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";
|
|
3008
|
-
isUnique?: boolean;
|
|
3009
|
-
arraySize?: number;
|
|
3010
|
-
}]) => GenerateInterval;
|
|
3011
|
-
/**
|
|
3012
|
-
* generates random strings.
|
|
3013
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
3014
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
3015
|
-
*
|
|
3016
|
-
* @example
|
|
3017
|
-
* ```ts
|
|
3018
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3019
|
-
* users: {
|
|
3020
|
-
* columns: {
|
|
3021
|
-
* hashedPassword: funcs.string({isUnique: false})
|
|
3022
|
-
* },
|
|
3023
|
-
* },
|
|
3024
|
-
* }));
|
|
3025
|
-
* ```
|
|
3026
|
-
*/
|
|
3027
|
-
string: (...args: [] | [{
|
|
3028
|
-
isUnique?: boolean;
|
|
3029
|
-
arraySize?: number;
|
|
3030
|
-
}]) => GenerateString;
|
|
3031
|
-
/**
|
|
3032
|
-
* generates v4 UUID strings if arraySize is not specified, or v4 UUID 1D arrays if it is.
|
|
3033
|
-
*
|
|
3034
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
3035
|
-
*
|
|
3036
|
-
* @example
|
|
3037
|
-
* ```ts
|
|
3038
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3039
|
-
* users: {
|
|
3040
|
-
* columns: {
|
|
3041
|
-
* uuid: funcs.uuid({
|
|
3042
|
-
* arraySize: 4
|
|
3043
|
-
* })
|
|
3044
|
-
* },
|
|
3045
|
-
* },
|
|
3046
|
-
* }));
|
|
3047
|
-
* ```
|
|
3048
|
-
*/
|
|
3049
|
-
uuid: (...args: [] | [{
|
|
3050
|
-
arraySize?: number;
|
|
3051
|
-
}]) => GenerateUUID;
|
|
3052
|
-
/**
|
|
3053
|
-
* generates person's first names.
|
|
3054
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
3055
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
3056
|
-
*
|
|
3057
|
-
* @example
|
|
3058
|
-
* ```ts
|
|
3059
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3060
|
-
* users: {
|
|
3061
|
-
* columns: {
|
|
3062
|
-
* firstName: funcs.firstName({isUnique: true})
|
|
3063
|
-
* },
|
|
3064
|
-
* },
|
|
3065
|
-
* }));
|
|
3066
|
-
* ```
|
|
3067
|
-
*/
|
|
3068
|
-
firstName: (...args: [] | [{
|
|
3069
|
-
isUnique?: boolean;
|
|
3070
|
-
arraySize?: number;
|
|
3071
|
-
}]) => GenerateFirstName;
|
|
3072
|
-
/**
|
|
3073
|
-
* generates person's last names.
|
|
3074
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
3075
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
3076
|
-
*
|
|
3077
|
-
* @example
|
|
3078
|
-
* ```ts
|
|
3079
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3080
|
-
* users: {
|
|
3081
|
-
* columns: {
|
|
3082
|
-
* lastName: funcs.lastName({isUnique: false})
|
|
3083
|
-
* },
|
|
3084
|
-
* },
|
|
3085
|
-
* }));
|
|
3086
|
-
* ```
|
|
3087
|
-
*/
|
|
3088
|
-
lastName: (...args: [] | [{
|
|
3089
|
-
isUnique?: boolean;
|
|
3090
|
-
arraySize?: number;
|
|
3091
|
-
}]) => GenerateLastName;
|
|
3092
|
-
/**
|
|
3093
|
-
* generates person's full names.
|
|
3094
|
-
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
3095
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
3096
|
-
*
|
|
3097
|
-
* @example
|
|
3098
|
-
* ```ts
|
|
3099
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3100
|
-
* users: {
|
|
3101
|
-
* columns: {
|
|
3102
|
-
* fullName: funcs.fullName({isUnique: true})
|
|
3103
|
-
* },
|
|
3104
|
-
* },
|
|
3105
|
-
* }));
|
|
3106
|
-
* ```
|
|
3107
|
-
*/
|
|
3108
|
-
fullName: (...args: [] | [{
|
|
3109
|
-
isUnique?: boolean;
|
|
3110
|
-
arraySize?: number;
|
|
3111
|
-
}]) => GenerateFullName;
|
|
3112
|
-
/**
|
|
3113
|
-
* generates unique emails.
|
|
3114
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
3115
|
-
*
|
|
3116
|
-
* @example
|
|
3117
|
-
* ```ts
|
|
3118
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3119
|
-
* users: {
|
|
3120
|
-
* columns: {
|
|
3121
|
-
* email: funcs.email()
|
|
3122
|
-
* },
|
|
3123
|
-
* },
|
|
3124
|
-
* }));
|
|
3125
|
-
* ```
|
|
3126
|
-
*/
|
|
3127
|
-
email: (...args: [] | [{
|
|
3128
|
-
arraySize?: number;
|
|
3129
|
-
}]) => GenerateEmail;
|
|
3130
|
-
/**
|
|
3131
|
-
* generates unique phone numbers.
|
|
3132
|
-
* @param arraySize - number of elements in each one-dimensional array. (If specified, arrays will be generated.)
|
|
3133
|
-
*
|
|
3134
|
-
* @param template - phone number template, where all '#' symbols will be substituted with generated digits.
|
|
3135
|
-
* @param prefixes - array of any string you want to be your phone number prefixes.(not compatible with template property)
|
|
3136
|
-
* @param generatedDigitsNumbers - number of digits that will be added at the end of prefixes.(not compatible with template property)
|
|
3137
|
-
* @example
|
|
3138
|
-
* ```ts
|
|
3139
|
-
* //generate phone number using template property
|
|
3140
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3141
|
-
* users: {
|
|
3142
|
-
* columns: {
|
|
3143
|
-
* phoneNumber: funcs.phoneNumber({template: "+(380) ###-####"})
|
|
3144
|
-
* },
|
|
3145
|
-
* },
|
|
3146
|
-
* }));
|
|
3147
|
-
*
|
|
3148
|
-
* //generate phone number using prefixes and generatedDigitsNumbers properties
|
|
3149
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3150
|
-
* users: {
|
|
3151
|
-
* columns: {
|
|
3152
|
-
* phoneNumber: funcs.phoneNumber({prefixes: [ "+380 99", "+380 67" ], generatedDigitsNumbers: 7})
|
|
3153
|
-
* },
|
|
3154
|
-
* },
|
|
3155
|
-
* }));
|
|
3156
|
-
*
|
|
3157
|
-
* //generate phone number using prefixes and generatedDigitsNumbers properties but with different generatedDigitsNumbers for prefixes
|
|
3158
|
-
* await seed(db, schema, { count: 1000 }).refine((funcs) => ({
|
|
3159
|
-
* users: {
|
|
3160
|
-
* columns: {
|
|
3161
|
-
* phoneNumber: funcs.phoneNumber({prefixes: [ "+380 99", "+380 67", "+1" ], generatedDigitsNumbers: [7, 7, 10]})
|
|
3162
|
-
* },
|
|
3163
|
-
* },
|
|
3164
|
-
* }));
|
|
3165
|
-
*
|
|
3166
|
-
* ```
|
|
3167
|
-
*/
|
|
3168
|
-
phoneNumber: (...args: [] | [import("./Generators.ts").GeneratePhoneNumberT]) => GeneratePhoneNumber;
|
|
2238
|
+
phoneNumber: (...args: [] | [import("./Generators.js").GeneratePhoneNumberT]) => GeneratePhoneNumber;
|
|
3169
2239
|
/**
|
|
3170
2240
|
* generates country's names.
|
|
3171
2241
|
* @param isUnique - property that controls if generated values gonna be unique or not.
|
|
@@ -3598,7 +2668,7 @@ export declare const generatorsMap: {
|
|
|
3598
2668
|
readonly GenerateUniqueInterval: readonly [typeof GenerateUniqueInterval, typeof GenerateUniqueIntervalV2];
|
|
3599
2669
|
readonly GenerateString: readonly [typeof GenerateString, typeof GenerateStringV2];
|
|
3600
2670
|
readonly GenerateUniqueString: readonly [typeof GenerateUniqueString, typeof GenerateUniqueStringV2];
|
|
3601
|
-
readonly GenerateUUID: readonly [typeof GenerateUUID
|
|
2671
|
+
readonly GenerateUUID: readonly [typeof GenerateUUID];
|
|
3602
2672
|
readonly GenerateFirstName: readonly [typeof GenerateFirstName];
|
|
3603
2673
|
readonly GenerateUniqueFirstName: readonly [typeof GenerateUniqueFirstName];
|
|
3604
2674
|
readonly GenerateLastName: readonly [typeof GenerateLastName];
|