drizzle-seed 0.4.0-08bb2d5 → 0.4.0-4ec2def

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.
@@ -1,7 +1,8 @@
1
- import { Relations } from 'drizzle-orm';
1
+ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
3
3
  import { CockroachTable } from 'drizzle-orm/cockroach-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Table, TableConfigT } from '../types/tables.js';
5
6
  export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
6
7
  [key: string]: CockroachTable;
7
8
  }) => Promise<void>;
@@ -9,7 +10,7 @@ export declare const filterCockroachSchema: (schema: {
9
10
  [key: string]: CockroachTable | CockroachSchema | Relations | any;
10
11
  }) => {
11
12
  cockroachSchema: {
12
- [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
13
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
13
14
  };
14
15
  cockroachTables: {
15
16
  [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
@@ -22,3 +23,8 @@ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
22
23
  seed?: number;
23
24
  version?: number;
24
25
  }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapCockroachTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
27
+ [key: string]: string;
28
+ }, dbToTsColumnNamesMap: {
29
+ [key: string]: string;
30
+ }) => Table;
@@ -1,7 +1,8 @@
1
- import { Relations } from 'drizzle-orm';
1
+ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
3
3
  import { CockroachTable } from 'drizzle-orm/cockroach-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Table, TableConfigT } from '../types/tables.js';
5
6
  export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
6
7
  [key: string]: CockroachTable;
7
8
  }) => Promise<void>;
@@ -9,7 +10,7 @@ export declare const filterCockroachSchema: (schema: {
9
10
  [key: string]: CockroachTable | CockroachSchema | Relations | any;
10
11
  }) => {
11
12
  cockroachSchema: {
12
- [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
13
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
13
14
  };
14
15
  cockroachTables: {
15
16
  [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
@@ -22,3 +23,8 @@ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
22
23
  seed?: number;
23
24
  version?: number;
24
25
  }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapCockroachTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
27
+ [key: string]: string;
28
+ }, dbToTsColumnNamesMap: {
29
+ [key: string]: string;
30
+ }) => Table;
@@ -1,7 +1,8 @@
1
- import { Relations } from 'drizzle-orm';
1
+ import { Relations } from 'drizzle-orm/_relations';
2
2
  import type { CockroachDatabase, CockroachSchema } from 'drizzle-orm/cockroach-core';
3
3
  import { CockroachTable } from 'drizzle-orm/cockroach-core';
4
4
  import type { RefinementsType } from '../types/seedService.js';
5
+ import type { Table, TableConfigT } from '../types/tables.js';
5
6
  export declare const resetCockroach: (db: CockroachDatabase<any, any>, cockroachTables: {
6
7
  [key: string]: CockroachTable;
7
8
  }) => Promise<void>;
@@ -9,7 +10,7 @@ export declare const filterCockroachSchema: (schema: {
9
10
  [key: string]: CockroachTable | CockroachSchema | Relations | any;
10
11
  }) => {
11
12
  cockroachSchema: {
12
- [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm").Relation<string>>>;
13
+ [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig> | Relations<string, Record<string, import("drizzle-orm/_relations").Relation<string>>>;
13
14
  };
14
15
  cockroachTables: {
15
16
  [k: string]: CockroachTable<import("drizzle-orm/cockroach-core").TableConfig>;
@@ -22,3 +23,8 @@ export declare const seedCockroach: (db: CockroachDatabase<any, any>, schema: {
22
23
  seed?: number;
23
24
  version?: number;
24
25
  }, refinements?: RefinementsType) => Promise<void>;
26
+ export declare const mapCockroachTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
27
+ [key: string]: string;
28
+ }, dbToTsColumnNamesMap: {
29
+ [key: string]: string;
30
+ }) => Table;
package/common.d.cts ADDED
@@ -0,0 +1,25 @@
1
+ import { type Relations } from 'drizzle-orm/_relations';
2
+ import type { DrizzleTable, RelationWithReferences, Table, TableConfigT } from './types/tables.js';
3
+ export declare const getSchemaInfo: (drizzleTablesAndRelations: {
4
+ [key: string]: DrizzleTable | Relations;
5
+ }, drizzleTables: {
6
+ [key: string]: DrizzleTable;
7
+ }, mapTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
8
+ [key: string]: string;
9
+ }, dbToTsColumnNamesMap: {
10
+ [key: string]: string;
11
+ }) => Table) => {
12
+ tables: Table[];
13
+ relations: {
14
+ isCyclic: boolean;
15
+ type?: "one" | "many";
16
+ table: string;
17
+ columns: string[];
18
+ refTable: string;
19
+ refColumns: string[];
20
+ refTableRels: RelationWithReferences[];
21
+ }[];
22
+ tableRelations: {
23
+ [tableName: string]: RelationWithReferences[];
24
+ };
25
+ };
package/common.d.mts ADDED
@@ -0,0 +1,25 @@
1
+ import { type Relations } from 'drizzle-orm/_relations';
2
+ import type { DrizzleTable, RelationWithReferences, Table, TableConfigT } from './types/tables.js';
3
+ export declare const getSchemaInfo: (drizzleTablesAndRelations: {
4
+ [key: string]: DrizzleTable | Relations;
5
+ }, drizzleTables: {
6
+ [key: string]: DrizzleTable;
7
+ }, mapTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
8
+ [key: string]: string;
9
+ }, dbToTsColumnNamesMap: {
10
+ [key: string]: string;
11
+ }) => Table) => {
12
+ tables: Table[];
13
+ relations: {
14
+ isCyclic: boolean;
15
+ type?: "one" | "many";
16
+ table: string;
17
+ columns: string[];
18
+ refTable: string;
19
+ refColumns: string[];
20
+ refTableRels: RelationWithReferences[];
21
+ }[];
22
+ tableRelations: {
23
+ [tableName: string]: RelationWithReferences[];
24
+ };
25
+ };
package/common.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ import { type Relations } from 'drizzle-orm/_relations';
2
+ import type { DrizzleTable, RelationWithReferences, Table, TableConfigT } from './types/tables.js';
3
+ export declare const getSchemaInfo: (drizzleTablesAndRelations: {
4
+ [key: string]: DrizzleTable | Relations;
5
+ }, drizzleTables: {
6
+ [key: string]: DrizzleTable;
7
+ }, mapTable: (tableConfig: TableConfigT, dbToTsTableNamesMap: {
8
+ [key: string]: string;
9
+ }, dbToTsColumnNamesMap: {
10
+ [key: string]: string;
11
+ }) => Table) => {
12
+ tables: Table[];
13
+ relations: {
14
+ isCyclic: boolean;
15
+ type?: "one" | "many";
16
+ table: string;
17
+ columns: string[];
18
+ refTable: string;
19
+ refColumns: string[];
20
+ refTableRels: RelationWithReferences[];
21
+ }[];
22
+ tableRelations: {
23
+ [tableName: string]: RelationWithReferences[];
24
+ };
25
+ };
@@ -344,7 +344,7 @@ export declare class GenerateString extends AbstractGenerator<{
344
344
  count: number;
345
345
  seed: number;
346
346
  }): void;
347
- generate(): string;
347
+ generate(): string | Buffer<ArrayBuffer>;
348
348
  }
349
349
  export declare class GenerateUniqueString extends AbstractGenerator<{
350
350
  isUnique?: boolean;
@@ -357,7 +357,7 @@ export declare class GenerateUniqueString extends AbstractGenerator<{
357
357
  }): void;
358
358
  generate({ i }: {
359
359
  i: number;
360
- }): string;
360
+ }): string | Buffer<ArrayBuffer>;
361
361
  }
362
362
  export declare class GenerateUUID extends AbstractGenerator<{
363
363
  arraySize?: number;
@@ -344,7 +344,7 @@ export declare class GenerateString extends AbstractGenerator<{
344
344
  count: number;
345
345
  seed: number;
346
346
  }): void;
347
- generate(): string;
347
+ generate(): string | Buffer<ArrayBuffer>;
348
348
  }
349
349
  export declare class GenerateUniqueString extends AbstractGenerator<{
350
350
  isUnique?: boolean;
@@ -357,7 +357,7 @@ export declare class GenerateUniqueString extends AbstractGenerator<{
357
357
  }): void;
358
358
  generate({ i }: {
359
359
  i: number;
360
- }): string;
360
+ }): string | Buffer<ArrayBuffer>;
361
361
  }
362
362
  export declare class GenerateUUID extends AbstractGenerator<{
363
363
  arraySize?: number;
@@ -344,7 +344,7 @@ export declare class GenerateString extends AbstractGenerator<{
344
344
  count: number;
345
345
  seed: number;
346
346
  }): void;
347
- generate(): string;
347
+ generate(): string | Buffer<ArrayBuffer>;
348
348
  }
349
349
  export declare class GenerateUniqueString extends AbstractGenerator<{
350
350
  isUnique?: boolean;
@@ -357,7 +357,7 @@ export declare class GenerateUniqueString extends AbstractGenerator<{
357
357
  }): void;
358
358
  generate({ i }: {
359
359
  i: number;
360
- }): string;
360
+ }): string | Buffer<ArrayBuffer>;
361
361
  }
362
362
  export declare class GenerateUUID extends AbstractGenerator<{
363
363
  arraySize?: number;
@@ -26,7 +26,7 @@ export declare class GenerateStringV2 extends AbstractGenerator<{
26
26
  count: number;
27
27
  seed: number;
28
28
  }): void;
29
- generate(): string | Buffer;
29
+ generate(): string | Buffer<ArrayBuffer>;
30
30
  }
31
31
  export declare class GenerateUniqueStringV2 extends AbstractGenerator<{
32
32
  isUnique?: boolean;
@@ -41,5 +41,5 @@ export declare class GenerateUniqueStringV2 extends AbstractGenerator<{
41
41
  }): void;
42
42
  generate({ i }: {
43
43
  i: number;
44
- }): string;
44
+ }): string | Buffer<ArrayBuffer>;
45
45
  }
@@ -26,7 +26,7 @@ export declare class GenerateStringV2 extends AbstractGenerator<{
26
26
  count: number;
27
27
  seed: number;
28
28
  }): void;
29
- generate(): string | Buffer;
29
+ generate(): string | Buffer<ArrayBuffer>;
30
30
  }
31
31
  export declare class GenerateUniqueStringV2 extends AbstractGenerator<{
32
32
  isUnique?: boolean;
@@ -41,5 +41,5 @@ export declare class GenerateUniqueStringV2 extends AbstractGenerator<{
41
41
  }): void;
42
42
  generate({ i }: {
43
43
  i: number;
44
- }): string;
44
+ }): string | Buffer<ArrayBuffer>;
45
45
  }
@@ -26,7 +26,7 @@ export declare class GenerateStringV2 extends AbstractGenerator<{
26
26
  count: number;
27
27
  seed: number;
28
28
  }): void;
29
- generate(): string | Buffer;
29
+ generate(): string | Buffer<ArrayBuffer>;
30
30
  }
31
31
  export declare class GenerateUniqueStringV2 extends AbstractGenerator<{
32
32
  isUnique?: boolean;
@@ -41,5 +41,5 @@ export declare class GenerateUniqueStringV2 extends AbstractGenerator<{
41
41
  }): void;
42
42
  generate({ i }: {
43
43
  i: number;
44
- }): string;
44
+ }): string | Buffer<ArrayBuffer>;
45
45
  }