@prisma/migrate 5.19.0-dev.14 → 5.19.0-dev.15

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 (37) hide show
  1. package/dist/Migrate.js +4 -4
  2. package/dist/SchemaEngine.js +4 -4
  3. package/dist/bin.js +33 -33
  4. package/dist/{chunk-OC5KTRBP.js → chunk-5LNGL4YS.js} +12 -9
  5. package/dist/{chunk-E6G3WPWL.js → chunk-76XWADEV.js} +6 -6
  6. package/dist/{chunk-KODAP3NW.js → chunk-BAVMZZAR.js} +7 -7
  7. package/dist/{chunk-MKYJ2GXL.js → chunk-CPO2KQQL.js} +13 -10
  8. package/dist/{chunk-O234LSYW.js → chunk-EXUBPCXZ.js} +7 -7
  9. package/dist/{chunk-MWD4ITZX.js → chunk-GJN3CSXW.js} +6 -6
  10. package/dist/{chunk-MRIGZ6M4.js → chunk-LLGEQ76N.js} +6 -6
  11. package/dist/{chunk-I7ABLDKM.js → chunk-MWEO3VUS.js} +7 -7
  12. package/dist/{chunk-K5V4Z7K7.js → chunk-SV5GANSI.js} +6 -6
  13. package/dist/{chunk-7STK4OF3.js → chunk-UJWMQPUH.js} +6 -6
  14. package/dist/{chunk-4OQCFE3G.js → chunk-XLLUFIQK.js} +11 -3
  15. package/dist/{chunk-DRR7ERIJ.js → chunk-XVL5RF2T.js} +6 -6
  16. package/dist/chunk-YOW3VBYS.js +97 -0
  17. package/dist/{chunk-B4CC5OFU.js → chunk-ZBOJAYON.js} +6 -6
  18. package/dist/commands/DbExecute.js +5 -5
  19. package/dist/commands/DbPull.js +5 -5
  20. package/dist/commands/DbPush.js +5 -5
  21. package/dist/commands/MigrateDeploy.js +5 -5
  22. package/dist/commands/MigrateDev.js +5 -5
  23. package/dist/commands/MigrateDiff.js +5 -5
  24. package/dist/commands/MigrateReset.js +5 -5
  25. package/dist/commands/MigrateResolve.js +5 -5
  26. package/dist/commands/MigrateStatus.js +5 -5
  27. package/dist/index.js +39 -37
  28. package/dist/internals/src/get-generators/getGenerators.d.ts +2 -1
  29. package/dist/internals/src/index.d.ts +1 -0
  30. package/dist/internals/src/utils/isValidJsIdentifier.d.ts +1 -0
  31. package/dist/migrate/src/SchemaEngine.d.ts +6 -0
  32. package/dist/migrate/src/index.d.ts +1 -0
  33. package/dist/migrate/src/types.d.ts +12 -0
  34. package/dist/migrate/src/utils/introspectSql.d.ts +17 -0
  35. package/dist/utils/getDatabaseVersionSafe.js +4 -4
  36. package/dist/utils/introspectSql.js +29 -0
  37. package/package.json +5 -5
@@ -0,0 +1 @@
1
+ export declare function isValidJsIdentifier(str: string): boolean;
@@ -122,6 +122,12 @@ export declare class SchemaEngine {
122
122
  * The command behind db push.
123
123
  */
124
124
  schemaPush(args: EngineArgs.SchemaPushInput): Promise<EngineResults.SchemaPush>;
125
+ /**
126
+ * SQL introspection that powers TypedSQL feature
127
+ * @param args
128
+ * @returns
129
+ */
130
+ introspectSql(args: EngineArgs.IntrospectSqlParams): Promise<EngineResults.IntrospectSqlOutput>;
125
131
  stop(): void;
126
132
  private rejectAll;
127
133
  private registerCallback;
@@ -17,3 +17,4 @@ export * from './types';
17
17
  export { default as byline } from './utils/byline';
18
18
  export { getDatabaseVersionSafe } from './utils/getDatabaseVersionSafe';
19
19
  export { getSchemaPathAndPrint, printSchemaLoadedMessage } from './utils/getSchemaPathAndPrint';
20
+ export { introspectSql, type IntrospectSqlError, type IntrospectSqlInput, type IntrospectSqlResult, } from './utils/introspectSql';
@@ -1,3 +1,4 @@
1
+ import type { SqlQueryOutput } from '@prisma/generator-helper';
1
2
  import type { MigrateTypes } from '@prisma/internals';
2
3
  import type { IntrospectionViewDefinition } from './views/handleViewsIO';
3
4
  export interface RpcRequestResponse {
@@ -154,6 +155,14 @@ export declare namespace EngineArgs {
154
155
  schema: MigrateTypes.SchemasContainer;
155
156
  force: boolean;
156
157
  }
158
+ export interface IntrospectSqlParams {
159
+ url: string;
160
+ queries: SqlQueryInput[];
161
+ }
162
+ export interface SqlQueryInput {
163
+ name: string;
164
+ source: string;
165
+ }
157
166
  export {};
158
167
  }
159
168
  export declare namespace EngineResults {
@@ -198,6 +207,9 @@ export declare namespace EngineResults {
198
207
  warnings: string[];
199
208
  unexecutable: string[];
200
209
  }
210
+ interface IntrospectSqlOutput {
211
+ queries: SqlQueryOutput[];
212
+ }
201
213
  }
202
214
  export interface FileMap {
203
215
  [fileName: string]: string;
@@ -0,0 +1,17 @@
1
+ import { SqlQueryOutput } from '@prisma/generator-helper';
2
+ import { EngineArgs } from '../types';
3
+ export interface IntrospectSqlInput extends EngineArgs.SqlQueryInput {
4
+ fileName: string;
5
+ }
6
+ export type IntrospectSqlError = {
7
+ fileName: string;
8
+ message: string;
9
+ };
10
+ export type IntrospectSqlResult = {
11
+ ok: true;
12
+ queries: SqlQueryOutput[];
13
+ } | {
14
+ ok: false;
15
+ errors: IntrospectSqlError[];
16
+ };
17
+ export declare function introspectSql(schemaPath: string | undefined, queries: IntrospectSqlInput[]): Promise<IntrospectSqlResult>;
@@ -18,13 +18,13 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var getDatabaseVersionSafe_exports = {};
20
20
  __export(getDatabaseVersionSafe_exports, {
21
- getDatabaseVersionSafe: () => import_chunk_MWD4ITZX.getDatabaseVersionSafe
21
+ getDatabaseVersionSafe: () => import_chunk_GJN3CSXW.getDatabaseVersionSafe
22
22
  });
23
23
  module.exports = __toCommonJS(getDatabaseVersionSafe_exports);
24
- var import_chunk_MWD4ITZX = require("../chunk-MWD4ITZX.js");
25
- var import_chunk_4OQCFE3G = require("../chunk-4OQCFE3G.js");
24
+ var import_chunk_GJN3CSXW = require("../chunk-GJN3CSXW.js");
25
+ var import_chunk_XLLUFIQK = require("../chunk-XLLUFIQK.js");
26
26
  var import_chunk_LVFPGUOH = require("../chunk-LVFPGUOH.js");
27
27
  var import_chunk_AAATUOV6 = require("../chunk-AAATUOV6.js");
28
28
  var import_chunk_6TE2RIPN = require("../chunk-6TE2RIPN.js");
29
29
  var import_chunk_WWAWV7DQ = require("../chunk-WWAWV7DQ.js");
30
- (0, import_chunk_MWD4ITZX.init_getDatabaseVersionSafe)();
30
+ (0, import_chunk_GJN3CSXW.init_getDatabaseVersionSafe)();
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var introspectSql_exports = {};
20
+ __export(introspectSql_exports, {
21
+ introspectSql: () => import_chunk_YOW3VBYS.introspectSql
22
+ });
23
+ module.exports = __toCommonJS(introspectSql_exports);
24
+ var import_chunk_YOW3VBYS = require("../chunk-YOW3VBYS.js");
25
+ var import_chunk_XLLUFIQK = require("../chunk-XLLUFIQK.js");
26
+ var import_chunk_LVFPGUOH = require("../chunk-LVFPGUOH.js");
27
+ var import_chunk_AAATUOV6 = require("../chunk-AAATUOV6.js");
28
+ var import_chunk_6TE2RIPN = require("../chunk-6TE2RIPN.js");
29
+ var import_chunk_WWAWV7DQ = require("../chunk-WWAWV7DQ.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prisma/migrate",
3
- "version": "5.19.0-dev.14",
3
+ "version": "5.19.0-dev.15",
4
4
  "description": "This package is intended for Prisma's internal use",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -58,10 +58,10 @@
58
58
  "dependencies": {
59
59
  "@prisma/engines-version": "5.19.0-26.8a3982b39f6dc8065ba99a0d212b3e18a5cd2d1d",
60
60
  "prompts": "2.4.2",
61
- "@prisma/debug": "5.19.0-dev.14",
62
- "@prisma/internals": "5.19.0-dev.14",
63
- "@prisma/get-platform": "5.19.0-dev.14",
64
- "@prisma/generator-helper": "5.19.0-dev.14"
61
+ "@prisma/debug": "5.19.0-dev.15",
62
+ "@prisma/get-platform": "5.19.0-dev.15",
63
+ "@prisma/generator-helper": "5.19.0-dev.15",
64
+ "@prisma/internals": "5.19.0-dev.15"
65
65
  },
66
66
  "files": [
67
67
  "README.md",