drizzle-kit 0.27.2 → 0.28.0-bc6e8f5
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +7 -7
- package/api.d.mts +3 -2
- package/api.d.ts +3 -2
- package/api.js +267 -202
- package/api.mjs +267 -202
- package/bin.cjs +47621 -47561
- package/index-BfiZoTqG.d.mts +293 -0
- package/index-BfiZoTqG.d.ts +293 -0
- package/index.d.mts +2 -287
- package/index.d.ts +2 -287
- package/package.json +4 -1
- package/utils.js +11 -0
- package/utils.mjs +9 -0
- package/common-DYjgLS6u.d.mts +0 -8
- package/common-DYjgLS6u.d.ts +0 -8
package/README.md
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
## Drizzle Kit
|
2
2
|
|
3
|
-
|
3
|
+
Drizzle Kit is a CLI migrator tool for Drizzle ORM. It is probably the one and only tool that lets you completely automatically generate SQL migrations and covers ~95% of the common cases like deletions and renames by prompting user input.
|
4
4
|
<https://github.com/drizzle-team/drizzle-kit-mirror> - is a mirror repository for issues.
|
5
5
|
|
6
6
|
## Documentation
|
7
7
|
|
8
|
-
Check the full
|
8
|
+
Check the full documentation on [the website](https://orm.drizzle.team/kit-docs/overview).
|
9
9
|
|
10
10
|
### How it works
|
11
11
|
|
12
|
-
|
13
|
-
|
12
|
+
Drizzle Kit traverses a schema module and generates a snapshot to compare with the previous version, if there is one.
|
13
|
+
Based on the difference, it will generate all needed SQL migrations. If there are any cases that can't be resolved automatically, such as renames, it will prompt the user for input.
|
14
14
|
|
15
|
-
For schema
|
15
|
+
For example, for this schema module:
|
16
16
|
|
17
17
|
```typescript
|
18
|
-
//
|
18
|
+
// src/db/schema.ts
|
19
19
|
|
20
20
|
import { integer, pgTable, serial, text, varchar } from "drizzle-orm/pg-core";
|
21
21
|
|
@@ -63,7 +63,7 @@ CREATE INDEX IF NOT EXISTS users_full_name_index ON users (full_name);
|
|
63
63
|
npm install -D drizzle-kit
|
64
64
|
```
|
65
65
|
|
66
|
-
Running with CLI options
|
66
|
+
Running with CLI options:
|
67
67
|
|
68
68
|
```jsonc
|
69
69
|
// package.json
|
package/api.d.mts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
2
2
|
import { MySql2Database } from 'drizzle-orm/mysql2';
|
3
3
|
import { PgDatabase } from 'drizzle-orm/pg-core';
|
4
|
-
import { C as CasingType } from './
|
4
|
+
import { C as CasingType, a as Config } from './index-BfiZoTqG.mjs';
|
5
5
|
import * as zod from 'zod';
|
6
6
|
import { TypeOf } from 'zod';
|
7
|
+
import 'tls';
|
7
8
|
|
8
9
|
declare const schema$1: zod.ZodObject<zod.objectUtil.extendShape<{
|
9
10
|
version: zod.ZodLiteral<"5">;
|
@@ -2285,7 +2286,7 @@ type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
|
|
2285
2286
|
type DrizzleMySQLSnapshotJSON = MySqlSchema;
|
2286
2287
|
declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
|
2287
2288
|
declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
|
2288
|
-
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
|
2289
|
+
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[], tablesFilter?: string[], extensionsFilters?: Config["extensionsFilters"]) => Promise<{
|
2289
2290
|
hasDataLoss: boolean;
|
2290
2291
|
warnings: string[];
|
2291
2292
|
statementsToExecute: string[];
|
package/api.d.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import { LibSQLDatabase } from 'drizzle-orm/libsql';
|
2
2
|
import { MySql2Database } from 'drizzle-orm/mysql2';
|
3
3
|
import { PgDatabase } from 'drizzle-orm/pg-core';
|
4
|
-
import { C as CasingType } from './
|
4
|
+
import { C as CasingType, a as Config } from './index-BfiZoTqG.js';
|
5
5
|
import * as zod from 'zod';
|
6
6
|
import { TypeOf } from 'zod';
|
7
|
+
import 'tls';
|
7
8
|
|
8
9
|
declare const schema$1: zod.ZodObject<zod.objectUtil.extendShape<{
|
9
10
|
version: zod.ZodLiteral<"5">;
|
@@ -2285,7 +2286,7 @@ type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
|
|
2285
2286
|
type DrizzleMySQLSnapshotJSON = MySqlSchema;
|
2286
2287
|
declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[], casing?: CasingType) => PgSchema;
|
2287
2288
|
declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
|
2288
|
-
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
|
2289
|
+
declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[], tablesFilter?: string[], extensionsFilters?: Config["extensionsFilters"]) => Promise<{
|
2289
2290
|
hasDataLoss: boolean;
|
2290
2291
|
warnings: string[];
|
2291
2292
|
statementsToExecute: string[];
|