@prisma/migrate 6.7.0-dev.8 → 6.7.0-dev.9

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 (145) hide show
  1. package/dist/Migrate.js +5 -5
  2. package/dist/SchemaEngineCLI.js +4 -4
  3. package/dist/SchemaEngineWasm.js +3 -3
  4. package/dist/bin.js +25 -25
  5. package/dist/{chunk-U3PKVEAK.js → chunk-3LPJTPON.js} +5 -5
  6. package/dist/{chunk-O5YQGEQH.js → chunk-6FXCGDYG.js} +5 -5
  7. package/dist/{chunk-7HZE6BDG.js → chunk-7SHRWQOO.js} +6 -6
  8. package/dist/{chunk-OEWQACEH.js → chunk-AXR7LS2N.js} +531 -617
  9. package/dist/{chunk-OEFUBBD2.js → chunk-EVYAFMVA.js} +5 -5
  10. package/dist/{chunk-TUCW5C5C.js → chunk-GTNVXSIW.js} +5 -5
  11. package/dist/{chunk-I3LT2PO3.js → chunk-HAXSH7UY.js} +5 -5
  12. package/dist/{chunk-BKPGODI6.js → chunk-HKEIYY25.js} +5 -5
  13. package/dist/{chunk-SQFNJXFA.js → chunk-K7LD5M6A.js} +5 -5
  14. package/dist/{chunk-NRSITJIH.js → chunk-NP7ZZIVZ.js} +5 -5
  15. package/dist/{chunk-JOAFF4FT.js → chunk-QRILN5QM.js} +7 -7
  16. package/dist/{chunk-UGHI6IC4.js → chunk-R6N4ZN7K.js} +532 -1063
  17. package/dist/{chunk-6JKG6LGO.js → chunk-RAQT64TS.js} +7 -7
  18. package/dist/{chunk-ORYJRFI7.js → chunk-UYASBG5U.js} +5 -5
  19. package/dist/{chunk-6BNGZSAG.js → chunk-WFPTCAHP.js} +5 -5
  20. package/dist/commands/DbExecute.js +6 -6
  21. package/dist/commands/DbPull.js +6 -6
  22. package/dist/commands/DbPush.js +6 -6
  23. package/dist/commands/MigrateDeploy.js +6 -6
  24. package/dist/commands/MigrateDev.js +6 -6
  25. package/dist/commands/MigrateDiff.js +6 -6
  26. package/dist/commands/MigrateReset.js +6 -6
  27. package/dist/commands/MigrateResolve.js +6 -6
  28. package/dist/commands/MigrateStatus.js +6 -6
  29. package/dist/index.js +29 -29
  30. package/dist/utils/getDatabaseVersionSafe.js +6 -6
  31. package/dist/utils/introspectSql.js +6 -6
  32. package/dist/views/handleViewsIO.js +2 -2
  33. package/package.json +8 -8
  34. package/dist/chunk-QY6XVXFR.js +0 -11313
  35. package/dist/internals/src/Generator.d.ts +0 -42
  36. package/dist/internals/src/WasmPanicRegistry.d.ts +0 -5
  37. package/dist/internals/src/WasmSchemaEngineLoader.d.ts +0 -5
  38. package/dist/internals/src/cli/Help.d.ts +0 -11
  39. package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +0 -18
  40. package/dist/internals/src/cli/checkUnsupportedSchemaEngineWasm.d.ts +0 -22
  41. package/dist/internals/src/cli/directoryConfig.d.ts +0 -7
  42. package/dist/internals/src/cli/getGeneratorSuccessMessage.d.ts +0 -7
  43. package/dist/internals/src/cli/getTypescriptVersion.d.ts +0 -1
  44. package/dist/internals/src/cli/hashes.d.ts +0 -10
  45. package/dist/internals/src/cli/schemaContext.d.ts +0 -59
  46. package/dist/internals/src/cli/types.d.ts +0 -47
  47. package/dist/internals/src/cli/utils.d.ts +0 -13
  48. package/dist/internals/src/client/getClientEngineType.d.ts +0 -8
  49. package/dist/internals/src/convertCredentials.d.ts +0 -10
  50. package/dist/internals/src/dotenvExpand.d.ts +0 -35
  51. package/dist/internals/src/engine-commands/errorHelpers.d.ts +0 -4
  52. package/dist/internals/src/engine-commands/formatSchema.d.ts +0 -22
  53. package/dist/internals/src/engine-commands/getConfig.d.ts +0 -31
  54. package/dist/internals/src/engine-commands/getDmmf.d.ts +0 -20
  55. package/dist/internals/src/engine-commands/getEngineVersion.d.ts +0 -4
  56. package/dist/internals/src/engine-commands/getEnginesMetaInfo.d.ts +0 -25
  57. package/dist/internals/src/engine-commands/index.d.ts +0 -10
  58. package/dist/internals/src/engine-commands/lintSchema.d.ts +0 -26
  59. package/dist/internals/src/engine-commands/mergeSchemas.d.ts +0 -12
  60. package/dist/internals/src/engine-commands/queryEngineCommons.d.ts +0 -31
  61. package/dist/internals/src/engine-commands/relativizePathInPSLError.d.ts +0 -1
  62. package/dist/internals/src/engine-commands/validate.d.ts +0 -12
  63. package/dist/internals/src/errorReporting.d.ts +0 -25
  64. package/dist/internals/src/get-generators/getGenerators.d.ts +0 -71
  65. package/dist/internals/src/get-generators/utils/binaryTypeToEngineType.d.ts +0 -3
  66. package/dist/internals/src/get-generators/utils/engineTypeToBinaryType.d.ts +0 -3
  67. package/dist/internals/src/get-generators/utils/fixBinaryTargets.d.ts +0 -3
  68. package/dist/internals/src/get-generators/utils/getBinaryPathsByVersion.d.ts +0 -3
  69. package/dist/internals/src/get-generators/utils/getEngineVersionForGenerator.d.ts +0 -2
  70. package/dist/internals/src/get-generators/utils/printGeneratorConfig.d.ts +0 -9
  71. package/dist/internals/src/getPackedPackage.d.ts +0 -1
  72. package/dist/internals/src/highlight/highlight.d.ts +0 -3
  73. package/dist/internals/src/highlight/languages/dml.d.ts +0 -2
  74. package/dist/internals/src/highlight/languages/sql.d.ts +0 -2
  75. package/dist/internals/src/highlight/prism.d.ts +0 -6
  76. package/dist/internals/src/highlight/theme.d.ts +0 -2
  77. package/dist/internals/src/highlight/types.d.ts +0 -35
  78. package/dist/internals/src/index.d.ts +0 -92
  79. package/dist/internals/src/logger.d.ts +0 -14
  80. package/dist/internals/src/migrateTypes.d.ts +0 -89
  81. package/dist/internals/src/panic.d.ts +0 -31
  82. package/dist/internals/src/resolveBinary.d.ts +0 -6
  83. package/dist/internals/src/resolveOutput.d.ts +0 -5
  84. package/dist/internals/src/resolvePkg.d.ts +0 -7
  85. package/dist/internals/src/schemaEngineCommands.d.ts +0 -37
  86. package/dist/internals/src/sendPanic.d.ts +0 -10
  87. package/dist/internals/src/tracing/types.d.ts +0 -55
  88. package/dist/internals/src/types.d.ts +0 -19
  89. package/dist/internals/src/utils/assertAlways.d.ts +0 -14
  90. package/dist/internals/src/utils/assertNever.d.ts +0 -27
  91. package/dist/internals/src/utils/binaryTargetRegex.d.ts +0 -8
  92. package/dist/internals/src/utils/byline.d.ts +0 -4
  93. package/dist/internals/src/utils/callOnce.d.ts +0 -13
  94. package/dist/internals/src/utils/canPrompt.d.ts +0 -1
  95. package/dist/internals/src/utils/chmodPlusX.d.ts +0 -1
  96. package/dist/internals/src/utils/cloudflareD1.d.ts +0 -5
  97. package/dist/internals/src/utils/drawBox.d.ts +0 -9
  98. package/dist/internals/src/utils/extractPreviewFeatures.d.ts +0 -2
  99. package/dist/internals/src/utils/formatTable.d.ts +0 -5
  100. package/dist/internals/src/utils/formatms.d.ts +0 -5
  101. package/dist/internals/src/utils/fs-functional.d.ts +0 -53
  102. package/dist/internals/src/utils/fs-utils.d.ts +0 -30
  103. package/dist/internals/src/utils/getCommandWithExecutor.d.ts +0 -1
  104. package/dist/internals/src/utils/getEnvPaths.d.ts +0 -14
  105. package/dist/internals/src/utils/getGitHubIssueUrl.d.ts +0 -18
  106. package/dist/internals/src/utils/getMigrateConfigDir.d.ts +0 -2
  107. package/dist/internals/src/utils/getVersionFromPackageJson.d.ts +0 -1
  108. package/dist/internals/src/utils/handleEngineLoadingErrors.d.ts +0 -8
  109. package/dist/internals/src/utils/handlePanic.d.ts +0 -11
  110. package/dist/internals/src/utils/hasOwnProperty.d.ts +0 -1
  111. package/dist/internals/src/utils/isCi.d.ts +0 -1
  112. package/dist/internals/src/utils/isCurrentBinInstalledGlobally.d.ts +0 -1
  113. package/dist/internals/src/utils/isInContainer.d.ts +0 -5
  114. package/dist/internals/src/utils/isInNpmLifecycleHook.d.ts +0 -4
  115. package/dist/internals/src/utils/isInteractive.d.ts +0 -6
  116. package/dist/internals/src/utils/isPromiseLike.d.ts +0 -1
  117. package/dist/internals/src/utils/isValidJsIdentifier.d.ts +0 -1
  118. package/dist/internals/src/utils/keyBy.d.ts +0 -9
  119. package/dist/internals/src/utils/link.d.ts +0 -1
  120. package/dist/internals/src/utils/load.d.ts +0 -6
  121. package/dist/internals/src/utils/loadEnvFile.d.ts +0 -10
  122. package/dist/internals/src/utils/mapKeys.d.ts +0 -1
  123. package/dist/internals/src/utils/mapObjectValues.d.ts +0 -1
  124. package/dist/internals/src/utils/maskSchema.d.ts +0 -4
  125. package/dist/internals/src/utils/max.d.ts +0 -11
  126. package/dist/internals/src/utils/maybeInGitHook.d.ts +0 -9
  127. package/dist/internals/src/utils/missingDatasource.d.ts +0 -1
  128. package/dist/internals/src/utils/missingGeneratorMessage.d.ts +0 -3
  129. package/dist/internals/src/utils/parseAWSNodejsRuntimeEnvVarVersion.d.ts +0 -1
  130. package/dist/internals/src/utils/parseEnvValue.d.ts +0 -17
  131. package/dist/internals/src/utils/path.d.ts +0 -14
  132. package/dist/internals/src/utils/pick.d.ts +0 -1
  133. package/dist/internals/src/utils/printConfigWarnings.d.ts +0 -1
  134. package/dist/internals/src/utils/prismaPostgres.d.ts +0 -3
  135. package/dist/internals/src/utils/serializeQueryEngineName.d.ts +0 -4
  136. package/dist/internals/src/utils/setClassName.d.ts +0 -9
  137. package/dist/internals/src/utils/toSchemasContainer.d.ts +0 -5
  138. package/dist/internals/src/utils/tryLoadEnvs.d.ts +0 -25
  139. package/dist/internals/src/utils/vercelPkgPathRegex.d.ts +0 -1
  140. package/dist/internals/src/warnOnce.d.ts +0 -1
  141. package/dist/internals/src/wasm.d.ts +0 -5
  142. package/dist/multipart-parser-ASKQAOL4-WZ47HU6G.js +0 -4696
  143. package/dist/multipart-parser-QCI3Y5IB.js +0 -4561
  144. package/dist/typescript-2LKASCMC.js +0 -205192
  145. package/dist/typescript-H3AVJ6KX.js +0 -205230
@@ -1,42 +0,0 @@
1
- import type { BinaryPaths, Generator as IGenerator, GeneratorConfig, GeneratorManifest, GeneratorOptions } from '@prisma/generator';
2
- export declare abstract class Generator {
3
- manifest: GeneratorManifest | null;
4
- config: GeneratorConfig;
5
- options?: GeneratorOptions;
6
- constructor(config: GeneratorConfig);
7
- init(): Promise<void>;
8
- protected abstract initImpl(): Promise<void>;
9
- protected abstract getManifest(): Promise<GeneratorManifest | null>;
10
- abstract stop(): void;
11
- generate(): Promise<void>;
12
- protected abstract generateImpl(options: GeneratorOptions): Promise<void>;
13
- setOptions(options: GeneratorOptions): void;
14
- setBinaryPaths(binaryPaths: BinaryPaths): void;
15
- /**
16
- * Returns the pretty name of the generator specified in the manifest (e.g.,
17
- * "Prisma Client"), or, if the former is not defined, the generator's
18
- * provider name (e.g., "prisma-client-js") as a fallback.
19
- */
20
- getPrettyName(): string;
21
- /**
22
- * Returns the provider name, parsed and resolved from environment variable
23
- * if necessary.
24
- */
25
- getProvider(): string;
26
- }
27
- export declare class JsonRpcGenerator extends Generator {
28
- #private;
29
- constructor(executablePath: string, config: GeneratorConfig, isNode?: boolean);
30
- protected initImpl(): Promise<void>;
31
- protected getManifest(): Promise<GeneratorManifest | null>;
32
- protected generateImpl(options: GeneratorOptions): Promise<void>;
33
- stop(): void;
34
- }
35
- export declare class InProcessGenerator extends Generator {
36
- #private;
37
- constructor(config: GeneratorConfig, generator: IGenerator);
38
- protected initImpl(): Promise<void>;
39
- protected getManifest(): Promise<GeneratorManifest | null>;
40
- protected generateImpl(options: GeneratorOptions): Promise<void>;
41
- stop(): void;
42
- }
@@ -1,5 +0,0 @@
1
- export declare class WasmPanicRegistry {
2
- private message;
3
- get(): string;
4
- private set_message;
5
- }
@@ -1,5 +0,0 @@
1
- import type { ErrorCapturingSqlDriverAdapterFactory } from '@prisma/driver-adapter-utils';
2
- import type { ConstructorOptions, SchemaEngine } from '@prisma/schema-engine-wasm';
3
- export declare const wasmSchemaEngineLoader: {
4
- loadSchemaEngine(input: ConstructorOptions, debug: (arg: string) => void, adapter: ErrorCapturingSqlDriverAdapterFactory): Promise<SchemaEngine>;
5
- };
@@ -1,11 +0,0 @@
1
- /**
2
- * Unknown command
3
- */
4
- export declare function unknownCommand(helpTemplate: string, cmd: string): HelpError;
5
- /**
6
- * Custom help error used to display help
7
- * errors without printing a stack trace
8
- */
9
- export declare class HelpError extends Error {
10
- constructor(msg: string);
11
- }
@@ -1,18 +0,0 @@
1
- import { SchemaContext } from '..';
2
- /**
3
- * Get the message to display when a command is forbidden with a data proxy flag
4
- * @param command the cli command (eg. db push)
5
- * @returns
6
- */
7
- export declare const forbiddenCmdWithDataProxyFlagMessage: (command: string) => string;
8
- /**
9
- * Check that the data proxy cannot be used through the given urls and schema contexts
10
- * @param command the cli command (eg. db push)
11
- * @param urls list of urls to check
12
- * @param schemaContexts list of schema contexts to check
13
- */
14
- export declare function checkUnsupportedDataProxy({ cmd, schemaContext, urls, }: {
15
- cmd: string;
16
- schemaContext?: SchemaContext;
17
- urls?: (string | undefined)[];
18
- }): void;
@@ -1,22 +0,0 @@
1
- import { PrismaConfigInternal } from '@prisma/config';
2
- /**
3
- * Get the message to display when a command is forbidden with a data proxy flag
4
- * @param command the cli command (eg. db push)
5
- * @returns
6
- */
7
- export declare const forbiddenCmdFlagWithSchemaEngineWasm: ({ cmd, flag }: {
8
- cmd: string;
9
- flag: string;
10
- }) => string;
11
- /**
12
- * Check that the data proxy cannot be used through the given urls and schema contexts
13
- * @param command the cli command (eg. db push)
14
- * @param urls list of urls to check
15
- * @param schemaContexts list of schema contexts to check
16
- */
17
- export declare function checkUnsupportedSchemaEngineWasm({ cmd, config, args, flags, }: {
18
- cmd: string;
19
- config: PrismaConfigInternal<any>;
20
- args: Record<string, unknown>;
21
- flags: Array<string>;
22
- }): void;
@@ -1,7 +0,0 @@
1
- import { SchemaContext } from './schemaContext';
2
- export type DirectoryConfig = {
3
- viewsDirPath: string;
4
- typedSqlDirPath: string;
5
- migrationsDirPath: string;
6
- };
7
- export declare function inferDirectoryConfig(schemaContext?: SchemaContext | null, cwd?: string): DirectoryConfig;
@@ -1,7 +0,0 @@
1
- import type { Generator } from '../Generator';
2
- /**
3
- * Creates and formats the success message for the given generator to print to
4
- * the console after generation finishes.
5
- * @param time time in milliseconds it took for the generator to run.
6
- */
7
- export declare function getGeneratorSuccessMessage(generator: Generator, time: number): string;
@@ -1 +0,0 @@
1
- export declare function getTypescriptVersion(): Promise<string>;
@@ -1,10 +0,0 @@
1
- /**
2
- * Get a unique identifier for the project by hashing
3
- * the directory with `schema.prisma`
4
- */
5
- export declare function getProjectHash(schemaPathFromArgs: string | undefined, schemaPathFromConfig: string | undefined): Promise<string>;
6
- /**
7
- * Get a unique identifier for the CLI installation path
8
- * which can be either global or local (in project's node_modules)
9
- */
10
- export declare function getCLIPathHash(): string;
@@ -1,59 +0,0 @@
1
- import { DataSource, GeneratorConfig } from '@prisma/generator';
2
- import { GetSchemaResult, LoadedFile } from '@prisma/schema-files-loader';
3
- export type SchemaContext = {
4
- /**
5
- * All loaded schema files and their paths.
6
- */
7
- schemaFiles: LoadedFile[];
8
- /**
9
- * The root directory of the schema files.
10
- * Either set explicitly from a schema folder based config or the parent directory of the schema.prisma file.
11
- */
12
- schemaRootDir: string;
13
- /**
14
- * The directory of the schema.prisma file that contains the datasource block.
15
- * Some relative paths like SQLite paths or SSL file paths are resolved relative to it.
16
- */
17
- primaryDatasourceDirectory: string;
18
- /**
19
- * The path that shall be printed in user facing logs messages informing them from where the schema was loaded.
20
- */
21
- loadedFromPathForLogMessages: string;
22
- /**
23
- * The datasource extracted from the Prisma schema. So far we only support a single datasource block.
24
- */
25
- primaryDatasource: DataSource | undefined;
26
- /**
27
- * Warnings that were raised during Prisma schema parsing.
28
- */
29
- warnings: string[] | [];
30
- /**
31
- * The datasources extracted from the Prisma schema. Prefer to use primaryDatasource for most cases.
32
- */
33
- datasources: DataSource[] | [];
34
- /**
35
- * The generators extracted from the Prisma schema.
36
- */
37
- generators: GeneratorConfig[] | [];
38
- schemaPath: string;
39
- };
40
- type LoadSchemaContextOptions = {
41
- schemaPathFromArg?: string;
42
- schemaPathFromConfig?: string;
43
- printLoadMessage?: boolean;
44
- ignoreEnvVarErrors?: boolean;
45
- allowNull?: boolean;
46
- schemaPathArgumentName?: string;
47
- cwd?: string;
48
- };
49
- export declare function loadSchemaContext(opts: LoadSchemaContextOptions & {
50
- allowNull: true;
51
- }): Promise<SchemaContext | null>;
52
- export declare function loadSchemaContext(opts?: LoadSchemaContextOptions): Promise<SchemaContext>;
53
- export declare function processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors, cwd, }: {
54
- schemaResult: GetSchemaResult;
55
- printLoadMessage?: boolean;
56
- ignoreEnvVarErrors?: boolean;
57
- cwd?: string;
58
- }): Promise<SchemaContext>;
59
- export {};
@@ -1,47 +0,0 @@
1
- import type { PrismaConfigInternal } from '@prisma/config';
2
- /**
3
- * Command interface
4
- */
5
- export interface Command {
6
- parse(argv: string[], config: PrismaConfigInternal): Promise<string | Error>;
7
- }
8
- /**
9
- * Commands
10
- */
11
- export type Commands = {
12
- [command: string]: Command;
13
- };
14
- export type Dictionary<T> = {
15
- [key: string]: T;
16
- };
17
- export type GeneratorConfig = {
18
- output: string | null;
19
- name: string;
20
- provider: string;
21
- config: Dictionary<string>;
22
- binaryTargets: string[];
23
- pinnedBinaryTargets?: string | null;
24
- };
25
- export type GeneratorOptions = {
26
- generator: GeneratorConfig;
27
- otherGenerators: GeneratorConfig[];
28
- cwd: string;
29
- dmmf: any;
30
- datasources: any;
31
- datamodel: string;
32
- };
33
- export type GeneratorFunction = (options: GeneratorOptions) => Promise<string>;
34
- export type GeneratorDefinition = {
35
- prettyName?: string;
36
- generate: GeneratorFunction;
37
- defaultOutput: string;
38
- };
39
- export type GeneratorDefinitionWithPackage = {
40
- definition: GeneratorDefinition;
41
- packagePath: string;
42
- };
43
- export type CompiledGeneratorDefinition = {
44
- prettyName?: string;
45
- output?: string | null;
46
- generate: () => Promise<string>;
47
- };
@@ -1,13 +0,0 @@
1
- import Arg from 'arg';
2
- /**
3
- * format
4
- */
5
- export declare function format(input?: string): string;
6
- /**
7
- * Wrap arg to return an error instead of throwing
8
- */
9
- export declare function arg<T extends Arg.Spec>(argv: string[], spec: T, stopAtPositional?: boolean, permissive?: boolean): Arg.Result<T> | Error;
10
- /**
11
- * Check if result is an error
12
- */
13
- export declare function isError(result: any): result is Error;
@@ -1,8 +0,0 @@
1
- import type { GeneratorConfig } from '@prisma/generator';
2
- export declare enum ClientEngineType {
3
- Library = "library",
4
- Binary = "binary",
5
- Client = "client"
6
- }
7
- export declare const DEFAULT_CLIENT_ENGINE_TYPE = ClientEngineType.Library;
8
- export declare function getClientEngineType(generatorConfig?: GeneratorConfig): ClientEngineType;
@@ -1,10 +0,0 @@
1
- import type { ConnectorType } from '@prisma/generator';
2
- import type { DatabaseCredentials } from './types';
3
- export declare function credentialsToUri(credentials: DatabaseCredentials): string;
4
- export declare function uriToCredentials(connectionString: string): DatabaseCredentials;
5
- /**
6
- * Convert a protocol to the equivalent database connector type.
7
- * Throws an error if the protocol is not recognized.
8
- * @param protocol e.g., 'postgres:'
9
- */
10
- export declare function protocolToConnectorType(protocol: string): ConnectorType;
@@ -1,35 +0,0 @@
1
- import type { DotenvConfigOutput } from 'dotenv';
2
- /**
3
- * Modified version of https://github.com/motdotla/dotenv-expand
4
- * Our version does only expand ${ENV} - curly braces but not without curly braces
5
- *
6
- * Original License from https://github.com/motdotla/dotenv-expand/blob/de9e5cb0215495452f475f5be4dea1580b8217cd/LICENSE
7
- * Copyright (c) 2016, Scott Motte
8
- * All rights reserved.
9
- *
10
- * Redistribution and use in source and binary forms, with or without
11
- * modification, are permitted provided that the following conditions are met:
12
- *
13
- * * Redistributions of source code must retain the above copyright notice, this
14
- * list of conditions and the following disclaimer.
15
- *
16
- * * Redistributions in binary form must reproduce the above copyright notice,
17
- * this list of conditions and the following disclaimer in the documentation
18
- * and/or other materials provided with the distribution.
19
- *
20
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
- */
31
- export declare function dotenvExpand(config: DotenvConfigOutput & {
32
- ignoreProcessEnv?: boolean;
33
- }): DotenvConfigOutput & {
34
- ignoreProcessEnv?: boolean | undefined;
35
- };
@@ -1,4 +0,0 @@
1
- /**
2
- * Adds `Prisma CLI Version : x.x.x` at the bottom of the error output.
3
- */
4
- export declare function addVersionDetailsToErrorMessage(message: string): string;
@@ -1,22 +0,0 @@
1
- import { type MultipleSchemas } from '../utils/schemaFileInput';
2
- type FormatSchemaParams = {
3
- schemas: MultipleSchemas;
4
- };
5
- export declare function formatSchema({ schemas }: FormatSchemaParams, inputFormattingOptions?: Partial<DocumentFormattingParams['options']>): Promise<MultipleSchemas>;
6
- type DocumentUri = string;
7
- type TextDocument = {
8
- /**
9
- * The associated URI for this document. Most documents have the __file__-scheme, indicating that they
10
- * represent files on disk. However, some documents may have other schemes indicating that they are not
11
- * available on disk.
12
- */
13
- readonly uri: DocumentUri;
14
- };
15
- type DocumentFormattingParams = {
16
- textDocument: TextDocument;
17
- options: {
18
- tabSize: number;
19
- insertSpaces: boolean;
20
- };
21
- };
22
- export {};
@@ -1,31 +0,0 @@
1
- import type { DataSource, EnvValue, GeneratorConfig } from '@prisma/generator';
2
- import { type SchemaFileInput } from '../utils/schemaFileInput';
3
- import { QueryEngineErrorInit } from './queryEngineCommons';
4
- export interface GetConfigResponse {
5
- config: ConfigMetaFormat;
6
- errors: GetConfigValidationError[];
7
- }
8
- export interface ConfigMetaFormat {
9
- datasources: DataSource[] | [];
10
- generators: GeneratorConfig[] | [];
11
- warnings: string[] | [];
12
- }
13
- interface GetConfigValidationError {
14
- fileName: string | null;
15
- message: string;
16
- }
17
- export type GetConfigOptions = {
18
- datamodel: SchemaFileInput;
19
- ignoreEnvVarErrors?: boolean;
20
- };
21
- export declare class GetConfigError extends Error {
22
- constructor(params: QueryEngineErrorInit);
23
- }
24
- export declare function getEffectiveUrl(ds: DataSource): EnvValue;
25
- export declare function getDirectUrl(ds: DataSource): EnvValue | undefined;
26
- export declare function resolveUrl(envValue: EnvValue | undefined): string | undefined;
27
- /**
28
- * Wasm'd version of `getConfig`.
29
- */
30
- export declare function getConfig(options: GetConfigOptions): Promise<ConfigMetaFormat>;
31
- export {};
@@ -1,20 +0,0 @@
1
- import type * as DMMF from '@prisma/dmmf';
2
- import type { DataSource, GeneratorConfig } from '@prisma/generator';
3
- import { type SchemaFileInput } from '../utils/schemaFileInput';
4
- import { QueryEngineErrorInit } from './queryEngineCommons';
5
- export interface ConfigMetaFormat {
6
- datasources: DataSource[];
7
- generators: GeneratorConfig[];
8
- warnings: string[];
9
- }
10
- export type GetDMMFOptions = {
11
- datamodel: SchemaFileInput;
12
- previewFeatures?: string[];
13
- };
14
- export declare class GetDmmfError extends Error {
15
- constructor(params: QueryEngineErrorInit);
16
- }
17
- /**
18
- * Wasm'd version of `getDMMF`.
19
- */
20
- export declare function getDMMF(options: GetDMMFOptions): Promise<DMMF.Document>;
@@ -1,4 +0,0 @@
1
- import { BinaryType } from '@prisma/fetch-engine';
2
- import * as TE from 'fp-ts/TaskEither';
3
- export declare function getEngineVersion(enginePath?: string, binaryName?: BinaryType): Promise<string>;
4
- export declare function safeGetEngineVersion(enginePath?: string, binaryName?: BinaryType): TE.TaskEither<Error, string>;
@@ -1,25 +0,0 @@
1
- import { BinaryType } from '@prisma/fetch-engine';
2
- import * as E from 'fp-ts/Either';
3
- import * as O from 'fp-ts/Option';
4
- /**
5
- * Both an engine binary and a library might be resolved from and environment variable indicating a path.
6
- * We first try to retrieve the engines' path from an env var; if it fails, we fall back to `safeResolveBinary`.
7
- * If both fail, we return an error.
8
- * Even if we resolve a path, retrieving the version might fail.
9
- */
10
- export type EngineInfo = {
11
- fromEnvVar: O.Option<string>;
12
- path: E.Either<Error, string>;
13
- version: E.Either<Error, string>;
14
- };
15
- export type BinaryMatrix<T> = {
16
- 'query-engine': T;
17
- 'schema-engine': T;
18
- };
19
- export type BinaryInfoMatrix = BinaryMatrix<EngineInfo>;
20
- export declare function getEnginesMetaInfo(): Promise<readonly [{
21
- 'query-engine': string;
22
- 'schema-engine': string;
23
- }[], Error[]]>;
24
- export declare function getEnginesInfo(enginesInfo: EngineInfo): readonly [string, Error[]];
25
- export declare function resolveEngine(binaryName: BinaryType): Promise<EngineInfo>;
@@ -1,10 +0,0 @@
1
- export { formatSchema } from './formatSchema';
2
- export type { ConfigMetaFormat } from './getConfig';
3
- export { getConfig, getDirectUrl, getEffectiveUrl } from './getConfig';
4
- export type { GetDMMFOptions } from './getDmmf';
5
- export { getDMMF } from './getDmmf';
6
- export { getEnginesMetaInfo } from './getEnginesMetaInfo';
7
- export { getEngineVersion } from './getEngineVersion';
8
- export { getLintWarningsAsText, handleLintPanic, lintSchema } from './lintSchema';
9
- export { mergeSchemas } from './mergeSchemas';
10
- export { validate } from './validate';
@@ -1,26 +0,0 @@
1
- import { type MultipleSchemas } from '../utils/schemaFileInput';
2
- type LintSchemaParams = {
3
- schemas: MultipleSchemas;
4
- };
5
- type LintDiagnosticBase = {
6
- start: number;
7
- end: number;
8
- text: string;
9
- };
10
- export type LintWarning = {
11
- is_warning: true;
12
- } & LintDiagnosticBase;
13
- export type LintError = {
14
- is_warning: false;
15
- } & LintDiagnosticBase;
16
- export type LintDiagnostic = LintWarning | LintError;
17
- /**
18
- * Diagnose the given schema, returning a list either errors or warnings.
19
- * This function may panic, but it won't throw any standard error.
20
- */
21
- export declare function lintSchema({ schemas }: LintSchemaParams): LintDiagnostic[];
22
- export declare function handleLintPanic<T>(tryCb: () => T): T;
23
- export declare function getLintWarnings(lintDiagnostics: LintDiagnostic[]): LintWarning[];
24
- export declare function getLintWarningsAsText(lintDiagnostics: LintDiagnostic[]): string;
25
- export declare function warningToString(warning: LintDiagnostic): string;
26
- export {};
@@ -1,12 +0,0 @@
1
- import { type MultipleSchemas } from '../utils/schemaFileInput';
2
- import { QueryEngineErrorInit } from './queryEngineCommons';
3
- export type MergeSchemasOptions = {
4
- schemas: MultipleSchemas;
5
- };
6
- export declare class MergeSchemasError extends Error {
7
- constructor(params: QueryEngineErrorInit);
8
- }
9
- /**
10
- * Wasm'd version of `merge_schemas`.
11
- */
12
- export declare function mergeSchemas(options: MergeSchemasOptions): string;
@@ -1,31 +0,0 @@
1
- import * as TE from 'fp-ts/TaskEither';
2
- export declare function unlinkTempDatamodelPath(options: {
3
- datamodelPath?: string;
4
- }, tempDatamodelPath: string | undefined): TE.TaskEither<{
5
- type: string;
6
- reason: string;
7
- error: unknown;
8
- }, void>;
9
- export declare const createDebugErrorType: (debug: (formatter: any, ...args: any[]) => void, fnName: string) => ({ type, reason, error }: {
10
- type: string;
11
- reason: string;
12
- error: Error;
13
- }) => void;
14
- export declare function createSchemaValidationError(reason: string): string;
15
- export type QueryEngineErrorInit = {
16
- reason: string;
17
- message: string;
18
- } & ({
19
- readonly _tag: 'parsed';
20
- errorCode?: string;
21
- } | {
22
- readonly _tag: 'unparsed';
23
- });
24
- export type ParseQueryEngineError = {
25
- errorOutput: string;
26
- reason: string;
27
- };
28
- /**
29
- * Parse the error output of getConfig / getDmmf, which follow the format convention of the query-engine methods.
30
- */
31
- export declare function parseQueryEngineError({ errorOutput, reason }: ParseQueryEngineError): QueryEngineErrorInit;
@@ -1 +0,0 @@
1
- export declare function relativizePathInPSLError(error: string): string;
@@ -1,12 +0,0 @@
1
- import { type MultipleSchemas } from '../utils/schemaFileInput';
2
- import { QueryEngineErrorInit } from './queryEngineCommons';
3
- export type ValidateOptions = {
4
- schemas: MultipleSchemas;
5
- };
6
- export declare class ValidateError extends Error {
7
- constructor(params: QueryEngineErrorInit);
8
- }
9
- /**
10
- * Wasm'd version of `validate`.
11
- */
12
- export declare function validate(options: ValidateOptions): void;
@@ -1,25 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="node" />
3
- import { ErrorArea } from './panic';
4
- export declare enum ErrorKind {
5
- JS_ERROR = "JS_ERROR",
6
- RUST_PANIC = "RUST_PANIC"
7
- }
8
- export interface CreateErrorReportInput {
9
- area: ErrorArea;
10
- binaryVersion: string;
11
- cliVersion: string;
12
- command: string;
13
- jsStackTrace: string;
14
- kind: ErrorKind;
15
- liftRequest?: string;
16
- operatingSystem: string;
17
- platform: string;
18
- rustStackTrace: string;
19
- fingerprint?: string;
20
- sqlDump?: string;
21
- dbVersion?: string;
22
- }
23
- export declare function uploadZip(zip: Buffer, url: string): Promise<any>;
24
- export declare function createErrorReport(data: CreateErrorReportInput): Promise<string>;
25
- export declare function makeErrorReportCompleted(signedUrl: string): Promise<number>;
@@ -1,71 +0,0 @@
1
- import type { BinaryTargetsEnvValue, EngineType, Generator as IGenerator, GeneratorConfig, SqlQueryOutput } from '@prisma/generator';
2
- import type { BinaryTarget } from '@prisma/get-platform';
3
- import { SchemaContext } from '..';
4
- import { Generator } from '../Generator';
5
- type BinaryPathsOverride = {
6
- [P in EngineType]?: string;
7
- };
8
- export type GeneratorRegistryEntry = {
9
- type: 'rpc';
10
- generatorPath: string;
11
- isNode?: boolean;
12
- } | {
13
- type: 'in-process';
14
- generator: IGenerator;
15
- };
16
- export type GeneratorRegistry = Record<string, GeneratorRegistryEntry>;
17
- export type ProviderAliases = {
18
- [alias: string]: {
19
- generatorPath: string;
20
- isNode?: boolean;
21
- };
22
- };
23
- export type GetGeneratorOptions = {
24
- /** @deprecated Pass a schemaContext instead. Kept for compatibility with prisma studio. */
25
- schemaPath?: string;
26
- schemaContext?: SchemaContext;
27
- registry: GeneratorRegistry;
28
- /** @deprecated Use `registry` instead. Kept for compatibility with Prisma Studio. */
29
- providerAliases?: ProviderAliases;
30
- version?: string;
31
- printDownloadProgress?: boolean;
32
- overrideGenerators?: GeneratorConfig[];
33
- skipDownload?: boolean;
34
- binaryPathsOverride?: BinaryPathsOverride;
35
- generatorNames?: string[];
36
- postinstall?: boolean;
37
- noEngine?: boolean;
38
- allowNoModels?: boolean;
39
- typedSql?: SqlQueryOutput[];
40
- };
41
- /**
42
- * Makes sure that all generators have the binaries they deserve and returns a
43
- * `Generator` class per generator defined in the schema.prisma file.
44
- * In other words, this is basically a generator factory function.
45
- */
46
- export declare function getGenerators(options: GetGeneratorOptions): Promise<Generator[]>;
47
- type NeededVersions = {
48
- [key: string]: {
49
- engines: EngineType[];
50
- binaryTargets: BinaryTargetsEnvValue[];
51
- };
52
- };
53
- export type GetBinaryPathsByVersionInput = {
54
- neededVersions: NeededVersions;
55
- binaryTarget: BinaryTarget;
56
- version?: string;
57
- printDownloadProgress?: boolean;
58
- skipDownload?: boolean;
59
- binaryPathsOverride?: BinaryPathsOverride;
60
- };
61
- /**
62
- * Shortcut for getGenerators, if there is only one generator defined. Useful for testing.
63
- * @param schemaPath path to schema.prisma
64
- * @param aliases Aliases like `photonjs` -> `node_modules/photonjs/gen.js`
65
- * @param version Version of the binary, commit hash of https://github.com/prisma/prisma-engine/commits/master
66
- * @param printDownloadProgress `boolean` to print download progress or not
67
- */
68
- export declare function getGenerator(options: GetGeneratorOptions): Promise<Generator>;
69
- export declare function skipIndex<T = any>(arr: T[], index: number): T[];
70
- export declare const knownBinaryTargets: BinaryTarget[];
71
- export {};
@@ -1,3 +0,0 @@
1
- import { BinaryType } from '@prisma/fetch-engine';
2
- import type { EngineType } from '@prisma/generator';
3
- export declare function binaryTypeToEngineType(binaryType: BinaryType): EngineType;
@@ -1,3 +0,0 @@
1
- import { BinaryType } from '@prisma/fetch-engine';
2
- import type { EngineType } from '@prisma/generator';
3
- export declare function engineTypeToBinaryType(engineType: EngineType): BinaryType;
@@ -1,3 +0,0 @@
1
- import { BinaryTargetsEnvValue } from '@prisma/generator';
2
- import { BinaryTarget } from '@prisma/get-platform';
3
- export declare function fixBinaryTargets(schemaBinaryTargets: BinaryTargetsEnvValue[], runtimeBinaryTarget: BinaryTarget | string): BinaryTargetsEnvValue[];