drizzle-kit 0.20.0-f39d8bc → 0.20.1-56e7be6

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 (56) hide show
  1. package/@types/utils.d.ts +12 -0
  2. package/{index.cjs → bin.cjs} +28995 -37098
  3. package/cli/commands/migrate.d.ts +260 -0
  4. package/cli/commands/mysqlUp.d.ts +4 -0
  5. package/cli/commands/pgConnect.d.ts +5 -0
  6. package/cli/commands/pgIntrospect.d.ts +116 -0
  7. package/cli/commands/pgPushUtils.d.ts +14 -0
  8. package/cli/commands/pgUp.d.ts +4 -0
  9. package/cli/commands/sqliteIntrospect.d.ts +102 -0
  10. package/cli/commands/sqliteUtils.d.ts +162 -0
  11. package/cli/commands/upFolders.d.ts +27 -0
  12. package/cli/commands/utils.d.ts +265 -0
  13. package/cli/selector-ui.d.ts +13 -0
  14. package/cli/utils.d.ts +11 -0
  15. package/cli/validations/common.d.ts +13 -0
  16. package/cli/validations/mysql.d.ts +365 -0
  17. package/cli/validations/outputs.d.ts +40 -0
  18. package/cli/validations/pg.d.ts +438 -0
  19. package/cli/validations/sqlite.d.ts +220 -0
  20. package/cli/validations/studio.d.ts +593 -0
  21. package/cli/views.d.ts +61 -0
  22. package/drivers/index.d.ts +25 -0
  23. package/global.d.ts +3 -0
  24. package/index.d.mts +105 -0
  25. package/index.d.ts +48 -1
  26. package/index.js +31 -0
  27. package/index.mjs +7 -0
  28. package/introspect.d.ts +4 -0
  29. package/jsonDiffer.d.ts +76 -0
  30. package/jsonStatements.d.ts +349 -0
  31. package/migrationPreparator.d.ts +35 -0
  32. package/orm-extenstions/d1-driver/driver.d.ts +8 -0
  33. package/orm-extenstions/d1-driver/session.d.ts +51 -0
  34. package/orm-extenstions/d1-driver/wrangler-client.d.ts +3 -0
  35. package/package.json +26 -9
  36. package/schemaValidator.d.ts +1306 -0
  37. package/serializer/index.d.ts +9 -0
  38. package/serializer/mysqlImports.d.ts +6 -0
  39. package/serializer/mysqlSchema.d.ts +3833 -0
  40. package/serializer/mysqlSerializer.d.ts +7 -0
  41. package/serializer/pgImports.d.ts +11 -0
  42. package/serializer/pgSchema.d.ts +4244 -0
  43. package/serializer/pgSerializer.d.ts +9 -0
  44. package/serializer/sqliteImports.d.ts +5 -0
  45. package/serializer/sqliteSchema.d.ts +3227 -0
  46. package/serializer/sqliteSerializer.d.ts +8 -0
  47. package/serializer/studioUtils.d.ts +53 -0
  48. package/snapshotsDiffer.d.ts +2660 -0
  49. package/sqlgenerator.d.ts +33 -0
  50. package/sqlite-introspect.d.ts +5 -0
  51. package/utils/words.d.ts +7 -0
  52. package/utils-studio.d.ts +5 -0
  53. package/utils-studio.js +3367 -0
  54. package/utils.d.ts +211 -0
  55. package/utils.js +52586 -11755
  56. package/loader.mjs +0 -57
@@ -0,0 +1,51 @@
1
+ import { entityKind } from "drizzle-orm";
2
+ import type { Logger } from "drizzle-orm";
3
+ import { type RelationalSchemaConfig, type TablesRelationalConfig } from "drizzle-orm";
4
+ import { type Query } from "drizzle-orm";
5
+ import { SQLiteAsyncDialect, SQLiteExecuteMethod, SQLitePreparedQuery, SQLiteSession } from "drizzle-orm/sqlite-core";
6
+ import type { SelectedFieldsOrdered } from "drizzle-orm/sqlite-core";
7
+ import { type PreparedQueryConfig as PreparedQueryConfigBase, type SQLiteTransactionConfig } from "drizzle-orm/sqlite-core";
8
+ export interface SQLiteD1SessionOptions {
9
+ logger?: Logger;
10
+ }
11
+ type PreparedQueryConfig = Omit<PreparedQueryConfigBase, "statement" | "run">;
12
+ export type D1WranglerResults<T = unknown> = {
13
+ results?: T[];
14
+ };
15
+ export declare class SQLiteWranglerD1Session<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteSession<"async", D1WranglerResults, TFullSchema, TSchema> {
16
+ private client;
17
+ private configPath;
18
+ private dbName;
19
+ private schema;
20
+ private options;
21
+ static readonly [entityKind]: string;
22
+ private logger;
23
+ constructor(client: (query: string, configPath: string, dbName: string) => Promise<any>, configPath: string, dbName: string, dialect: SQLiteAsyncDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: SQLiteD1SessionOptions);
24
+ prepareQuery(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, customResultMapper?: (rows: unknown[][]) => unknown): PreparedQuery;
25
+ transaction<T>(transaction: (tx: any) => T | Promise<T>, config?: SQLiteTransactionConfig): Promise<T>;
26
+ }
27
+ export declare class PreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends SQLitePreparedQuery<{
28
+ type: "async";
29
+ run: D1WranglerResults;
30
+ all: T["all"];
31
+ get: T["get"];
32
+ values: T["values"];
33
+ execute: T["execute"];
34
+ }> {
35
+ private stmt;
36
+ private configPath;
37
+ private dbName;
38
+ private queryString;
39
+ private params;
40
+ private logger;
41
+ private fields;
42
+ private customResultMapper?;
43
+ static readonly [entityKind]: string;
44
+ constructor(stmt: (query: string, configPath: string, dbName: string) => Promise<any>, configPath: string, dbName: string, queryString: string, params: unknown[], logger: Logger, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, customResultMapper?: ((rows: unknown[][]) => unknown) | undefined);
45
+ run(placeholderValues?: Record<string, unknown>): Promise<D1WranglerResults>;
46
+ all(placeholderValues?: Record<string, unknown>): Promise<T["all"]>;
47
+ get(placeholderValues?: Record<string, unknown>): Promise<T["get"]>;
48
+ private d1ToRawMapping;
49
+ values(placeholderValues?: Record<string, unknown>): Promise<unknown[][]>;
50
+ }
51
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare function execute(query: string, configPath: string, dbName: string): Promise<{
2
+ results: any;
3
+ }>;
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.20.0-f39d8bc",
3
+ "version": "0.20.1-56e7be6",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
7
7
  "bin": {
8
- "drizzle-kit": "./index.cjs"
8
+ "drizzle-kit": "./bin.cjs"
9
9
  },
10
10
  "scripts": {
11
11
  "test:pg:push": "drizzle-kit push:pg",
12
+ "payload": "tsx ./dev/payload.ts",
12
13
  "migrate:old": "drizzle-kit generate:pg --out ./dev/migrations-pg --schema ./dev/migrations-pg/schema.ts",
13
14
  "push": "node -r esbuild-register ./src/cli/index.ts push:mysql",
14
15
  "push:sqlite": "node -r ./src/loader.mjs ./src/cli/index.ts push:sqlite",
@@ -34,12 +35,13 @@
34
35
  "sim": "node -r esbuild-register ./dev/simulate.ts",
35
36
  "sim:sqlite": "node -r esbuild-register ./dev/sqlite/index.ts",
36
37
  "test": "ava test --timeout=60s",
37
- "build": "rm -rf ./dist && tsx build.ts && tsc -p tsconfig.cli-types.json",
38
+ "build": "rm -rf ./dist && tsc -p tsconfig.cli-types.json && cp dist/index.d.ts dist/index.d.mts && tsx build.ts",
38
39
  "build:dev": "rm -rf ./dist && tsx build.dev.ts && tsc -p tsconfig.cli-types.json && chmod +x ./dist/index.cjs",
39
- "pack": "build && package",
40
+ "packit": "pnpm build && cp package.json dist/ && cd dist && pnpm pack",
40
41
  "tsc": "tsc -p tsconfig.build.json",
41
42
  "pub": "cp package.json readme.md dist/ && cd dist && npm publish",
42
- "studio": "./dist/index.cjs studio --verbose"
43
+ "studio": "./dist/index.cjs studio --verbose",
44
+ "studio:dev": "tsx ./src/cli/index.ts studio --verbose"
43
45
  },
44
46
  "ava": {
45
47
  "files": [
@@ -53,7 +55,7 @@
53
55
  ]
54
56
  },
55
57
  "dependencies": {
56
- "@drizzle-team/studio": "^0.0.5",
58
+ "@drizzle-team/studio": "^0.0.27",
57
59
  "@esbuild-kit/esm-loader": "^2.5.5",
58
60
  "camelcase": "^7.0.1",
59
61
  "chalk": "^5.2.0",
@@ -75,25 +77,40 @@
75
77
  "@types/glob": "^8.1.0",
76
78
  "@types/minimatch": "^5.1.2",
77
79
  "@types/node": "^18.11.15",
78
- "@types/pg": "^8.6.5",
80
+ "@types/pg": "^8.10.7",
79
81
  "@typescript-eslint/eslint-plugin": "^5.46.1",
80
82
  "@typescript-eslint/parser": "^5.46.1",
81
83
  "ava": "^5.1.0",
82
84
  "better-sqlite3": "^8.4.0",
83
85
  "dockerode": "^3.3.4",
84
86
  "dotenv": "^16.0.3",
85
- "drizzle-orm": "0.28.7-4e094f0",
87
+ "drizzle-orm": "0.29.0-d3b1c58",
88
+ "esbuild-node-externals": "^1.9.0",
86
89
  "eslint": "^8.29.0",
87
90
  "eslint-config-prettier": "^8.5.0",
88
91
  "eslint-plugin-prettier": "^4.2.1",
89
92
  "get-port": "^6.1.2",
90
93
  "mysql2": "2.3.3",
91
- "pg": "^8.8.0",
94
+ "pg": "^8.11.3",
92
95
  "postgres": "^3.3.5",
93
96
  "prettier": "^2.8.1",
94
97
  "tsx": "^3.12.1",
95
98
  "typescript": "^4.9.4",
96
99
  "uvu": "^0.5.6",
97
100
  "zx": "^7.2.2"
101
+ },
102
+ "exports": {
103
+ ".": {
104
+ "import": {
105
+ "types": "./index.d.mts",
106
+ "default": "./index.mjs"
107
+ },
108
+ "require": {
109
+ "types": "./index.d.ts",
110
+ "default": "./index.js"
111
+ },
112
+ "types": "./index.d.mts",
113
+ "default": "./index.mjs"
114
+ }
98
115
  }
99
116
  }