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.
Files changed (77) hide show
  1. package/{services/SeedService.d.cts → SeedService.d.cts} +18 -26
  2. package/{services/SeedService.d.mts → SeedService.d.mts} +18 -26
  3. package/{services/SeedService.d.ts → SeedService.d.ts} +18 -26
  4. package/cockroach-core/index.d.cts +28 -0
  5. package/cockroach-core/index.d.mts +28 -0
  6. package/cockroach-core/index.d.ts +28 -0
  7. package/cockroach-core/selectGensForColumn.d.cts +3 -0
  8. package/cockroach-core/selectGensForColumn.d.mts +3 -0
  9. package/cockroach-core/selectGensForColumn.d.ts +3 -0
  10. package/common.d.cts +23 -0
  11. package/common.d.mts +23 -0
  12. package/common.d.ts +23 -0
  13. package/{services → generators}/GeneratorFuncs.d.cts +312 -59
  14. package/{services → generators}/GeneratorFuncs.d.mts +312 -59
  15. package/{services → generators}/GeneratorFuncs.d.ts +312 -59
  16. package/{services → generators}/Generators.d.cts +277 -54
  17. package/{services → generators}/Generators.d.mts +277 -54
  18. package/{services → generators}/Generators.d.ts +277 -54
  19. package/generators/utils.d.cts +38 -0
  20. package/generators/utils.d.mts +38 -0
  21. package/generators/utils.d.ts +38 -0
  22. package/{services → generators}/versioning/v2.d.cts +13 -6
  23. package/{services → generators}/versioning/v2.d.mts +13 -6
  24. package/{services → generators}/versioning/v2.d.ts +13 -6
  25. package/index.cjs +3156 -1472
  26. package/index.cjs.map +1 -1
  27. package/index.d.cts +92 -123
  28. package/index.d.mts +92 -123
  29. package/index.d.ts +92 -123
  30. package/index.mjs +3161 -1476
  31. package/index.mjs.map +1 -1
  32. package/mssql-core/index.d.cts +24 -0
  33. package/mssql-core/index.d.mts +24 -0
  34. package/mssql-core/index.d.ts +24 -0
  35. package/mssql-core/selectGensForColumn.d.cts +2 -0
  36. package/mssql-core/selectGensForColumn.d.mts +2 -0
  37. package/mssql-core/selectGensForColumn.d.ts +2 -0
  38. package/mysql-core/index.d.cts +28 -0
  39. package/mysql-core/index.d.mts +28 -0
  40. package/mysql-core/index.d.ts +28 -0
  41. package/mysql-core/selectGensForColumn.d.cts +2 -0
  42. package/mysql-core/selectGensForColumn.d.mts +2 -0
  43. package/mysql-core/selectGensForColumn.d.ts +2 -0
  44. package/package.json +13 -9
  45. package/pg-core/index.d.cts +28 -0
  46. package/pg-core/index.d.mts +28 -0
  47. package/pg-core/index.d.ts +28 -0
  48. package/pg-core/selectGensForColumn.d.cts +3 -0
  49. package/pg-core/selectGensForColumn.d.mts +3 -0
  50. package/pg-core/selectGensForColumn.d.ts +3 -0
  51. package/singlestore-core/index.d.cts +28 -0
  52. package/singlestore-core/index.d.mts +28 -0
  53. package/singlestore-core/index.d.ts +28 -0
  54. package/singlestore-core/selectGensForColumn.d.cts +2 -0
  55. package/singlestore-core/selectGensForColumn.d.mts +2 -0
  56. package/singlestore-core/selectGensForColumn.d.ts +2 -0
  57. package/sqlite-core/index.d.cts +28 -0
  58. package/sqlite-core/index.d.mts +28 -0
  59. package/sqlite-core/index.d.ts +28 -0
  60. package/sqlite-core/selectGensForColumn.d.cts +2 -0
  61. package/sqlite-core/selectGensForColumn.d.mts +2 -0
  62. package/sqlite-core/selectGensForColumn.d.ts +2 -0
  63. package/types/seedService.d.cts +12 -2
  64. package/types/seedService.d.mts +12 -2
  65. package/types/seedService.d.ts +12 -2
  66. package/types/tables.d.cts +20 -0
  67. package/types/tables.d.mts +20 -0
  68. package/types/tables.d.ts +20 -0
  69. package/utils.d.cts +4 -0
  70. package/utils.d.mts +4 -0
  71. package/utils.d.ts +4 -0
  72. package/services/utils.d.cts +0 -23
  73. package/services/utils.d.mts +0 -23
  74. package/services/utils.d.ts +0 -23
  75. /package/{services → generators}/apiVersion.d.cts +0 -0
  76. /package/{services → generators}/apiVersion.d.mts +0 -0
  77. /package/{services → generators}/apiVersion.d.ts +0 -0
@@ -1,5 +1,14 @@
1
- import type { AbstractGenerator } from '../services/Generators.js';
1
+ import type { CockroachDatabase, CockroachTable } from 'drizzle-orm/cockroach-core';
2
+ import type { MsSqlDatabase, MsSqlTable } from 'drizzle-orm/mssql-core';
3
+ import type { MySqlDatabase, MySqlTable } from 'drizzle-orm/mysql-core';
4
+ import type { PgDatabase, PgTable } from 'drizzle-orm/pg-core';
5
+ import type { SingleStoreDatabase, SingleStoreTable } from 'drizzle-orm/singlestore-core';
6
+ import type { BaseSQLiteDatabase, SQLiteTable } from 'drizzle-orm/sqlite-core';
7
+ import type { AbstractGenerator } from '../generators/Generators.js';
2
8
  import type { Prettify } from './tables.js';
9
+ export type GeneratedValueType = number | bigint | string | Buffer | boolean | undefined;
10
+ export type DbType = PgDatabase<any, any, any> | MySqlDatabase<any, any, any, any> | BaseSQLiteDatabase<any, any, any, any> | MsSqlDatabase<any, any, any, any> | CockroachDatabase<any, any, any> | SingleStoreDatabase<any, any, any, any>;
11
+ export type TableType = PgTable | MySqlTable | SQLiteTable | MsSqlTable | CockroachTable | SingleStoreTable;
3
12
  export type TableGeneratorsType = {
4
13
  [columnName: string]: Prettify<{
5
14
  hasSelfRelation?: boolean | undefined;
@@ -14,6 +23,7 @@ export type GeneratePossibleGeneratorsColumnType = {
14
23
  notNull: boolean;
15
24
  primary: boolean;
16
25
  generatedIdentityType?: 'always' | 'byDefault' | undefined;
26
+ identity?: boolean;
17
27
  wasRefined: boolean;
18
28
  wasDefinedBefore: boolean;
19
29
  isCyclic: boolean;
@@ -37,7 +47,7 @@ export type RefinementsType = Prettify<{
37
47
  [tableName: string]: {
38
48
  count?: number;
39
49
  columns: {
40
- [columnName: string]: AbstractGenerator<{}> | false;
50
+ [columnName: string]: AbstractGenerator<{}>;
41
51
  };
42
52
  with?: {
43
53
  [tableName: string]: number | {
@@ -1,5 +1,14 @@
1
- import type { AbstractGenerator } from '../services/Generators.js';
1
+ import type { CockroachDatabase, CockroachTable } from 'drizzle-orm/cockroach-core';
2
+ import type { MsSqlDatabase, MsSqlTable } from 'drizzle-orm/mssql-core';
3
+ import type { MySqlDatabase, MySqlTable } from 'drizzle-orm/mysql-core';
4
+ import type { PgDatabase, PgTable } from 'drizzle-orm/pg-core';
5
+ import type { SingleStoreDatabase, SingleStoreTable } from 'drizzle-orm/singlestore-core';
6
+ import type { BaseSQLiteDatabase, SQLiteTable } from 'drizzle-orm/sqlite-core';
7
+ import type { AbstractGenerator } from '../generators/Generators.js';
2
8
  import type { Prettify } from './tables.js';
9
+ export type GeneratedValueType = number | bigint | string | Buffer | boolean | undefined;
10
+ export type DbType = PgDatabase<any, any, any> | MySqlDatabase<any, any, any, any> | BaseSQLiteDatabase<any, any, any, any> | MsSqlDatabase<any, any, any, any> | CockroachDatabase<any, any, any> | SingleStoreDatabase<any, any, any, any>;
11
+ export type TableType = PgTable | MySqlTable | SQLiteTable | MsSqlTable | CockroachTable | SingleStoreTable;
3
12
  export type TableGeneratorsType = {
4
13
  [columnName: string]: Prettify<{
5
14
  hasSelfRelation?: boolean | undefined;
@@ -14,6 +23,7 @@ export type GeneratePossibleGeneratorsColumnType = {
14
23
  notNull: boolean;
15
24
  primary: boolean;
16
25
  generatedIdentityType?: 'always' | 'byDefault' | undefined;
26
+ identity?: boolean;
17
27
  wasRefined: boolean;
18
28
  wasDefinedBefore: boolean;
19
29
  isCyclic: boolean;
@@ -37,7 +47,7 @@ export type RefinementsType = Prettify<{
37
47
  [tableName: string]: {
38
48
  count?: number;
39
49
  columns: {
40
- [columnName: string]: AbstractGenerator<{}> | false;
50
+ [columnName: string]: AbstractGenerator<{}>;
41
51
  };
42
52
  with?: {
43
53
  [tableName: string]: number | {
@@ -1,3 +1,10 @@
1
+ import type { AnyColumn } from 'drizzle-orm';
2
+ import type { CockroachTable, ForeignKey as CockroachFK, UniqueConstraint as CockroachUniCon } from 'drizzle-orm/cockroach-core';
3
+ import type { ForeignKey as MsSqlFK, MsSqlTable, UniqueConstraint as MsSqlUniCon } from 'drizzle-orm/mssql-core';
4
+ import type { ForeignKey as MySqlFK, MySqlTable, UniqueConstraint as MySqlUniCon } from 'drizzle-orm/mysql-core';
5
+ import type { ForeignKey as PgFK, PgTable, UniqueConstraint as PgUniCon } from 'drizzle-orm/pg-core';
6
+ import type { SingleStoreTable, UniqueConstraint as SingleStoreUniCon } from 'drizzle-orm/singlestore-core';
7
+ import type { ForeignKey as SQLiteFK, SQLiteTable, UniqueConstraint as SQLiteUniCon } from 'drizzle-orm/sqlite-core';
1
8
  export type Column = {
2
9
  name: string;
3
10
  dataType: string;
@@ -7,6 +14,7 @@ export type Column = {
7
14
  scale?: number;
8
15
  length?: number;
9
16
  dimensions?: number;
17
+ vectorValueType?: 'I8' | 'I16' | 'I32' | 'I64' | 'F32' | 'F64';
10
18
  };
11
19
  size?: number;
12
20
  default?: any;
@@ -16,11 +24,13 @@ export type Column = {
16
24
  notNull: boolean;
17
25
  primary: boolean;
18
26
  generatedIdentityType?: 'always' | 'byDefault' | undefined;
27
+ identity?: boolean;
19
28
  baseColumn?: Omit<Column, 'generatedIdentityType'>;
20
29
  };
21
30
  export type Table = {
22
31
  name: string;
23
32
  columns: Column[];
33
+ uniqueConstraints: string[][];
24
34
  primaryKeys: string[];
25
35
  };
26
36
  export type Relation = {
@@ -37,3 +47,13 @@ export type RelationWithReferences = Relation & {
37
47
  export type Prettify<T> = {
38
48
  [K in keyof T]: T[K];
39
49
  } & {};
50
+ export type DrizzleTable = PgTable | MySqlTable | SQLiteTable | CockroachTable | MsSqlTable | SingleStoreTable;
51
+ export type DrizzleForeignKey = PgFK | MySqlFK | SQLiteFK | CockroachFK | MsSqlFK;
52
+ export type DrizzleUniqueConstraint = PgUniCon | MySqlUniCon | SQLiteUniCon | CockroachUniCon | MsSqlUniCon | SingleStoreUniCon;
53
+ export type TableConfigT = {
54
+ name: string;
55
+ schema?: string;
56
+ columns: AnyColumn[];
57
+ uniqueConstraints: DrizzleUniqueConstraint[];
58
+ foreignKeys?: DrizzleForeignKey[];
59
+ };
@@ -1,3 +1,10 @@
1
+ import type { AnyColumn } from 'drizzle-orm';
2
+ import type { CockroachTable, ForeignKey as CockroachFK, UniqueConstraint as CockroachUniCon } from 'drizzle-orm/cockroach-core';
3
+ import type { ForeignKey as MsSqlFK, MsSqlTable, UniqueConstraint as MsSqlUniCon } from 'drizzle-orm/mssql-core';
4
+ import type { ForeignKey as MySqlFK, MySqlTable, UniqueConstraint as MySqlUniCon } from 'drizzle-orm/mysql-core';
5
+ import type { ForeignKey as PgFK, PgTable, UniqueConstraint as PgUniCon } from 'drizzle-orm/pg-core';
6
+ import type { SingleStoreTable, UniqueConstraint as SingleStoreUniCon } from 'drizzle-orm/singlestore-core';
7
+ import type { ForeignKey as SQLiteFK, SQLiteTable, UniqueConstraint as SQLiteUniCon } from 'drizzle-orm/sqlite-core';
1
8
  export type Column = {
2
9
  name: string;
3
10
  dataType: string;
@@ -7,6 +14,7 @@ export type Column = {
7
14
  scale?: number;
8
15
  length?: number;
9
16
  dimensions?: number;
17
+ vectorValueType?: 'I8' | 'I16' | 'I32' | 'I64' | 'F32' | 'F64';
10
18
  };
11
19
  size?: number;
12
20
  default?: any;
@@ -16,11 +24,13 @@ export type Column = {
16
24
  notNull: boolean;
17
25
  primary: boolean;
18
26
  generatedIdentityType?: 'always' | 'byDefault' | undefined;
27
+ identity?: boolean;
19
28
  baseColumn?: Omit<Column, 'generatedIdentityType'>;
20
29
  };
21
30
  export type Table = {
22
31
  name: string;
23
32
  columns: Column[];
33
+ uniqueConstraints: string[][];
24
34
  primaryKeys: string[];
25
35
  };
26
36
  export type Relation = {
@@ -37,3 +47,13 @@ export type RelationWithReferences = Relation & {
37
47
  export type Prettify<T> = {
38
48
  [K in keyof T]: T[K];
39
49
  } & {};
50
+ export type DrizzleTable = PgTable | MySqlTable | SQLiteTable | CockroachTable | MsSqlTable | SingleStoreTable;
51
+ export type DrizzleForeignKey = PgFK | MySqlFK | SQLiteFK | CockroachFK | MsSqlFK;
52
+ export type DrizzleUniqueConstraint = PgUniCon | MySqlUniCon | SQLiteUniCon | CockroachUniCon | MsSqlUniCon | SingleStoreUniCon;
53
+ export type TableConfigT = {
54
+ name: string;
55
+ schema?: string;
56
+ columns: AnyColumn[];
57
+ uniqueConstraints: DrizzleUniqueConstraint[];
58
+ foreignKeys?: DrizzleForeignKey[];
59
+ };
package/types/tables.d.ts CHANGED
@@ -1,3 +1,10 @@
1
+ import type { AnyColumn } from 'drizzle-orm';
2
+ import type { CockroachTable, ForeignKey as CockroachFK, UniqueConstraint as CockroachUniCon } from 'drizzle-orm/cockroach-core';
3
+ import type { ForeignKey as MsSqlFK, MsSqlTable, UniqueConstraint as MsSqlUniCon } from 'drizzle-orm/mssql-core';
4
+ import type { ForeignKey as MySqlFK, MySqlTable, UniqueConstraint as MySqlUniCon } from 'drizzle-orm/mysql-core';
5
+ import type { ForeignKey as PgFK, PgTable, UniqueConstraint as PgUniCon } from 'drizzle-orm/pg-core';
6
+ import type { SingleStoreTable, UniqueConstraint as SingleStoreUniCon } from 'drizzle-orm/singlestore-core';
7
+ import type { ForeignKey as SQLiteFK, SQLiteTable, UniqueConstraint as SQLiteUniCon } from 'drizzle-orm/sqlite-core';
1
8
  export type Column = {
2
9
  name: string;
3
10
  dataType: string;
@@ -7,6 +14,7 @@ export type Column = {
7
14
  scale?: number;
8
15
  length?: number;
9
16
  dimensions?: number;
17
+ vectorValueType?: 'I8' | 'I16' | 'I32' | 'I64' | 'F32' | 'F64';
10
18
  };
11
19
  size?: number;
12
20
  default?: any;
@@ -16,11 +24,13 @@ export type Column = {
16
24
  notNull: boolean;
17
25
  primary: boolean;
18
26
  generatedIdentityType?: 'always' | 'byDefault' | undefined;
27
+ identity?: boolean;
19
28
  baseColumn?: Omit<Column, 'generatedIdentityType'>;
20
29
  };
21
30
  export type Table = {
22
31
  name: string;
23
32
  columns: Column[];
33
+ uniqueConstraints: string[][];
24
34
  primaryKeys: string[];
25
35
  };
26
36
  export type Relation = {
@@ -37,3 +47,13 @@ export type RelationWithReferences = Relation & {
37
47
  export type Prettify<T> = {
38
48
  [K in keyof T]: T[K];
39
49
  } & {};
50
+ export type DrizzleTable = PgTable | MySqlTable | SQLiteTable | CockroachTable | MsSqlTable | SingleStoreTable;
51
+ export type DrizzleForeignKey = PgFK | MySqlFK | SQLiteFK | CockroachFK | MsSqlFK;
52
+ export type DrizzleUniqueConstraint = PgUniCon | MySqlUniCon | SQLiteUniCon | CockroachUniCon | MsSqlUniCon | SingleStoreUniCon;
53
+ export type TableConfigT = {
54
+ name: string;
55
+ schema?: string;
56
+ columns: AnyColumn[];
57
+ uniqueConstraints: DrizzleUniqueConstraint[];
58
+ foreignKeys?: DrizzleForeignKey[];
59
+ };
package/utils.d.cts ADDED
@@ -0,0 +1,4 @@
1
+ import type { RelationWithReferences } from './types/tables';
2
+ export declare const isRelationCyclic: (startRel: RelationWithReferences) => boolean;
3
+ export declare const generateHashFromString: (s: string) => number;
4
+ export declare const equalSets: (set1: Set<any>, set2: Set<any>) => boolean;
package/utils.d.mts ADDED
@@ -0,0 +1,4 @@
1
+ import type { RelationWithReferences } from './types/tables';
2
+ export declare const isRelationCyclic: (startRel: RelationWithReferences) => boolean;
3
+ export declare const generateHashFromString: (s: string) => number;
4
+ export declare const equalSets: (set1: Set<any>, set2: Set<any>) => boolean;
package/utils.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ import type { RelationWithReferences } from './types/tables';
2
+ export declare const isRelationCyclic: (startRel: RelationWithReferences) => boolean;
3
+ export declare const generateHashFromString: (s: string) => number;
4
+ export declare const equalSets: (set1: Set<any>, set2: Set<any>) => boolean;
@@ -1,23 +0,0 @@
1
- export declare const fastCartesianProduct: (sets: (number | string | boolean | object)[][], index: number) => (string | number | boolean | object)[];
2
- /**
3
- * @param weights positive number in range [0, 1], that represents probabilities to choose index of array. Example: weights = [0.2, 0.8]
4
- * @param [accuracy=100] approximate number of elements in returning array
5
- * @returns Example: with weights = [0.2, 0.8] and accuracy = 10 returning array of indices gonna equal this: [0, 0, 1, 1, 1, 1, 1, 1, 1, 1]
6
- */
7
- export declare const getWeightedIndices: (weights: number[], accuracy?: number) => number[];
8
- export declare const generateHashFromString: (s: string) => number;
9
- /**
10
- * @param param0.template example: "#####" or "#####-####"
11
- * @param param0.values example: ["3", "2", "h"]
12
- * @param param0.defaultValue example: "0"
13
- * @returns
14
- */
15
- export declare const fillTemplate: ({ template, placeholdersCount, values, defaultValue }: {
16
- template: string;
17
- placeholdersCount?: number;
18
- values: string[];
19
- defaultValue?: string;
20
- }) => string;
21
- export declare const isObject: (value: any) => boolean;
22
- export declare const equalSets: (set1: Set<any>, set2: Set<any>) => boolean;
23
- export declare const isValidDate: (date: Date) => boolean;
@@ -1,23 +0,0 @@
1
- export declare const fastCartesianProduct: (sets: (number | string | boolean | object)[][], index: number) => (string | number | boolean | object)[];
2
- /**
3
- * @param weights positive number in range [0, 1], that represents probabilities to choose index of array. Example: weights = [0.2, 0.8]
4
- * @param [accuracy=100] approximate number of elements in returning array
5
- * @returns Example: with weights = [0.2, 0.8] and accuracy = 10 returning array of indices gonna equal this: [0, 0, 1, 1, 1, 1, 1, 1, 1, 1]
6
- */
7
- export declare const getWeightedIndices: (weights: number[], accuracy?: number) => number[];
8
- export declare const generateHashFromString: (s: string) => number;
9
- /**
10
- * @param param0.template example: "#####" or "#####-####"
11
- * @param param0.values example: ["3", "2", "h"]
12
- * @param param0.defaultValue example: "0"
13
- * @returns
14
- */
15
- export declare const fillTemplate: ({ template, placeholdersCount, values, defaultValue }: {
16
- template: string;
17
- placeholdersCount?: number;
18
- values: string[];
19
- defaultValue?: string;
20
- }) => string;
21
- export declare const isObject: (value: any) => boolean;
22
- export declare const equalSets: (set1: Set<any>, set2: Set<any>) => boolean;
23
- export declare const isValidDate: (date: Date) => boolean;
@@ -1,23 +0,0 @@
1
- export declare const fastCartesianProduct: (sets: (number | string | boolean | object)[][], index: number) => (string | number | boolean | object)[];
2
- /**
3
- * @param weights positive number in range [0, 1], that represents probabilities to choose index of array. Example: weights = [0.2, 0.8]
4
- * @param [accuracy=100] approximate number of elements in returning array
5
- * @returns Example: with weights = [0.2, 0.8] and accuracy = 10 returning array of indices gonna equal this: [0, 0, 1, 1, 1, 1, 1, 1, 1, 1]
6
- */
7
- export declare const getWeightedIndices: (weights: number[], accuracy?: number) => number[];
8
- export declare const generateHashFromString: (s: string) => number;
9
- /**
10
- * @param param0.template example: "#####" or "#####-####"
11
- * @param param0.values example: ["3", "2", "h"]
12
- * @param param0.defaultValue example: "0"
13
- * @returns
14
- */
15
- export declare const fillTemplate: ({ template, placeholdersCount, values, defaultValue }: {
16
- template: string;
17
- placeholdersCount?: number;
18
- values: string[];
19
- defaultValue?: string;
20
- }) => string;
21
- export declare const isObject: (value: any) => boolean;
22
- export declare const equalSets: (set1: Set<any>, set2: Set<any>) => boolean;
23
- export declare const isValidDate: (date: Date) => boolean;
File without changes
File without changes
File without changes