drizzle-seed 0.3.2-b5a9650 → 0.4.0-aca84cf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{services/SeedService.d.cts → SeedService.d.cts} +18 -35
- package/{services/SeedService.d.mts → SeedService.d.mts} +18 -35
- package/{services/SeedService.d.ts → SeedService.d.ts} +18 -35
- 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 +2800 -1060
- 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 -1072
- 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 +6 -2
- 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 -27
- package/services/utils.d.mts +0 -27
- package/services/utils.d.ts +0 -27
- /package/{services → generators}/apiVersion.d.cts +0 -0
- /package/{services → generators}/apiVersion.d.mts +0 -0
- /package/{services → generators}/apiVersion.d.ts +0 -0
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import { PgDatabase } from 'drizzle-orm/pg-core';
|
|
5
|
-
import type { SQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
6
|
-
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
7
|
-
import type { GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType } from '../types/seedService.js';
|
|
8
|
-
import type { Column, Prettify, Relation, Table } from '../types/tables.js';
|
|
9
|
-
import type { AbstractGenerator, GenerateArray, GenerateInterval } from './Generators.js';
|
|
1
|
+
import type { AbstractGenerator } from './generators/Generators.js';
|
|
2
|
+
import type { DbType, GeneratedValueType, GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType, TableType } from './types/seedService.js';
|
|
3
|
+
import type { Prettify, Relation, Table } from './types/tables.js';
|
|
10
4
|
export declare class SeedService {
|
|
11
5
|
static readonly entityKind: string;
|
|
12
6
|
private defaultCountForTable;
|
|
@@ -14,8 +8,9 @@ export declare class SeedService {
|
|
|
14
8
|
private postgresMaxParametersNumber;
|
|
15
9
|
private mysqlMaxParametersNumber;
|
|
16
10
|
private sqliteMaxParametersNumber;
|
|
11
|
+
private mssqlMaxParametersNumber;
|
|
17
12
|
private version?;
|
|
18
|
-
generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite", tables: Table[], relations: (Relation & {
|
|
13
|
+
generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
|
|
19
14
|
isCyclic: boolean;
|
|
20
15
|
})[], refinements?: RefinementsType, options?: {
|
|
21
16
|
count?: number;
|
|
@@ -61,9 +56,6 @@ export declare class SeedService {
|
|
|
61
56
|
weight: number;
|
|
62
57
|
count: number | number[];
|
|
63
58
|
}[], count: number, seed: number) => number;
|
|
64
|
-
selectGeneratorForPostgresColumn: (table: Table, col: Column) => GenerateArray | import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | GenerateInterval | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | import("./Generators.js").GenerateUUID | import("./Generators.js").GeneratePoint | import("./Generators.js").GenerateLine | undefined;
|
|
65
|
-
selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateDatetime | import("./Generators.js").GenerateYear | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
|
|
66
|
-
selectGeneratorForSqlite: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
|
|
67
59
|
filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
|
|
68
60
|
filteredTablesGenerators: {
|
|
69
61
|
tableName: string;
|
|
@@ -88,8 +80,8 @@ export declare class SeedService {
|
|
|
88
80
|
};
|
|
89
81
|
generateTablesValues: (relations: (Relation & {
|
|
90
82
|
isCyclic: boolean;
|
|
91
|
-
})[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?:
|
|
92
|
-
[key: string]:
|
|
83
|
+
})[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
|
|
84
|
+
[key: string]: TableType;
|
|
93
85
|
}, options?: {
|
|
94
86
|
count?: number;
|
|
95
87
|
seed?: number;
|
|
@@ -100,7 +92,7 @@ export declare class SeedService {
|
|
|
100
92
|
tablesValues?: {
|
|
101
93
|
tableName: string;
|
|
102
94
|
rows: {
|
|
103
|
-
[columnName: string]:
|
|
95
|
+
[columnName: string]: GeneratedValueType;
|
|
104
96
|
}[];
|
|
105
97
|
}[];
|
|
106
98
|
tablesUniqueNotNullColumn?: {
|
|
@@ -111,14 +103,14 @@ export declare class SeedService {
|
|
|
111
103
|
}) => Promise<{
|
|
112
104
|
tableName: string;
|
|
113
105
|
rows: {
|
|
114
|
-
[columnName: string]:
|
|
106
|
+
[columnName: string]: GeneratedValueType;
|
|
115
107
|
}[];
|
|
116
108
|
}[]>;
|
|
117
109
|
generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
|
|
118
110
|
tableGenerators: Prettify<TableGeneratorsType>;
|
|
119
|
-
db?:
|
|
111
|
+
db?: DbType;
|
|
120
112
|
schema?: {
|
|
121
|
-
[key: string]:
|
|
113
|
+
[key: string]: TableType;
|
|
122
114
|
};
|
|
123
115
|
tableName?: string;
|
|
124
116
|
count?: number;
|
|
@@ -128,35 +120,26 @@ export declare class SeedService {
|
|
|
128
120
|
uniqueNotNullColName?: string;
|
|
129
121
|
batchSize?: number;
|
|
130
122
|
}) => Promise<{
|
|
131
|
-
[columnName: string]:
|
|
123
|
+
[columnName: string]: GeneratedValueType;
|
|
132
124
|
}[]>;
|
|
133
|
-
updateColumnSequence: ({ db, columnConfig: { schemaName, tableName, columnName, valueToUpdate } }: {
|
|
134
|
-
db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
|
|
135
|
-
columnConfig: {
|
|
136
|
-
schemaName?: string;
|
|
137
|
-
tableName: string;
|
|
138
|
-
columnName: string;
|
|
139
|
-
valueToUpdate?: number | bigint;
|
|
140
|
-
};
|
|
141
|
-
}) => Promise<void>;
|
|
142
125
|
insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
|
|
143
126
|
generatedValues: {
|
|
144
|
-
[columnName: string]:
|
|
127
|
+
[columnName: string]: GeneratedValueType;
|
|
145
128
|
}[];
|
|
146
|
-
db:
|
|
129
|
+
db: DbType;
|
|
147
130
|
schema: {
|
|
148
|
-
[key: string]:
|
|
131
|
+
[key: string]: TableType;
|
|
149
132
|
};
|
|
150
133
|
tableName: string;
|
|
151
134
|
override: boolean;
|
|
152
135
|
}) => Promise<any>;
|
|
153
136
|
updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
|
|
154
137
|
generatedValues: {
|
|
155
|
-
[columnName: string]:
|
|
138
|
+
[columnName: string]: GeneratedValueType;
|
|
156
139
|
}[];
|
|
157
|
-
db:
|
|
140
|
+
db: DbType;
|
|
158
141
|
schema: {
|
|
159
|
-
[key: string]:
|
|
142
|
+
[key: string]: TableType;
|
|
160
143
|
};
|
|
161
144
|
tableName: string;
|
|
162
145
|
uniqueNotNullColName: string;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import { PgDatabase } from 'drizzle-orm/pg-core';
|
|
5
|
-
import type { SQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
6
|
-
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
7
|
-
import type { GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType } from '../types/seedService.js';
|
|
8
|
-
import type { Column, Prettify, Relation, Table } from '../types/tables.js';
|
|
9
|
-
import type { AbstractGenerator, GenerateArray, GenerateInterval } from './Generators.js';
|
|
1
|
+
import type { AbstractGenerator } from './generators/Generators.js';
|
|
2
|
+
import type { DbType, GeneratedValueType, GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType, TableType } from './types/seedService.js';
|
|
3
|
+
import type { Prettify, Relation, Table } from './types/tables.js';
|
|
10
4
|
export declare class SeedService {
|
|
11
5
|
static readonly entityKind: string;
|
|
12
6
|
private defaultCountForTable;
|
|
@@ -14,8 +8,9 @@ export declare class SeedService {
|
|
|
14
8
|
private postgresMaxParametersNumber;
|
|
15
9
|
private mysqlMaxParametersNumber;
|
|
16
10
|
private sqliteMaxParametersNumber;
|
|
11
|
+
private mssqlMaxParametersNumber;
|
|
17
12
|
private version?;
|
|
18
|
-
generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite", tables: Table[], relations: (Relation & {
|
|
13
|
+
generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
|
|
19
14
|
isCyclic: boolean;
|
|
20
15
|
})[], refinements?: RefinementsType, options?: {
|
|
21
16
|
count?: number;
|
|
@@ -61,9 +56,6 @@ export declare class SeedService {
|
|
|
61
56
|
weight: number;
|
|
62
57
|
count: number | number[];
|
|
63
58
|
}[], count: number, seed: number) => number;
|
|
64
|
-
selectGeneratorForPostgresColumn: (table: Table, col: Column) => GenerateArray | import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | GenerateInterval | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | import("./Generators.js").GenerateUUID | import("./Generators.js").GeneratePoint | import("./Generators.js").GenerateLine | undefined;
|
|
65
|
-
selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateDatetime | import("./Generators.js").GenerateYear | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
|
|
66
|
-
selectGeneratorForSqlite: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
|
|
67
59
|
filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
|
|
68
60
|
filteredTablesGenerators: {
|
|
69
61
|
tableName: string;
|
|
@@ -88,8 +80,8 @@ export declare class SeedService {
|
|
|
88
80
|
};
|
|
89
81
|
generateTablesValues: (relations: (Relation & {
|
|
90
82
|
isCyclic: boolean;
|
|
91
|
-
})[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?:
|
|
92
|
-
[key: string]:
|
|
83
|
+
})[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
|
|
84
|
+
[key: string]: TableType;
|
|
93
85
|
}, options?: {
|
|
94
86
|
count?: number;
|
|
95
87
|
seed?: number;
|
|
@@ -100,7 +92,7 @@ export declare class SeedService {
|
|
|
100
92
|
tablesValues?: {
|
|
101
93
|
tableName: string;
|
|
102
94
|
rows: {
|
|
103
|
-
[columnName: string]:
|
|
95
|
+
[columnName: string]: GeneratedValueType;
|
|
104
96
|
}[];
|
|
105
97
|
}[];
|
|
106
98
|
tablesUniqueNotNullColumn?: {
|
|
@@ -111,14 +103,14 @@ export declare class SeedService {
|
|
|
111
103
|
}) => Promise<{
|
|
112
104
|
tableName: string;
|
|
113
105
|
rows: {
|
|
114
|
-
[columnName: string]:
|
|
106
|
+
[columnName: string]: GeneratedValueType;
|
|
115
107
|
}[];
|
|
116
108
|
}[]>;
|
|
117
109
|
generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
|
|
118
110
|
tableGenerators: Prettify<TableGeneratorsType>;
|
|
119
|
-
db?:
|
|
111
|
+
db?: DbType;
|
|
120
112
|
schema?: {
|
|
121
|
-
[key: string]:
|
|
113
|
+
[key: string]: TableType;
|
|
122
114
|
};
|
|
123
115
|
tableName?: string;
|
|
124
116
|
count?: number;
|
|
@@ -128,35 +120,26 @@ export declare class SeedService {
|
|
|
128
120
|
uniqueNotNullColName?: string;
|
|
129
121
|
batchSize?: number;
|
|
130
122
|
}) => Promise<{
|
|
131
|
-
[columnName: string]:
|
|
123
|
+
[columnName: string]: GeneratedValueType;
|
|
132
124
|
}[]>;
|
|
133
|
-
updateColumnSequence: ({ db, columnConfig: { schemaName, tableName, columnName, valueToUpdate } }: {
|
|
134
|
-
db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
|
|
135
|
-
columnConfig: {
|
|
136
|
-
schemaName?: string;
|
|
137
|
-
tableName: string;
|
|
138
|
-
columnName: string;
|
|
139
|
-
valueToUpdate?: number | bigint;
|
|
140
|
-
};
|
|
141
|
-
}) => Promise<void>;
|
|
142
125
|
insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
|
|
143
126
|
generatedValues: {
|
|
144
|
-
[columnName: string]:
|
|
127
|
+
[columnName: string]: GeneratedValueType;
|
|
145
128
|
}[];
|
|
146
|
-
db:
|
|
129
|
+
db: DbType;
|
|
147
130
|
schema: {
|
|
148
|
-
[key: string]:
|
|
131
|
+
[key: string]: TableType;
|
|
149
132
|
};
|
|
150
133
|
tableName: string;
|
|
151
134
|
override: boolean;
|
|
152
135
|
}) => Promise<any>;
|
|
153
136
|
updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
|
|
154
137
|
generatedValues: {
|
|
155
|
-
[columnName: string]:
|
|
138
|
+
[columnName: string]: GeneratedValueType;
|
|
156
139
|
}[];
|
|
157
|
-
db:
|
|
140
|
+
db: DbType;
|
|
158
141
|
schema: {
|
|
159
|
-
[key: string]:
|
|
142
|
+
[key: string]: TableType;
|
|
160
143
|
};
|
|
161
144
|
tableName: string;
|
|
162
145
|
uniqueNotNullColName: string;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
4
|
-
import { PgDatabase } from 'drizzle-orm/pg-core';
|
|
5
|
-
import type { SQLiteTable } from 'drizzle-orm/sqlite-core';
|
|
6
|
-
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
7
|
-
import type { GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType } from '../types/seedService.js';
|
|
8
|
-
import type { Column, Prettify, Relation, Table } from '../types/tables.js';
|
|
9
|
-
import type { AbstractGenerator, GenerateArray, GenerateInterval } from './Generators.js';
|
|
1
|
+
import type { AbstractGenerator } from './generators/Generators.js';
|
|
2
|
+
import type { DbType, GeneratedValueType, GeneratePossibleGeneratorsColumnType, RefinementsType, TableGeneratorsType, TableType } from './types/seedService.js';
|
|
3
|
+
import type { Prettify, Relation, Table } from './types/tables.js';
|
|
10
4
|
export declare class SeedService {
|
|
11
5
|
static readonly entityKind: string;
|
|
12
6
|
private defaultCountForTable;
|
|
@@ -14,8 +8,9 @@ export declare class SeedService {
|
|
|
14
8
|
private postgresMaxParametersNumber;
|
|
15
9
|
private mysqlMaxParametersNumber;
|
|
16
10
|
private sqliteMaxParametersNumber;
|
|
11
|
+
private mssqlMaxParametersNumber;
|
|
17
12
|
private version?;
|
|
18
|
-
generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite", tables: Table[], relations: (Relation & {
|
|
13
|
+
generatePossibleGenerators: (connectionType: "postgresql" | "mysql" | "sqlite" | "mssql" | "cockroach" | "singlestore", tables: Table[], relations: (Relation & {
|
|
19
14
|
isCyclic: boolean;
|
|
20
15
|
})[], refinements?: RefinementsType, options?: {
|
|
21
16
|
count?: number;
|
|
@@ -61,9 +56,6 @@ export declare class SeedService {
|
|
|
61
56
|
weight: number;
|
|
62
57
|
count: number | number[];
|
|
63
58
|
}[], count: number, seed: number) => number;
|
|
64
|
-
selectGeneratorForPostgresColumn: (table: Table, col: Column) => GenerateArray | import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | GenerateInterval | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | import("./Generators.js").GenerateUUID | import("./Generators.js").GeneratePoint | import("./Generators.js").GenerateLine | undefined;
|
|
65
|
-
selectGeneratorForMysqlColumn: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateDate | import("./Generators.js").GenerateTime | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateDatetime | import("./Generators.js").GenerateYear | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateEnum | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
|
|
66
|
-
selectGeneratorForSqlite: (table: Table, col: Column) => import("./Generators.js").GenerateDefault | import("./Generators.js").GenerateIntPrimaryKey | import("./Generators.js").GenerateNumber | import("./Generators.js").GenerateInt | import("./Generators.js").GenerateBoolean | import("./Generators.js").GenerateTimestamp | import("./Generators.js").GenerateJson | import("./Generators.js").GenerateEmail | import("./Generators.js").GenerateFirstName | import("./Generators.js").GenerateString | import("./Generators.js").GenerateUniqueString | undefined;
|
|
67
59
|
filterCyclicTables: (tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>) => {
|
|
68
60
|
filteredTablesGenerators: {
|
|
69
61
|
tableName: string;
|
|
@@ -88,8 +80,8 @@ export declare class SeedService {
|
|
|
88
80
|
};
|
|
89
81
|
generateTablesValues: (relations: (Relation & {
|
|
90
82
|
isCyclic: boolean;
|
|
91
|
-
})[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?:
|
|
92
|
-
[key: string]:
|
|
83
|
+
})[], tablesGenerators: ReturnType<typeof this.generatePossibleGenerators>, db?: DbType, schema?: {
|
|
84
|
+
[key: string]: TableType;
|
|
93
85
|
}, options?: {
|
|
94
86
|
count?: number;
|
|
95
87
|
seed?: number;
|
|
@@ -100,7 +92,7 @@ export declare class SeedService {
|
|
|
100
92
|
tablesValues?: {
|
|
101
93
|
tableName: string;
|
|
102
94
|
rows: {
|
|
103
|
-
[columnName: string]:
|
|
95
|
+
[columnName: string]: GeneratedValueType;
|
|
104
96
|
}[];
|
|
105
97
|
}[];
|
|
106
98
|
tablesUniqueNotNullColumn?: {
|
|
@@ -111,14 +103,14 @@ export declare class SeedService {
|
|
|
111
103
|
}) => Promise<{
|
|
112
104
|
tableName: string;
|
|
113
105
|
rows: {
|
|
114
|
-
[columnName: string]:
|
|
106
|
+
[columnName: string]: GeneratedValueType;
|
|
115
107
|
}[];
|
|
116
108
|
}[]>;
|
|
117
109
|
generateColumnsValuesByGenerators: ({ tableGenerators, db, schema, tableName, count, preserveData, insertDataInDb, updateDataInDb, uniqueNotNullColName, batchSize, }: {
|
|
118
110
|
tableGenerators: Prettify<TableGeneratorsType>;
|
|
119
|
-
db?:
|
|
111
|
+
db?: DbType;
|
|
120
112
|
schema?: {
|
|
121
|
-
[key: string]:
|
|
113
|
+
[key: string]: TableType;
|
|
122
114
|
};
|
|
123
115
|
tableName?: string;
|
|
124
116
|
count?: number;
|
|
@@ -128,35 +120,26 @@ export declare class SeedService {
|
|
|
128
120
|
uniqueNotNullColName?: string;
|
|
129
121
|
batchSize?: number;
|
|
130
122
|
}) => Promise<{
|
|
131
|
-
[columnName: string]:
|
|
123
|
+
[columnName: string]: GeneratedValueType;
|
|
132
124
|
}[]>;
|
|
133
|
-
updateColumnSequence: ({ db, columnConfig: { schemaName, tableName, columnName, valueToUpdate } }: {
|
|
134
|
-
db: PgDatabase<any, any> | MySqlDatabase<any, any> | BaseSQLiteDatabase<any, any>;
|
|
135
|
-
columnConfig: {
|
|
136
|
-
schemaName?: string;
|
|
137
|
-
tableName: string;
|
|
138
|
-
columnName: string;
|
|
139
|
-
valueToUpdate?: number | bigint;
|
|
140
|
-
};
|
|
141
|
-
}) => Promise<void>;
|
|
142
125
|
insertInDb: ({ generatedValues, db, schema, tableName, override, }: {
|
|
143
126
|
generatedValues: {
|
|
144
|
-
[columnName: string]:
|
|
127
|
+
[columnName: string]: GeneratedValueType;
|
|
145
128
|
}[];
|
|
146
|
-
db:
|
|
129
|
+
db: DbType;
|
|
147
130
|
schema: {
|
|
148
|
-
[key: string]:
|
|
131
|
+
[key: string]: TableType;
|
|
149
132
|
};
|
|
150
133
|
tableName: string;
|
|
151
134
|
override: boolean;
|
|
152
135
|
}) => Promise<any>;
|
|
153
136
|
updateDb: ({ generatedValues, db, schema, tableName, uniqueNotNullColName, }: {
|
|
154
137
|
generatedValues: {
|
|
155
|
-
[columnName: string]:
|
|
138
|
+
[columnName: string]: GeneratedValueType;
|
|
156
139
|
}[];
|
|
157
|
-
db:
|
|
140
|
+
db: DbType;
|
|
158
141
|
schema: {
|
|
159
|
-
[key: string]:
|
|
142
|
+
[key: string]: TableType;
|
|
160
143
|
};
|
|
161
144
|
tableName: string;
|
|
162
145
|
uniqueNotNullColName: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Relations } from 'drizzle-orm';
|
|
2
|
+
import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
|
|
3
|
+
import { CockroachTable } from 'drizzle-orm/cockroach-core';
|
|
4
|
+
import type { RefinementsType } from '../types/seedService.js';
|
|
5
|
+
export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
|
|
6
|
+
[key: string]: CockroachTable;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
export declare const filterCockroachSchema: (schema: {
|
|
9
|
+
[key: string]: CockroachTable | CockroachSchema | Relations | any;
|
|
10
|
+
}) => {
|
|
11
|
+
cockroachSchema: {
|
|
12
|
+
[k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
|
|
13
|
+
};
|
|
14
|
+
cockroachTables: {
|
|
15
|
+
[k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
|
|
19
|
+
[key: string]: CockroachTable | CockroachSchema | Relations | any;
|
|
20
|
+
}, options?: {
|
|
21
|
+
count?: number;
|
|
22
|
+
seed?: number;
|
|
23
|
+
version?: number;
|
|
24
|
+
}, refinements?: RefinementsType) => Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Relations } from 'drizzle-orm';
|
|
2
|
+
import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
|
|
3
|
+
import { CockroachTable } from 'drizzle-orm/cockroach-core';
|
|
4
|
+
import type { RefinementsType } from '../types/seedService.js';
|
|
5
|
+
export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
|
|
6
|
+
[key: string]: CockroachTable;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
export declare const filterCockroachSchema: (schema: {
|
|
9
|
+
[key: string]: CockroachTable | CockroachSchema | Relations | any;
|
|
10
|
+
}) => {
|
|
11
|
+
cockroachSchema: {
|
|
12
|
+
[k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
|
|
13
|
+
};
|
|
14
|
+
cockroachTables: {
|
|
15
|
+
[k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
|
|
19
|
+
[key: string]: CockroachTable | CockroachSchema | Relations | any;
|
|
20
|
+
}, options?: {
|
|
21
|
+
count?: number;
|
|
22
|
+
seed?: number;
|
|
23
|
+
version?: number;
|
|
24
|
+
}, refinements?: RefinementsType) => Promise<void>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Relations } from 'drizzle-orm';
|
|
2
|
+
import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
|
|
3
|
+
import { CockroachTable } from 'drizzle-orm/cockroach-core';
|
|
4
|
+
import type { RefinementsType } from '../types/seedService.js';
|
|
5
|
+
export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
|
|
6
|
+
[key: string]: CockroachTable;
|
|
7
|
+
}) => Promise<void>;
|
|
8
|
+
export declare const filterCockroachSchema: (schema: {
|
|
9
|
+
[key: string]: CockroachTable | CockroachSchema | Relations | any;
|
|
10
|
+
}) => {
|
|
11
|
+
cockroachSchema: {
|
|
12
|
+
[k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
|
|
13
|
+
};
|
|
14
|
+
cockroachTables: {
|
|
15
|
+
[k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
|
|
19
|
+
[key: string]: CockroachTable | CockroachSchema | Relations | any;
|
|
20
|
+
}, options?: {
|
|
21
|
+
count?: number;
|
|
22
|
+
seed?: number;
|
|
23
|
+
version?: number;
|
|
24
|
+
}, refinements?: RefinementsType) => Promise<void>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { GenerateInterval } from '../generators/Generators.js';
|
|
2
|
+
import type { Column, Table } from '../types/tables.js';
|
|
3
|
+
export declare const selectGeneratorForCockroachColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateArray | import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | GenerateInterval | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | import("../generators/Generators.js").GenerateUUID | import("../generators/Generators.js").GenerateBitString | import("../generators/Generators.js").GenerateInet | import("../generators/Generators.js").GenerateGeometry | import("../generators/Generators.js").GenerateVector | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { GenerateInterval } from '../generators/Generators.js';
|
|
2
|
+
import type { Column, Table } from '../types/tables.js';
|
|
3
|
+
export declare const selectGeneratorForCockroachColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateArray | import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | GenerateInterval | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | import("../generators/Generators.js").GenerateUUID | import("../generators/Generators.js").GenerateBitString | import("../generators/Generators.js").GenerateInet | import("../generators/Generators.js").GenerateGeometry | import("../generators/Generators.js").GenerateVector | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { GenerateInterval } from '../generators/Generators.js';
|
|
2
|
+
import type { Column, Table } from '../types/tables.js';
|
|
3
|
+
export declare const selectGeneratorForCockroachColumn: (table: Table, col: Column) => import("../generators/Generators.js").GenerateArray | import("../generators/Generators.js").GenerateDefault | import("../generators/Generators.js").GenerateIntPrimaryKey | import("../generators/Generators.js").GenerateNumber | import("../generators/Generators.js").GenerateInt | import("../generators/Generators.js").GenerateBoolean | import("../generators/Generators.js").GenerateDate | import("../generators/Generators.js").GenerateTime | import("../generators/Generators.js").GenerateTimestamp | import("../generators/Generators.js").GenerateJson | import("../generators/Generators.js").GenerateEmail | import("../generators/Generators.js").GenerateFirstName | import("../generators/Generators.js").GenerateEnum | GenerateInterval | import("../generators/Generators.js").GenerateString | import("../generators/Generators.js").GenerateUniqueString | import("../generators/Generators.js").GenerateUUID | import("../generators/Generators.js").GenerateBitString | import("../generators/Generators.js").GenerateInet | import("../generators/Generators.js").GenerateGeometry | import("../generators/Generators.js").GenerateVector | undefined;
|