@prisma/migrate 6.6.0-dev.10 → 6.6.0-dev.100
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.
- package/dist/CLI.js +3 -3
- package/dist/Migrate.js +9 -6
- package/dist/SchemaEngine.js +0 -28
- package/dist/SchemaEngineCLI.js +29 -0
- package/dist/{utils/getSchemaPathAndPrint.js → SchemaEngineWasm.js} +8 -8
- package/dist/bin.js +52 -50
- package/dist/chunk-23DZXSTI.js +62 -0
- package/dist/{chunk-WWAWV7DQ.js → chunk-2ESYSVXG.js} +3 -27
- package/dist/{chunk-LKTTJWFT.js → chunk-2R6DII47.js} +5 -5
- package/dist/chunk-33LPBNDX.js +1399 -0
- package/dist/{chunk-MKK3GSDF.js → chunk-344G2PKM.js} +9 -9
- package/dist/{chunk-V3ZMNXZC.js → chunk-5LKIRKDL.js} +307 -382
- package/dist/{chunk-LOGAFLCN.js → chunk-5R44VVVX.js} +29 -29
- package/dist/{chunk-DJMFXNR4.js → chunk-74LUB4XX.js} +56 -57
- package/dist/{chunk-GG54LOYV.js → chunk-A4FQW4A5.js} +54 -50
- package/dist/{chunk-RP2N6UXA.js → chunk-AI6DH66U.js} +6 -6
- package/dist/{chunk-A6PMXMMT.js → chunk-AUGZZ6RT.js} +105 -13
- package/dist/{chunk-G2XUUMKH.js → chunk-B4SUSDC2.js} +31 -39
- package/dist/{chunk-N4XTKFY6.js → chunk-CLSF7VUT.js} +42 -38
- package/dist/{chunk-2B4IAB6L.js → chunk-CNCVJ2IN.js} +377 -532
- package/dist/{chunk-IR55GBON.js → chunk-CU5UT2ED.js} +19 -18
- package/dist/{chunk-CQZFVAXC.js → chunk-CYEVXXRH.js} +51 -47
- package/dist/{chunk-W2SZNLK4.js → chunk-EJG7GKM7.js} +37 -39
- package/dist/{chunk-5PSO7BDO.js → chunk-EJUXYFV3.js} +15 -15
- package/dist/{chunk-KS7IEA6Z.js → chunk-HIDSEBVV.js} +55 -54
- package/dist/{chunk-ZOEKRXDP.js → chunk-I3LT2PO3.js} +35 -57
- package/dist/{chunk-N3KYWSX2.js → chunk-IEEJZC3B.js} +56 -49
- package/dist/{chunk-MCWCB2AX.js → chunk-IINN7QUV.js} +170 -643
- package/dist/chunk-IK3BVD3Y.js +233 -0
- package/dist/{chunk-255BRND3.js → chunk-KRQEFTDT.js} +6 -6
- package/dist/{chunk-HCBZB4XC.js → chunk-KW633S3Y.js} +56 -52
- package/dist/{chunk-VVKOFN3Y.js → chunk-LLO7YF56.js} +44 -46
- package/dist/{chunk-VZ23KD5C.js → chunk-NGQA5JTN.js} +8 -10
- package/dist/{chunk-MATFO4ZW.js → chunk-OEWQACEH.js} +38 -39
- package/dist/chunk-PQKZ53DW.js +76 -0
- package/dist/{chunk-EGPJABTW.js → chunk-QVMYNWAN.js} +257 -103
- package/dist/{chunk-WI2A2TQE.js → chunk-SO3VXCZV.js} +93 -92
- package/dist/{chunk-V5TUSOJX.js → chunk-SQKGZVG3.js} +45 -45
- package/dist/chunk-URKH6SE2.js +479 -0
- package/dist/{chunk-DLLXDCI2.js → chunk-VAJ4VX67.js} +5 -6
- package/dist/{chunk-5GVIOOXU.js → chunk-W5SQWSLC.js} +378 -533
- package/dist/{chunk-Q3ZLC44N.js → chunk-YBS5GSRF.js} +64 -69
- package/dist/{chunk-OCQGHQED.js → chunk-YBX7R3MT.js} +12 -12
- package/dist/chunk-YSWLN2IJ.js +890 -0
- package/dist/commands/DbCommand.js +3 -3
- package/dist/commands/DbDrop.js +4 -5
- package/dist/commands/DbExecute.js +10 -7
- package/dist/commands/DbPull.js +17 -12
- package/dist/commands/DbPush.js +12 -10
- package/dist/commands/DbSeed.js +4 -5
- package/dist/commands/MigrateCommand.js +3 -3
- package/dist/commands/MigrateDeploy.js +14 -12
- package/dist/commands/MigrateDev.js +17 -15
- package/dist/commands/MigrateDiff.js +13 -10
- package/dist/commands/MigrateReset.js +16 -14
- package/dist/commands/MigrateResolve.js +12 -10
- package/dist/commands/MigrateStatus.js +12 -10
- package/dist/index.js +58 -57
- package/dist/internals/src/Generator.d.ts +23 -5
- package/dist/internals/src/WasmSchemaEngineLoader.d.ts +5 -0
- package/dist/internals/src/cli/checkUnsupportedDataProxy.d.ts +12 -17
- package/dist/internals/src/cli/directoryConfig.d.ts +7 -0
- package/dist/internals/src/cli/getSchema.d.ts +3 -28
- package/dist/internals/src/cli/hashes.d.ts +1 -2
- package/dist/internals/src/cli/schemaContext.d.ts +59 -0
- package/dist/internals/src/client/getClientEngineType.d.ts +1 -1
- package/dist/internals/src/convertCredentials.d.ts +1 -1
- package/dist/internals/src/engine-commands/getConfig.d.ts +1 -5
- package/dist/internals/src/engine-commands/getDmmf.d.ts +3 -6
- package/dist/internals/src/engine-commands/lintSchema.d.ts +1 -1
- package/dist/internals/src/errorReporting.d.ts +0 -1
- package/dist/internals/src/get-generators/getGenerators.d.ts +22 -9
- package/dist/internals/src/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/fixBinaryTargets.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
- package/dist/internals/src/get-generators/utils/printGeneratorConfig.d.ts +1 -1
- package/dist/internals/src/index.d.ts +9 -8
- package/dist/internals/src/migrateTypes.d.ts +63 -0
- package/dist/internals/src/panic.d.ts +1 -4
- package/dist/internals/src/resolvePkg.d.ts +7 -0
- package/dist/internals/src/types.d.ts +1 -1
- package/dist/internals/src/utils/extractPreviewFeatures.d.ts +2 -2
- package/dist/internals/src/utils/getEnvPaths.d.ts +1 -1
- package/dist/internals/src/utils/parseEnvValue.d.ts +1 -1
- package/dist/internals/src/utils/schemaFileInput.d.ts +0 -4
- package/dist/internals/src/utils/toSchemasContainer.d.ts +2 -3
- package/dist/internals/src/wasm.d.ts +3 -1
- package/dist/migrate/src/Migrate.d.ts +18 -7
- package/dist/migrate/src/SchemaEngine.d.ts +20 -50
- package/dist/migrate/src/SchemaEngineCLI.d.ts +139 -0
- package/dist/migrate/src/SchemaEngineWasm.d.ts +134 -0
- package/dist/migrate/src/commands/DbExecute.d.ts +1 -1
- package/dist/migrate/src/commands/DbPull.d.ts +1 -1
- package/dist/migrate/src/commands/DbPush.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateDeploy.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateDev.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateDiff.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateReset.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateResolve.d.ts +1 -1
- package/dist/migrate/src/commands/MigrateStatus.d.ts +1 -1
- package/dist/migrate/src/index.d.ts +2 -2
- package/dist/migrate/src/types.d.ts +19 -19
- package/dist/migrate/src/utils/createMigration.d.ts +21 -0
- package/dist/migrate/src/utils/ensureDatabaseExists.d.ts +4 -6
- package/dist/migrate/src/utils/introspectSql.d.ts +3 -2
- package/dist/migrate/src/utils/listMigrations.d.ts +9 -0
- package/dist/migrate/src/utils/printDatasources.d.ts +1 -1
- package/dist/migrate/src/utils/seed.d.ts +0 -2
- package/dist/migrate/src/views/handleViewsIO.d.ts +2 -2
- package/dist/{multipart-parser-54WEFGGN-NLZG56KM.js → multipart-parser-ASKQAOL4-WZ47HU6G.js} +92 -125
- package/dist/{multipart-parser-NDLECNMN.js → multipart-parser-QCI3Y5IB.js} +66 -68
- package/dist/types.js +1 -1
- package/dist/{typescript-WN4QH2CP.js → typescript-2LKASCMC.js} +33 -33
- package/dist/{typescript-AILDXN3I.js → typescript-H3AVJ6KX.js} +32 -32
- package/dist/utils/byline.js +1 -1
- package/dist/utils/captureStdout.js +3 -3
- package/dist/utils/countModelsAndTypes.js +1 -1
- package/dist/utils/createMigration.js +27 -0
- package/dist/utils/customColors.js +1 -1
- package/dist/utils/ensureDatabaseExists.js +7 -7
- package/dist/utils/errors.js +1 -1
- package/dist/utils/flagErrors.js +1 -1
- package/dist/utils/getDatabaseVersionSafe.js +10 -5
- package/dist/utils/handleEvaluateDataloss.js +1 -1
- package/dist/utils/introspectSql.js +10 -5
- package/dist/utils/isSchemaEmpty.js +1 -1
- package/dist/utils/listMigrations.js +25 -0
- package/dist/utils/now.js +1 -1
- package/dist/utils/printDatasource.js +1 -1
- package/dist/utils/printDatasources.js +5 -5
- package/dist/utils/printFiles.js +5 -5
- package/dist/utils/printIntrospectedSchema.js +1 -1
- package/dist/utils/printMigrationId.js +1 -1
- package/dist/utils/promptForMigrationName.js +3 -3
- package/dist/utils/removeSchemaFiles.js +1 -1
- package/dist/utils/replaceOrAddDatasource.js +1 -1
- package/dist/utils/replaceOrAddDatasource.test.js +1 -1
- package/dist/utils/saveSchemaFiles.js +1 -1
- package/dist/utils/seed.js +4 -7
- package/dist/utils/setupCockroach.js +3 -3
- package/dist/utils/setupMSSQL.js +1478 -707
- package/dist/utils/setupMongo.js +553 -552
- package/dist/utils/setupMysql.js +508 -563
- package/dist/utils/setupPostgres.js +3 -3
- package/dist/utils/spinner.js +4 -3
- package/dist/utils/test-handlePanic.js +1 -30
- package/dist/utils/unixSocket.js +1 -1
- package/dist/views/handleViewsIO.js +3 -3
- package/package.json +12 -11
- package/dist/chunk-GKDFIHM2.js +0 -45
- package/dist/chunk-J46BJQHT.js +0 -268
- package/dist/chunk-KOF4LGTS.js +0 -1817
- package/dist/chunk-YYPMC5FN.js +0 -1407
- package/dist/internals/src/get-generators/generatorResolvers/generatorResolvers.d.ts +0 -15
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.d.ts +0 -6
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.d.ts +0 -9
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.d.ts +0 -8
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.d.ts +0 -6
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.d.ts +0 -1
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.d.ts +0 -20
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.d.ts +0 -7
- package/dist/internals/src/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.d.ts +0 -20
- package/dist/internals/src/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +0 -10
|
@@ -1,31 +1,10 @@
|
|
|
1
1
|
import type { GetSchemaResult, SuccessfulLookupResult } from '@prisma/schema-files-loader';
|
|
2
|
-
import type { MultipleSchemas } from '../utils/schemaFileInput';
|
|
3
2
|
type PackageJsonLookupResult = SuccessfulLookupResult | {
|
|
4
3
|
ok: false;
|
|
5
4
|
error: {
|
|
6
5
|
kind: 'PackageJsonNotConfigured';
|
|
7
6
|
};
|
|
8
7
|
};
|
|
9
|
-
export type SchemaPathFromConfig = {
|
|
10
|
-
/**
|
|
11
|
-
* Tell Prisma to use a single `.prisma` schema file.
|
|
12
|
-
*/
|
|
13
|
-
kind: 'single';
|
|
14
|
-
/**
|
|
15
|
-
* The path to a single `.prisma` schema file.
|
|
16
|
-
*/
|
|
17
|
-
filePath: string;
|
|
18
|
-
} | {
|
|
19
|
-
/**
|
|
20
|
-
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
|
21
|
-
*/
|
|
22
|
-
kind: 'multi';
|
|
23
|
-
/**
|
|
24
|
-
* The path to a folder containing multiple `.prisma` schema files.
|
|
25
|
-
* All of the files in this folder will be used.
|
|
26
|
-
*/
|
|
27
|
-
folderPath: string;
|
|
28
|
-
};
|
|
29
8
|
export type GetSchemaOptions = {
|
|
30
9
|
cwd?: string;
|
|
31
10
|
argumentName?: string;
|
|
@@ -36,7 +15,7 @@ export type GetSchemaOptions = {
|
|
|
36
15
|
* @param schemaPathFromConfig
|
|
37
16
|
* @param opts
|
|
38
17
|
*/
|
|
39
|
-
export declare function getSchemaWithPath(schemaPathFromArgs?: string, schemaPathFromConfig?:
|
|
18
|
+
export declare function getSchemaWithPath(schemaPathFromArgs?: string, schemaPathFromConfig?: string, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult>;
|
|
40
19
|
/**
|
|
41
20
|
* Loads the schema, returns null if it is not found
|
|
42
21
|
* Throws an error if schema is specified explicitly in
|
|
@@ -47,7 +26,8 @@ export declare function getSchemaWithPath(schemaPathFromArgs?: string, schemaPat
|
|
|
47
26
|
* @param opts
|
|
48
27
|
* @returns
|
|
49
28
|
*/
|
|
50
|
-
export declare function getSchemaWithPathOptional(schemaPathFromArgs?: string, schemaPathFromConfig?:
|
|
29
|
+
export declare function getSchemaWithPathOptional(schemaPathFromArgs?: string, schemaPathFromConfig?: string, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult | null>;
|
|
30
|
+
export declare function printSchemaLoadedMessage(schemaPath: string): void;
|
|
51
31
|
export type PrismaConfig = {
|
|
52
32
|
schema?: string;
|
|
53
33
|
seed?: string;
|
|
@@ -57,9 +37,4 @@ export declare function getPrismaConfigFromPackageJson(cwd: string): Promise<{
|
|
|
57
37
|
packagePath: string;
|
|
58
38
|
} | null>;
|
|
59
39
|
export declare function getSchemaFromPackageJson(cwd: string): Promise<PackageJsonLookupResult>;
|
|
60
|
-
/**
|
|
61
|
-
* Small helper that returns the directory which contains the `schema.prisma` file
|
|
62
|
-
*/
|
|
63
|
-
export declare function getSchemaDir(schemaPathFromArgs?: string): Promise<string | null>;
|
|
64
|
-
export declare function getSchema(schemaPathFromArgs?: string, schemaPathFromConfig?: SchemaPathFromConfig): Promise<MultipleSchemas>;
|
|
65
40
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type SchemaPathFromConfig } from './getSchema';
|
|
2
1
|
/**
|
|
3
2
|
* Get a unique identifier for the project by hashing
|
|
4
3
|
* the directory with `schema.prisma`
|
|
5
4
|
*/
|
|
6
|
-
export declare function getProjectHash(schemaPathFromArgs: string | undefined, schemaPathFromConfig:
|
|
5
|
+
export declare function getProjectHash(schemaPathFromArgs: string | undefined, schemaPathFromConfig: string | undefined): Promise<string>;
|
|
7
6
|
/**
|
|
8
7
|
* Get a unique identifier for the CLI installation path
|
|
9
8
|
* which can be either global or local (in project's node_modules)
|
|
@@ -0,0 +1,59 @@
|
|
|
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,4 +1,4 @@
|
|
|
1
|
-
import type { ConnectorType } from '@prisma/generator
|
|
1
|
+
import type { ConnectorType } from '@prisma/generator';
|
|
2
2
|
import type { DatabaseCredentials } from './types';
|
|
3
3
|
export declare function credentialsToUri(credentials: DatabaseCredentials): string;
|
|
4
4
|
export declare function uriToCredentials(connectionString: string): DatabaseCredentials;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DataSource, EnvValue, GeneratorConfig } from '@prisma/generator
|
|
1
|
+
import type { DataSource, EnvValue, GeneratorConfig } from '@prisma/generator';
|
|
2
2
|
import { type SchemaFileInput } from '../utils/schemaFileInput';
|
|
3
3
|
import { QueryEngineErrorInit } from './queryEngineCommons';
|
|
4
4
|
export interface GetConfigResponse {
|
|
@@ -16,10 +16,6 @@ interface GetConfigValidationError {
|
|
|
16
16
|
}
|
|
17
17
|
export type GetConfigOptions = {
|
|
18
18
|
datamodel: SchemaFileInput;
|
|
19
|
-
cwd?: string;
|
|
20
|
-
prismaPath?: string;
|
|
21
|
-
datamodelPath?: string;
|
|
22
|
-
retry?: number;
|
|
23
19
|
ignoreEnvVarErrors?: boolean;
|
|
24
20
|
};
|
|
25
21
|
export declare class GetConfigError extends Error {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type * as DMMF from '@prisma/dmmf';
|
|
2
|
+
import type { DataSource, GeneratorConfig } from '@prisma/generator';
|
|
2
3
|
import { type SchemaFileInput } from '../utils/schemaFileInput';
|
|
3
4
|
import { QueryEngineErrorInit } from './queryEngineCommons';
|
|
4
5
|
export interface ConfigMetaFormat {
|
|
@@ -7,11 +8,7 @@ export interface ConfigMetaFormat {
|
|
|
7
8
|
warnings: string[];
|
|
8
9
|
}
|
|
9
10
|
export type GetDMMFOptions = {
|
|
10
|
-
datamodel
|
|
11
|
-
cwd?: string;
|
|
12
|
-
prismaPath?: string;
|
|
13
|
-
datamodelPath?: string;
|
|
14
|
-
retry?: number;
|
|
11
|
+
datamodel: SchemaFileInput;
|
|
15
12
|
previewFeatures?: string[];
|
|
16
13
|
};
|
|
17
14
|
export declare class GetDmmfError extends Error {
|
|
@@ -19,7 +19,7 @@ export type LintDiagnostic = LintWarning | LintError;
|
|
|
19
19
|
* This function may panic, but it won't throw any standard error.
|
|
20
20
|
*/
|
|
21
21
|
export declare function lintSchema({ schemas }: LintSchemaParams): LintDiagnostic[];
|
|
22
|
-
export declare function handleLintPanic<T>(tryCb: () => T
|
|
22
|
+
export declare function handleLintPanic<T>(tryCb: () => T): T;
|
|
23
23
|
export declare function getLintWarnings(lintDiagnostics: LintDiagnostic[]): LintWarning[];
|
|
24
24
|
export declare function getLintWarningsAsText(lintDiagnostics: LintDiagnostic[]): string;
|
|
25
25
|
export declare function warningToString(warning: LintDiagnostic): string;
|
|
@@ -1,17 +1,32 @@
|
|
|
1
|
-
import type { BinaryTargetsEnvValue, EngineType, GeneratorConfig, SqlQueryOutput } from '@prisma/generator
|
|
1
|
+
import type { BinaryTargetsEnvValue, EngineType, Generator as IGenerator, GeneratorConfig, SqlQueryOutput } from '@prisma/generator';
|
|
2
2
|
import type { BinaryTarget } from '@prisma/get-platform';
|
|
3
|
+
import { SchemaContext } from '..';
|
|
3
4
|
import { Generator } from '../Generator';
|
|
4
|
-
import type { GeneratorPaths } from './generatorResolvers/generatorResolvers';
|
|
5
|
-
export type ProviderAliases = {
|
|
6
|
-
[alias: string]: GeneratorPaths;
|
|
7
|
-
};
|
|
8
5
|
type BinaryPathsOverride = {
|
|
9
6
|
[P in EngineType]?: string;
|
|
10
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
|
+
};
|
|
11
23
|
export type GetGeneratorOptions = {
|
|
12
|
-
|
|
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. */
|
|
13
29
|
providerAliases?: ProviderAliases;
|
|
14
|
-
cliVersion?: string;
|
|
15
30
|
version?: string;
|
|
16
31
|
printDownloadProgress?: boolean;
|
|
17
32
|
overrideGenerators?: GeneratorConfig[];
|
|
@@ -27,8 +42,6 @@ export type GetGeneratorOptions = {
|
|
|
27
42
|
* Makes sure that all generators have the binaries they deserve and returns a
|
|
28
43
|
* `Generator` class per generator defined in the schema.prisma file.
|
|
29
44
|
* In other words, this is basically a generator factory function.
|
|
30
|
-
* @param schemaPath Path to schema.prisma
|
|
31
|
-
* @param aliases Aliases like `prisma-client-js` -> `node_modules/@prisma/client/generator-build/index.js`
|
|
32
45
|
*/
|
|
33
46
|
export declare function getGenerators(options: GetGeneratorOptions): Promise<Generator[]>;
|
|
34
47
|
type NeededVersions = {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { BinaryTargetsEnvValue } from '@prisma/generator
|
|
1
|
+
import { BinaryTargetsEnvValue } from '@prisma/generator';
|
|
2
2
|
import { BinaryTarget } from '@prisma/get-platform';
|
|
3
3
|
export declare function fixBinaryTargets(schemaBinaryTargets: BinaryTargetsEnvValue[], runtimeBinaryTarget: BinaryTarget | string): BinaryTargetsEnvValue[];
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BinaryPaths } from '@prisma/generator
|
|
1
|
+
import type { BinaryPaths } from '@prisma/generator';
|
|
2
2
|
import type { GetBinaryPathsByVersionInput } from '../getGenerators';
|
|
3
3
|
export declare function getBinaryPathsByVersion({ neededVersions, binaryTarget, version, printDownloadProgress, skipDownload, binaryPathsOverride, }: GetBinaryPathsByVersionInput): Promise<Record<string, BinaryPaths>>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { GeneratorManifest } from '@prisma/generator
|
|
1
|
+
import type { GeneratorManifest } from '@prisma/generator';
|
|
2
2
|
export declare function getEngineVersionForGenerator(manifest?: GeneratorManifest, defaultVersion?: string | undefined): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BinaryTargetsEnvValue, GeneratorConfig } from '@prisma/generator
|
|
1
|
+
import type { BinaryTargetsEnvValue, GeneratorConfig } from '@prisma/generator';
|
|
2
2
|
export declare function printGeneratorConfig(config: GeneratorConfig): string;
|
|
3
3
|
export declare class GeneratorConfigClass {
|
|
4
4
|
private readonly config;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { checkUnsupportedDataProxy } from './cli/checkUnsupportedDataProxy';
|
|
2
|
+
export { type DirectoryConfig, inferDirectoryConfig } from './cli/directoryConfig';
|
|
2
3
|
export { getGeneratorSuccessMessage } from './cli/getGeneratorSuccessMessage';
|
|
3
|
-
export { getPrismaConfigFromPackageJson,
|
|
4
|
+
export { getPrismaConfigFromPackageJson, type GetSchemaOptions, getSchemaWithPath, getSchemaWithPathOptional, printSchemaLoadedMessage, } from './cli/getSchema';
|
|
4
5
|
export { getTypescriptVersion } from './cli/getTypescriptVersion';
|
|
5
6
|
export { getCLIPathHash, getProjectHash } from './cli/hashes';
|
|
6
7
|
export { unknownCommand } from './cli/Help';
|
|
7
8
|
export { HelpError } from './cli/Help';
|
|
9
|
+
export { loadSchemaContext, processSchemaResult, type SchemaContext } from './cli/schemaContext';
|
|
8
10
|
export type { Command, Commands, CompiledGeneratorDefinition, Dictionary, GeneratorConfig, GeneratorDefinition, GeneratorDefinitionWithPackage, GeneratorFunction, GeneratorOptions, } from './cli/types';
|
|
9
11
|
export { arg, format, isError } from './cli/utils';
|
|
10
12
|
export { ClientEngineType, DEFAULT_CLIENT_ENGINE_TYPE, getClientEngineType } from './client/getClientEngineType';
|
|
@@ -13,19 +15,17 @@ export * from './engine-commands';
|
|
|
13
15
|
export { resolveUrl } from './engine-commands/getConfig';
|
|
14
16
|
export { relativizePathInPSLError } from './engine-commands/relativizePathInPSLError';
|
|
15
17
|
export { Generator } from './Generator';
|
|
16
|
-
export type
|
|
17
|
-
export { getPackageCmd } from './get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd';
|
|
18
|
-
export type { ProviderAliases } from './get-generators/getGenerators';
|
|
19
|
-
export { getGenerator, getGenerators } from './get-generators/getGenerators';
|
|
18
|
+
export { type GeneratorRegistry, type GeneratorRegistryEntry, getGenerator, getGenerators, } from './get-generators/getGenerators';
|
|
20
19
|
export { fixBinaryTargets } from './get-generators/utils/fixBinaryTargets';
|
|
21
20
|
export { printGeneratorConfig } from './get-generators/utils/printGeneratorConfig';
|
|
22
21
|
export { getPackedPackage } from './getPackedPackage';
|
|
23
22
|
export { highlightDatamodel, highlightSql, highlightTS } from './highlight/highlight';
|
|
24
23
|
export * as logger from './logger';
|
|
25
24
|
export type { MigrateTypes } from './migrateTypes';
|
|
26
|
-
export { ErrorArea, isRustPanic, RustPanic } from './panic';
|
|
25
|
+
export { ErrorArea, getWasmError, isRustPanic, isWasmPanic, RustPanic } from './panic';
|
|
27
26
|
export { BinaryType } from './resolveBinary';
|
|
28
27
|
export { engineEnvVarMap, resolveBinary } from './resolveBinary';
|
|
28
|
+
export { resolvePkg } from './resolvePkg';
|
|
29
29
|
export type { SchemaEngineLogLine } from './schemaEngineCommands';
|
|
30
30
|
export { canConnectToDatabase, createDatabase, dropDatabase } from './schemaEngineCommands';
|
|
31
31
|
export { SchemaEngineExitCode } from './schemaEngineCommands';
|
|
@@ -75,7 +75,7 @@ export { longestCommonPathPrefix, pathToPosix } from './utils/path';
|
|
|
75
75
|
export { pick } from './utils/pick';
|
|
76
76
|
export { printConfigWarnings } from './utils/printConfigWarnings';
|
|
77
77
|
export { isPrismaPostgres, PRISMA_POSTGRES_PROTOCOL, PRISMA_POSTGRES_PROVIDER } from './utils/prismaPostgres';
|
|
78
|
-
export {
|
|
78
|
+
export { extractSchemaContent, type SchemaFileInput } from './utils/schemaFileInput';
|
|
79
79
|
export { type MultipleSchemas } from './utils/schemaFileInput';
|
|
80
80
|
export { serializeQueryEngineName } from './utils/serializeQueryEngineName';
|
|
81
81
|
export { setClassName } from './utils/setClassName';
|
|
@@ -84,7 +84,8 @@ export { type LoadedEnv, tryLoadEnvs } from './utils/tryLoadEnvs';
|
|
|
84
84
|
export { vercelPkgPathRegex } from './utils/vercelPkgPathRegex';
|
|
85
85
|
export { warnOnce } from './warnOnce';
|
|
86
86
|
export * as wasm from './wasm';
|
|
87
|
-
export
|
|
87
|
+
export { wasmSchemaEngineLoader } from './WasmSchemaEngineLoader';
|
|
88
|
+
export type { EnvPaths } from '@prisma/generator';
|
|
88
89
|
export type { BinaryTarget } from '@prisma/get-platform';
|
|
89
90
|
export { getBinaryTargetForCurrentPlatform, getNodeAPIName } from '@prisma/get-platform';
|
|
90
91
|
export type { GetSchemaResult } from '@prisma/schema-files-loader';
|
|
@@ -1,4 +1,67 @@
|
|
|
1
1
|
export declare namespace MigrateTypes {
|
|
2
|
+
type MigrationDirectory = {
|
|
3
|
+
/**
|
|
4
|
+
* Relative path to a migration directory from `baseDir`.
|
|
5
|
+
* E.g., `./20201117144659_test`.
|
|
6
|
+
*/
|
|
7
|
+
path: string;
|
|
8
|
+
/**
|
|
9
|
+
* Description of the migration file in the directory.
|
|
10
|
+
*/
|
|
11
|
+
migrationFile: {
|
|
12
|
+
/**
|
|
13
|
+
* Relative path to the migration file from `path`.
|
|
14
|
+
*/
|
|
15
|
+
path: 'migration.sql';
|
|
16
|
+
/**
|
|
17
|
+
* Content of the migration file.
|
|
18
|
+
* E.g.,
|
|
19
|
+
* ```sql
|
|
20
|
+
* -- CreateTable
|
|
21
|
+
* CREATE TABLE "Blog" (
|
|
22
|
+
* "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
|
23
|
+
*
|
|
24
|
+
* "viewCount20" INTEGER NOT NULL
|
|
25
|
+
* );
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
content: Tagged<'ok', {
|
|
29
|
+
value: string;
|
|
30
|
+
}> | Tagged<'error', {
|
|
31
|
+
value: string;
|
|
32
|
+
}>;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
type MigrationLockfile = {
|
|
36
|
+
/**
|
|
37
|
+
* Relative path to the lockfile from `baseDir`.
|
|
38
|
+
*/
|
|
39
|
+
path: 'migration_lock.toml';
|
|
40
|
+
/**
|
|
41
|
+
* Content of the lockfile, if it exists.
|
|
42
|
+
* E.g.,
|
|
43
|
+
* ```toml
|
|
44
|
+
* # Please do not edit this file manually
|
|
45
|
+
* provider = "sqlite"
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
content: string | null;
|
|
49
|
+
};
|
|
50
|
+
type MigrationList = {
|
|
51
|
+
/**
|
|
52
|
+
* Absolute path to the base directory of Prisma migrations.
|
|
53
|
+
* E.g., `/usr/src/app/prisma/migrations`.
|
|
54
|
+
*/
|
|
55
|
+
baseDir: string;
|
|
56
|
+
/**
|
|
57
|
+
* Description of the lockfile, which may or may not exist.
|
|
58
|
+
*/
|
|
59
|
+
lockfile: MigrationLockfile;
|
|
60
|
+
/**
|
|
61
|
+
* Description of the migration directories.
|
|
62
|
+
*/
|
|
63
|
+
migrationDirectories: Array<MigrationDirectory>;
|
|
64
|
+
};
|
|
2
65
|
type SchemaContainer = {
|
|
3
66
|
path: string;
|
|
4
67
|
content: string;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import { MultipleSchemas } from './utils/schemaFileInput';
|
|
2
1
|
export declare class RustPanic extends Error {
|
|
3
2
|
readonly __typename = "RustPanic";
|
|
4
3
|
request: any;
|
|
5
4
|
rustStack: string;
|
|
6
5
|
area: ErrorArea;
|
|
7
|
-
schemaPath?: string;
|
|
8
|
-
schema?: MultipleSchemas;
|
|
9
6
|
introspectionUrl?: string;
|
|
10
|
-
constructor(message: string, rustStack: string, request: any, area: ErrorArea,
|
|
7
|
+
constructor(message: string, rustStack: string, request: any, area: ErrorArea, introspectionUrl?: string);
|
|
11
8
|
}
|
|
12
9
|
export declare function isRustPanic(e: Error): e is RustPanic;
|
|
13
10
|
export declare enum ErrorArea {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import resolve from 'resolve';
|
|
2
|
+
/**
|
|
3
|
+
* Alternative to `require.resolve` that returns undefined instead of throwing.
|
|
4
|
+
* It also enables preserving symlinks, which is not possible with the original
|
|
5
|
+
* `require.resolve`. This variant will find the _root_ of a package.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolvePkg(id: string, options: resolve.AsyncOpts): Promise<string | undefined>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function extractPreviewFeatures(
|
|
1
|
+
import type { GeneratorConfig } from '@prisma/generator';
|
|
2
|
+
export declare function extractPreviewFeatures(generators: GeneratorConfig[]): string[];
|
|
@@ -2,8 +2,4 @@ export type SingleSchema = string;
|
|
|
2
2
|
export type MultipleSchemaTuple = [filename: string, content: string];
|
|
3
3
|
export type MultipleSchemas = Array<MultipleSchemaTuple>;
|
|
4
4
|
export type SchemaFileInput = SingleSchema | MultipleSchemas;
|
|
5
|
-
export declare const schemaToStringDebug: (schemaFileInput: SchemaFileInput | unknown) => string | undefined;
|
|
6
|
-
export declare function toMultipleSchemas(input: SchemaFileInput | undefined): MultipleSchemas | undefined;
|
|
7
|
-
export declare function debugMultipleSchemas(multipleSchemas: MultipleSchemas): string;
|
|
8
|
-
export declare function debugMultipleSchemaPaths(multipleSchemas: MultipleSchemas): string;
|
|
9
5
|
export declare function extractSchemaContent(multipleSchemas: MultipleSchemas): string[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ConfigMetaFormat } from '../engine-commands';
|
|
1
|
+
import { SchemaContext } from '../cli/schemaContext';
|
|
3
2
|
import { MigrateTypes } from '../migrateTypes';
|
|
4
3
|
import { MultipleSchemas } from './schemaFileInput';
|
|
5
4
|
export declare function toSchemasContainer(schemas: MultipleSchemas): MigrateTypes.SchemasContainer;
|
|
6
|
-
export declare function toSchemasWithConfigDir(
|
|
5
|
+
export declare function toSchemasWithConfigDir(schemaContext: SchemaContext): MigrateTypes.SchemasWithConfigDir;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import prismaSchemaWasm from '@prisma/prisma-schema-wasm';
|
|
2
|
-
|
|
2
|
+
import type { SchemaEngine as SchemaEngineWasm } from '@prisma/schema-engine-wasm';
|
|
3
|
+
export { prismaSchemaWasm, SchemaEngineWasm };
|
|
3
4
|
export declare const prismaSchemaWasmVersion: string;
|
|
5
|
+
export declare const schemaEngineWasmVersion: string;
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { ErrorCapturingSqlDriverAdapterFactory } from '@prisma/driver-adapter-utils';
|
|
2
|
+
import { MigrateTypes, SchemaContext } from '@prisma/internals';
|
|
3
|
+
import type { SchemaEngine } from './SchemaEngine';
|
|
3
4
|
import type { EngineArgs, EngineResults } from './types';
|
|
4
5
|
import { DatasourceInfo } from './utils/ensureDatabaseExists';
|
|
6
|
+
interface MigrateSetupInput {
|
|
7
|
+
adapter?: ErrorCapturingSqlDriverAdapterFactory;
|
|
8
|
+
migrationsDirPath?: string;
|
|
9
|
+
enabledPreviewFeatures?: string[];
|
|
10
|
+
schemaContext?: SchemaContext;
|
|
11
|
+
}
|
|
5
12
|
export declare class Migrate {
|
|
6
|
-
engine: SchemaEngine;
|
|
7
|
-
private
|
|
13
|
+
readonly engine: SchemaEngine;
|
|
14
|
+
private schemaContext?;
|
|
8
15
|
migrationsDirectoryPath?: string;
|
|
9
|
-
constructor(
|
|
16
|
+
private constructor();
|
|
17
|
+
static setup({ adapter, ...rest }: MigrateSetupInput): Promise<Migrate>;
|
|
10
18
|
stop(): void;
|
|
11
|
-
getPrismaSchema():
|
|
19
|
+
getPrismaSchema(): MigrateTypes.SchemasContainer;
|
|
12
20
|
reset(): Promise<void>;
|
|
13
|
-
createMigration(params: EngineArgs.CreateMigrationInput): Promise<
|
|
21
|
+
createMigration(params: Omit<EngineArgs.CreateMigrationInput, 'migrationsList'>): Promise<{
|
|
22
|
+
generatedMigrationName: string | undefined;
|
|
23
|
+
}>;
|
|
14
24
|
diagnoseMigrationHistory({ optInToShadowDatabase, }: {
|
|
15
25
|
optInToShadowDatabase: boolean;
|
|
16
26
|
}): Promise<EngineResults.DiagnoseMigrationHistoryOutput>;
|
|
@@ -29,3 +39,4 @@ export declare class Migrate {
|
|
|
29
39
|
}): Promise<EngineResults.SchemaPush>;
|
|
30
40
|
tryToRunGenerate(datasourceInfo: DatasourceInfo): Promise<void>;
|
|
31
41
|
}
|
|
42
|
+
export {};
|