From 477375cf0fd55f2dfe213e2c33cc9ee586b83497 Mon Sep 17 00:00:00 2001 From: Prismo <52275815+prisma-bot@users.noreply.github.com> Date: Thu, 2 Jan 2025 14:47:32 +0200 Subject: [PATCH] chore(deps): update engines to 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f (#25965) * chore(deps): update engines to 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f * feat: add necessary bits for updateManyAndReturn * fix: add shouldApplyGlobalOmit case * fix: fix tests * fix: add missing ts-test-if * fix: make test consistent with createManyAndReturn * fix: delete unused test-if * test: add unsupported test * test: correct folder name --------- Co-authored-by: Jacek Malec --- packages/client/package.json | 4 +- .../src/__tests__/__helpers__/dmmf-types.ts | 1 + .../__snapshots__/binary.test.ts.snap | 109 +- .../__snapshots__/library.test.ts.snap | 109 +- .../__snapshots__/binary.test.ts.snap | 991 +++++++++++++++++- .../__snapshots__/library.test.ts.snap | 991 +++++++++++++++++- .../client/src/generation/TSClient/Model.ts | 55 +- .../src/generation/TSClient/PrismaClient.ts | 20 +- .../src/generation/TSClient/getReturnType.ts | 0 .../client/src/generation/TSClient/jsdoc.ts | 42 +- packages/client/src/generation/utils.ts | 14 + .../core/engines/common/types/JsonProtocol.ts | 1 + .../src/runtime/core/jsonProtocol/isWrite.ts | 1 + .../jsonProtocol/serializeJsonQuery.test.ts | 32 + .../core/jsonProtocol/serializeJsonQuery.ts | 2 + .../src/runtime/core/types/exported/Result.ts | 2 + .../src/runtime/externalToInternalDmmf.ts | 1 + .../functional/extensions/defineExtension.ts | 12 + .../tests/functional/extensions/query.ts | 58 +- .../updateManyAndReturn-supported/_matrix.ts | 16 + .../prisma/_schema.ts | 29 + .../updateManyAndReturn-supported/tests.ts | 323 ++++++ .../_matrix.ts | 16 + .../prisma/_schema.ts | 29 + .../updateManyAndReturn-unsupported/tests.ts | 26 + packages/engines/package.json | 2 +- packages/fetch-engine/package.json | 2 +- packages/generator-helper/src/dmmf.ts | 2 + packages/internals/package.json | 2 +- .../__snapshots__/getDmmf.test.ts.snap | 887 +++++++++++++++- packages/migrate/package.json | 2 +- packages/schema-files-loader/package.json | 2 +- pnpm-lock.yaml | 47 +- 33 files changed, 3574 insertions(+), 256 deletions(-) create mode 100644 packages/client/src/generation/TSClient/getReturnType.ts create mode 100644 packages/client/tests/functional/methods/updateManyAndReturn-supported/_matrix.ts create mode 100644 packages/client/tests/functional/methods/updateManyAndReturn-supported/prisma/_schema.ts create mode 100644 packages/client/tests/functional/methods/updateManyAndReturn-supported/tests.ts create mode 100644 packages/client/tests/functional/methods/updateManyAndReturn-unsupported/_matrix.ts create mode 100644 packages/client/tests/functional/methods/updateManyAndReturn-unsupported/prisma/_schema.ts create mode 100644 packages/client/tests/functional/methods/updateManyAndReturn-unsupported/tests.ts diff --git a/packages/client/package.json b/packages/client/package.json index c0a749d76d5e..c9796f5e7ac2 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -199,7 +199,7 @@ "@prisma/debug": "workspace:*", "@prisma/driver-adapter-utils": "workspace:*", "@prisma/engines": "workspace:*", - "@prisma/engines-version": "6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6", + "@prisma/engines-version": "6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f", "@prisma/fetch-engine": "workspace:*", "@prisma/generator-helper": "workspace:*", "@prisma/get-platform": "workspace:*", @@ -208,7 +208,7 @@ "@prisma/migrate": "workspace:*", "@prisma/mini-proxy": "0.9.5", "@prisma/pg-worker": "workspace:*", - "@prisma/query-engine-wasm": "6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6", + "@prisma/query-engine-wasm": "6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f", "@snaplet/copycat": "0.17.3", "@swc-node/register": "1.10.9", "@swc/core": "1.10.1", diff --git a/packages/client/src/__tests__/__helpers__/dmmf-types.ts b/packages/client/src/__tests__/__helpers__/dmmf-types.ts index 948efc3fa52c..ae8dafb51d5c 100644 --- a/packages/client/src/__tests__/__helpers__/dmmf-types.ts +++ b/packages/client/src/__tests__/__helpers__/dmmf-types.ts @@ -164,6 +164,7 @@ const dmmf: DMMF.Document = { plural: 'posts', update: 'updateOnePost', updateMany: 'updateManyPost', + updateManyAndReturn: 'updateManyPostAndReturn', upsert: 'upsertOnePost', }, { diff --git a/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema-mongo/__snapshots__/binary.test.ts.snap b/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema-mongo/__snapshots__/binary.test.ts.snap index ec1837752bac..0369ca07a889 100644 --- a/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema-mongo/__snapshots__/binary.test.ts.snap +++ b/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema-mongo/__snapshots__/binary.test.ts.snap @@ -471,7 +471,7 @@ export const ABeautifulEnum: typeof $Enums.ABeautifulEnum /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -480,7 +480,7 @@ export const ABeautifulEnum: typeof $Enums.ABeautifulEnum * const posts = await prisma.post.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ export class PrismaClient< @@ -492,7 +492,7 @@ export class PrismaClient< /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -501,7 +501,7 @@ export class PrismaClient< * const posts = await prisma.post.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ @@ -2303,6 +2303,7 @@ export namespace Prisma { | 'createManyAndReturn' | 'update' | 'updateMany' + | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' @@ -2527,6 +2528,7 @@ export namespace Prisma { }, ExtArgs["result"]["embed"]> + export type EmbedSelectScalar = { text?: boolean boolean?: boolean @@ -2596,6 +2598,7 @@ export namespace Prisma { }, ExtArgs["result"]["embedEmbed"]> + export type EmbedEmbedSelectScalar = { text?: boolean boolean?: boolean @@ -2815,6 +2818,7 @@ export namespace Prisma { }, ExtArgs["result"]["post"]> + export type PostSelectScalar = { id?: boolean createdAt?: boolean @@ -2846,7 +2850,7 @@ export namespace Prisma { type PostGetPayload = $Result.GetResult - type PostCountArgs = + type PostCountArgs = Omit & { select?: PostCountAggregateInputType | true } @@ -2867,7 +2871,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__PostClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one Post that matches the filter or throw an error with \`error.code='P2025'\` + * Find one Post that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {PostFindUniqueOrThrowArgs} args - Arguments to find a Post * @example @@ -3045,7 +3049,7 @@ export namespace Prisma { * @param {PostFindRawArgs} args - Select which filters you would like to apply. * @example * const post = await prisma.post.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: PostFindRawArgs): Prisma.PrismaPromise @@ -3867,6 +3871,7 @@ export namespace Prisma { }, ExtArgs["result"]["user"]> + export type UserSelectScalar = { id?: boolean email?: boolean @@ -3919,7 +3924,7 @@ export namespace Prisma { type UserGetPayload = $Result.GetResult - type UserCountArgs = + type UserCountArgs = Omit & { select?: UserCountAggregateInputType | true } @@ -3940,7 +3945,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one User that matches the filter or throw an error with \`error.code='P2025'\` + * Find one User that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User * @example @@ -4118,7 +4123,7 @@ export namespace Prisma { * @param {UserFindRawArgs} args - Select which filters you would like to apply. * @example * const user = await prisma.user.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: UserFindRawArgs): Prisma.PrismaPromise @@ -4846,6 +4851,7 @@ export namespace Prisma { }, ExtArgs["result"]["embedHolder"]> + export type EmbedHolderSelectScalar = { id?: boolean time?: boolean @@ -4878,7 +4884,7 @@ export namespace Prisma { type EmbedHolderGetPayload = $Result.GetResult - type EmbedHolderCountArgs = + type EmbedHolderCountArgs = Omit & { select?: EmbedHolderCountAggregateInputType | true } @@ -4899,7 +4905,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__EmbedHolderClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one EmbedHolder that matches the filter or throw an error with \`error.code='P2025'\` + * Find one EmbedHolder that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {EmbedHolderFindUniqueOrThrowArgs} args - Arguments to find a EmbedHolder * @example @@ -5077,7 +5083,7 @@ export namespace Prisma { * @param {EmbedHolderFindRawArgs} args - Select which filters you would like to apply. * @example * const embedHolder = await prisma.embedHolder.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: EmbedHolderFindRawArgs): Prisma.PrismaPromise @@ -5904,6 +5910,7 @@ export namespace Prisma { }, ExtArgs["result"]["m"]> + export type MSelectScalar = { id?: boolean n_ids?: boolean @@ -5952,7 +5959,7 @@ export namespace Prisma { type MGetPayload = $Result.GetResult - type MCountArgs = + type MCountArgs = Omit & { select?: MCountAggregateInputType | true } @@ -5973,7 +5980,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__MClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one M that matches the filter or throw an error with \`error.code='P2025'\` + * Find one M that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {MFindUniqueOrThrowArgs} args - Arguments to find a M * @example @@ -6151,7 +6158,7 @@ export namespace Prisma { * @param {MFindRawArgs} args - Select which filters you would like to apply. * @example * const m = await prisma.m.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: MFindRawArgs): Prisma.PrismaPromise @@ -6988,6 +6995,7 @@ export namespace Prisma { }, ExtArgs["result"]["n"]> + export type NSelectScalar = { id?: boolean m_ids?: boolean @@ -7036,7 +7044,7 @@ export namespace Prisma { type NGetPayload = $Result.GetResult - type NCountArgs = + type NCountArgs = Omit & { select?: NCountAggregateInputType | true } @@ -7057,7 +7065,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__NClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one N that matches the filter or throw an error with \`error.code='P2025'\` + * Find one N that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {NFindUniqueOrThrowArgs} args - Arguments to find a N * @example @@ -7235,7 +7243,7 @@ export namespace Prisma { * @param {NFindRawArgs} args - Select which filters you would like to apply. * @example * const n = await prisma.n.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: NFindRawArgs): Prisma.PrismaPromise @@ -8068,6 +8076,7 @@ export namespace Prisma { }, ExtArgs["result"]["oneOptional"]> + export type OneOptionalSelectScalar = { id?: boolean int?: boolean @@ -8114,7 +8123,7 @@ export namespace Prisma { type OneOptionalGetPayload = $Result.GetResult - type OneOptionalCountArgs = + type OneOptionalCountArgs = Omit & { select?: OneOptionalCountAggregateInputType | true } @@ -8135,7 +8144,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OneOptionalClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OneOptional that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OneOptional that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OneOptionalFindUniqueOrThrowArgs} args - Arguments to find a OneOptional * @example @@ -8313,7 +8322,7 @@ export namespace Prisma { * @param {OneOptionalFindRawArgs} args - Select which filters you would like to apply. * @example * const oneOptional = await prisma.oneOptional.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: OneOptionalFindRawArgs): Prisma.PrismaPromise @@ -9152,6 +9161,7 @@ export namespace Prisma { }, ExtArgs["result"]["manyRequired"]> + export type ManyRequiredSelectScalar = { id?: boolean oneOptionalId?: boolean @@ -9199,7 +9209,7 @@ export namespace Prisma { type ManyRequiredGetPayload = $Result.GetResult - type ManyRequiredCountArgs = + type ManyRequiredCountArgs = Omit & { select?: ManyRequiredCountAggregateInputType | true } @@ -9220,7 +9230,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__ManyRequiredClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one ManyRequired that matches the filter or throw an error with \`error.code='P2025'\` + * Find one ManyRequired that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {ManyRequiredFindUniqueOrThrowArgs} args - Arguments to find a ManyRequired * @example @@ -9398,7 +9408,7 @@ export namespace Prisma { * @param {ManyRequiredFindRawArgs} args - Select which filters you would like to apply. * @example * const manyRequired = await prisma.manyRequired.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: ManyRequiredFindRawArgs): Prisma.PrismaPromise @@ -10233,6 +10243,7 @@ export namespace Prisma { }, ExtArgs["result"]["optionalSide1"]> + export type OptionalSide1SelectScalar = { id?: boolean optionalSide2Id?: boolean @@ -10280,7 +10291,7 @@ export namespace Prisma { type OptionalSide1GetPayload = $Result.GetResult - type OptionalSide1CountArgs = + type OptionalSide1CountArgs = Omit & { select?: OptionalSide1CountAggregateInputType | true } @@ -10301,7 +10312,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OptionalSide1Client<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OptionalSide1 that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OptionalSide1 that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OptionalSide1FindUniqueOrThrowArgs} args - Arguments to find a OptionalSide1 * @example @@ -10479,7 +10490,7 @@ export namespace Prisma { * @param {OptionalSide1FindRawArgs} args - Select which filters you would like to apply. * @example * const optionalSide1 = await prisma.optionalSide1.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: OptionalSide1FindRawArgs): Prisma.PrismaPromise @@ -11306,6 +11317,7 @@ export namespace Prisma { }, ExtArgs["result"]["optionalSide2"]> + export type OptionalSide2SelectScalar = { id?: boolean int?: boolean @@ -11351,7 +11363,7 @@ export namespace Prisma { type OptionalSide2GetPayload = $Result.GetResult - type OptionalSide2CountArgs = + type OptionalSide2CountArgs = Omit & { select?: OptionalSide2CountAggregateInputType | true } @@ -11372,7 +11384,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OptionalSide2Client<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OptionalSide2 that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OptionalSide2 that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OptionalSide2FindUniqueOrThrowArgs} args - Arguments to find a OptionalSide2 * @example @@ -11550,7 +11562,7 @@ export namespace Prisma { * @param {OptionalSide2FindRawArgs} args - Select which filters you would like to apply. * @example * const optionalSide2 = await prisma.optionalSide2.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: OptionalSide2FindRawArgs): Prisma.PrismaPromise @@ -12323,6 +12335,7 @@ export namespace Prisma { }, ExtArgs["result"]["a"]> + export type ASelectScalar = { id?: boolean email?: boolean @@ -12355,7 +12368,7 @@ export namespace Prisma { type AGetPayload = $Result.GetResult - type ACountArgs = + type ACountArgs = Omit & { select?: ACountAggregateInputType | true } @@ -12376,7 +12389,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__AClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one A that matches the filter or throw an error with \`error.code='P2025'\` + * Find one A that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {AFindUniqueOrThrowArgs} args - Arguments to find a A * @example @@ -12554,7 +12567,7 @@ export namespace Prisma { * @param {AFindRawArgs} args - Select which filters you would like to apply. * @example * const a = await prisma.a.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: AFindRawArgs): Prisma.PrismaPromise @@ -13236,6 +13249,7 @@ export namespace Prisma { }, ExtArgs["result"]["b"]> + export type BSelectScalar = { id?: boolean float?: boolean @@ -13256,7 +13270,7 @@ export namespace Prisma { type BGetPayload = $Result.GetResult - type BCountArgs = + type BCountArgs = Omit & { select?: BCountAggregateInputType | true } @@ -13277,7 +13291,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__BClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one B that matches the filter or throw an error with \`error.code='P2025'\` + * Find one B that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {BFindUniqueOrThrowArgs} args - Arguments to find a B * @example @@ -13455,7 +13469,7 @@ export namespace Prisma { * @param {BFindRawArgs} args - Select which filters you would like to apply. * @example * const b = await prisma.b.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: BFindRawArgs): Prisma.PrismaPromise @@ -14128,6 +14142,7 @@ export namespace Prisma { }, ExtArgs["result"]["c"]> + export type CSelectScalar = { id?: boolean char?: boolean @@ -14156,7 +14171,7 @@ export namespace Prisma { type CGetPayload = $Result.GetResult - type CCountArgs = + type CCountArgs = Omit & { select?: CCountAggregateInputType | true } @@ -14177,7 +14192,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__CClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one C that matches the filter or throw an error with \`error.code='P2025'\` + * Find one C that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {CFindUniqueOrThrowArgs} args - Arguments to find a C * @example @@ -14355,7 +14370,7 @@ export namespace Prisma { * @param {CFindRawArgs} args - Select which filters you would like to apply. * @example * const c = await prisma.c.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: CFindRawArgs): Prisma.PrismaPromise @@ -15054,6 +15069,7 @@ export namespace Prisma { }, ExtArgs["result"]["d"]> + export type DSelectScalar = { id?: boolean bool?: boolean @@ -15082,7 +15098,7 @@ export namespace Prisma { type DGetPayload = $Result.GetResult - type DCountArgs = + type DCountArgs = Omit & { select?: DCountAggregateInputType | true } @@ -15103,7 +15119,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__DClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one D that matches the filter or throw an error with \`error.code='P2025'\` + * Find one D that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {DFindUniqueOrThrowArgs} args - Arguments to find a D * @example @@ -15281,7 +15297,7 @@ export namespace Prisma { * @param {DFindRawArgs} args - Select which filters you would like to apply. * @example * const d = await prisma.d.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: DFindRawArgs): Prisma.PrismaPromise @@ -15934,6 +15950,7 @@ export namespace Prisma { }, ExtArgs["result"]["e"]> + export type ESelectScalar = { id?: boolean date?: boolean @@ -15956,7 +15973,7 @@ export namespace Prisma { type EGetPayload = $Result.GetResult - type ECountArgs = + type ECountArgs = Omit & { select?: ECountAggregateInputType | true } @@ -15977,7 +15994,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__EClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one E that matches the filter or throw an error with \`error.code='P2025'\` + * Find one E that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {EFindUniqueOrThrowArgs} args - Arguments to find a E * @example @@ -16155,7 +16172,7 @@ export namespace Prisma { * @param {EFindRawArgs} args - Select which filters you would like to apply. * @example * const e = await prisma.e.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: EFindRawArgs): Prisma.PrismaPromise diff --git a/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema-mongo/__snapshots__/library.test.ts.snap b/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema-mongo/__snapshots__/library.test.ts.snap index 6a55d85f1c19..e2f55d2302db 100644 --- a/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema-mongo/__snapshots__/library.test.ts.snap +++ b/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema-mongo/__snapshots__/library.test.ts.snap @@ -471,7 +471,7 @@ export const ABeautifulEnum: typeof $Enums.ABeautifulEnum /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -480,7 +480,7 @@ export const ABeautifulEnum: typeof $Enums.ABeautifulEnum * const posts = await prisma.post.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ export class PrismaClient< @@ -492,7 +492,7 @@ export class PrismaClient< /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -501,7 +501,7 @@ export class PrismaClient< * const posts = await prisma.post.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ @@ -2303,6 +2303,7 @@ export namespace Prisma { | 'createManyAndReturn' | 'update' | 'updateMany' + | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' @@ -2527,6 +2528,7 @@ export namespace Prisma { }, ExtArgs["result"]["embed"]> + export type EmbedSelectScalar = { text?: boolean boolean?: boolean @@ -2596,6 +2598,7 @@ export namespace Prisma { }, ExtArgs["result"]["embedEmbed"]> + export type EmbedEmbedSelectScalar = { text?: boolean boolean?: boolean @@ -2815,6 +2818,7 @@ export namespace Prisma { }, ExtArgs["result"]["post"]> + export type PostSelectScalar = { id?: boolean createdAt?: boolean @@ -2846,7 +2850,7 @@ export namespace Prisma { type PostGetPayload = $Result.GetResult - type PostCountArgs = + type PostCountArgs = Omit & { select?: PostCountAggregateInputType | true } @@ -2867,7 +2871,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__PostClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one Post that matches the filter or throw an error with \`error.code='P2025'\` + * Find one Post that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {PostFindUniqueOrThrowArgs} args - Arguments to find a Post * @example @@ -3045,7 +3049,7 @@ export namespace Prisma { * @param {PostFindRawArgs} args - Select which filters you would like to apply. * @example * const post = await prisma.post.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: PostFindRawArgs): Prisma.PrismaPromise @@ -3867,6 +3871,7 @@ export namespace Prisma { }, ExtArgs["result"]["user"]> + export type UserSelectScalar = { id?: boolean email?: boolean @@ -3919,7 +3924,7 @@ export namespace Prisma { type UserGetPayload = $Result.GetResult - type UserCountArgs = + type UserCountArgs = Omit & { select?: UserCountAggregateInputType | true } @@ -3940,7 +3945,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one User that matches the filter or throw an error with \`error.code='P2025'\` + * Find one User that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User * @example @@ -4118,7 +4123,7 @@ export namespace Prisma { * @param {UserFindRawArgs} args - Select which filters you would like to apply. * @example * const user = await prisma.user.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: UserFindRawArgs): Prisma.PrismaPromise @@ -4846,6 +4851,7 @@ export namespace Prisma { }, ExtArgs["result"]["embedHolder"]> + export type EmbedHolderSelectScalar = { id?: boolean time?: boolean @@ -4878,7 +4884,7 @@ export namespace Prisma { type EmbedHolderGetPayload = $Result.GetResult - type EmbedHolderCountArgs = + type EmbedHolderCountArgs = Omit & { select?: EmbedHolderCountAggregateInputType | true } @@ -4899,7 +4905,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__EmbedHolderClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one EmbedHolder that matches the filter or throw an error with \`error.code='P2025'\` + * Find one EmbedHolder that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {EmbedHolderFindUniqueOrThrowArgs} args - Arguments to find a EmbedHolder * @example @@ -5077,7 +5083,7 @@ export namespace Prisma { * @param {EmbedHolderFindRawArgs} args - Select which filters you would like to apply. * @example * const embedHolder = await prisma.embedHolder.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: EmbedHolderFindRawArgs): Prisma.PrismaPromise @@ -5904,6 +5910,7 @@ export namespace Prisma { }, ExtArgs["result"]["m"]> + export type MSelectScalar = { id?: boolean n_ids?: boolean @@ -5952,7 +5959,7 @@ export namespace Prisma { type MGetPayload = $Result.GetResult - type MCountArgs = + type MCountArgs = Omit & { select?: MCountAggregateInputType | true } @@ -5973,7 +5980,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__MClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one M that matches the filter or throw an error with \`error.code='P2025'\` + * Find one M that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {MFindUniqueOrThrowArgs} args - Arguments to find a M * @example @@ -6151,7 +6158,7 @@ export namespace Prisma { * @param {MFindRawArgs} args - Select which filters you would like to apply. * @example * const m = await prisma.m.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: MFindRawArgs): Prisma.PrismaPromise @@ -6988,6 +6995,7 @@ export namespace Prisma { }, ExtArgs["result"]["n"]> + export type NSelectScalar = { id?: boolean m_ids?: boolean @@ -7036,7 +7044,7 @@ export namespace Prisma { type NGetPayload = $Result.GetResult - type NCountArgs = + type NCountArgs = Omit & { select?: NCountAggregateInputType | true } @@ -7057,7 +7065,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__NClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one N that matches the filter or throw an error with \`error.code='P2025'\` + * Find one N that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {NFindUniqueOrThrowArgs} args - Arguments to find a N * @example @@ -7235,7 +7243,7 @@ export namespace Prisma { * @param {NFindRawArgs} args - Select which filters you would like to apply. * @example * const n = await prisma.n.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: NFindRawArgs): Prisma.PrismaPromise @@ -8068,6 +8076,7 @@ export namespace Prisma { }, ExtArgs["result"]["oneOptional"]> + export type OneOptionalSelectScalar = { id?: boolean int?: boolean @@ -8114,7 +8123,7 @@ export namespace Prisma { type OneOptionalGetPayload = $Result.GetResult - type OneOptionalCountArgs = + type OneOptionalCountArgs = Omit & { select?: OneOptionalCountAggregateInputType | true } @@ -8135,7 +8144,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OneOptionalClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OneOptional that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OneOptional that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OneOptionalFindUniqueOrThrowArgs} args - Arguments to find a OneOptional * @example @@ -8313,7 +8322,7 @@ export namespace Prisma { * @param {OneOptionalFindRawArgs} args - Select which filters you would like to apply. * @example * const oneOptional = await prisma.oneOptional.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: OneOptionalFindRawArgs): Prisma.PrismaPromise @@ -9152,6 +9161,7 @@ export namespace Prisma { }, ExtArgs["result"]["manyRequired"]> + export type ManyRequiredSelectScalar = { id?: boolean oneOptionalId?: boolean @@ -9199,7 +9209,7 @@ export namespace Prisma { type ManyRequiredGetPayload = $Result.GetResult - type ManyRequiredCountArgs = + type ManyRequiredCountArgs = Omit & { select?: ManyRequiredCountAggregateInputType | true } @@ -9220,7 +9230,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__ManyRequiredClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one ManyRequired that matches the filter or throw an error with \`error.code='P2025'\` + * Find one ManyRequired that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {ManyRequiredFindUniqueOrThrowArgs} args - Arguments to find a ManyRequired * @example @@ -9398,7 +9408,7 @@ export namespace Prisma { * @param {ManyRequiredFindRawArgs} args - Select which filters you would like to apply. * @example * const manyRequired = await prisma.manyRequired.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: ManyRequiredFindRawArgs): Prisma.PrismaPromise @@ -10233,6 +10243,7 @@ export namespace Prisma { }, ExtArgs["result"]["optionalSide1"]> + export type OptionalSide1SelectScalar = { id?: boolean optionalSide2Id?: boolean @@ -10280,7 +10291,7 @@ export namespace Prisma { type OptionalSide1GetPayload = $Result.GetResult - type OptionalSide1CountArgs = + type OptionalSide1CountArgs = Omit & { select?: OptionalSide1CountAggregateInputType | true } @@ -10301,7 +10312,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OptionalSide1Client<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OptionalSide1 that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OptionalSide1 that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OptionalSide1FindUniqueOrThrowArgs} args - Arguments to find a OptionalSide1 * @example @@ -10479,7 +10490,7 @@ export namespace Prisma { * @param {OptionalSide1FindRawArgs} args - Select which filters you would like to apply. * @example * const optionalSide1 = await prisma.optionalSide1.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: OptionalSide1FindRawArgs): Prisma.PrismaPromise @@ -11306,6 +11317,7 @@ export namespace Prisma { }, ExtArgs["result"]["optionalSide2"]> + export type OptionalSide2SelectScalar = { id?: boolean int?: boolean @@ -11351,7 +11363,7 @@ export namespace Prisma { type OptionalSide2GetPayload = $Result.GetResult - type OptionalSide2CountArgs = + type OptionalSide2CountArgs = Omit & { select?: OptionalSide2CountAggregateInputType | true } @@ -11372,7 +11384,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OptionalSide2Client<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OptionalSide2 that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OptionalSide2 that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OptionalSide2FindUniqueOrThrowArgs} args - Arguments to find a OptionalSide2 * @example @@ -11550,7 +11562,7 @@ export namespace Prisma { * @param {OptionalSide2FindRawArgs} args - Select which filters you would like to apply. * @example * const optionalSide2 = await prisma.optionalSide2.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: OptionalSide2FindRawArgs): Prisma.PrismaPromise @@ -12323,6 +12335,7 @@ export namespace Prisma { }, ExtArgs["result"]["a"]> + export type ASelectScalar = { id?: boolean email?: boolean @@ -12355,7 +12368,7 @@ export namespace Prisma { type AGetPayload = $Result.GetResult - type ACountArgs = + type ACountArgs = Omit & { select?: ACountAggregateInputType | true } @@ -12376,7 +12389,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__AClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one A that matches the filter or throw an error with \`error.code='P2025'\` + * Find one A that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {AFindUniqueOrThrowArgs} args - Arguments to find a A * @example @@ -12554,7 +12567,7 @@ export namespace Prisma { * @param {AFindRawArgs} args - Select which filters you would like to apply. * @example * const a = await prisma.a.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: AFindRawArgs): Prisma.PrismaPromise @@ -13236,6 +13249,7 @@ export namespace Prisma { }, ExtArgs["result"]["b"]> + export type BSelectScalar = { id?: boolean float?: boolean @@ -13256,7 +13270,7 @@ export namespace Prisma { type BGetPayload = $Result.GetResult - type BCountArgs = + type BCountArgs = Omit & { select?: BCountAggregateInputType | true } @@ -13277,7 +13291,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__BClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one B that matches the filter or throw an error with \`error.code='P2025'\` + * Find one B that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {BFindUniqueOrThrowArgs} args - Arguments to find a B * @example @@ -13455,7 +13469,7 @@ export namespace Prisma { * @param {BFindRawArgs} args - Select which filters you would like to apply. * @example * const b = await prisma.b.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: BFindRawArgs): Prisma.PrismaPromise @@ -14128,6 +14142,7 @@ export namespace Prisma { }, ExtArgs["result"]["c"]> + export type CSelectScalar = { id?: boolean char?: boolean @@ -14156,7 +14171,7 @@ export namespace Prisma { type CGetPayload = $Result.GetResult - type CCountArgs = + type CCountArgs = Omit & { select?: CCountAggregateInputType | true } @@ -14177,7 +14192,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__CClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one C that matches the filter or throw an error with \`error.code='P2025'\` + * Find one C that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {CFindUniqueOrThrowArgs} args - Arguments to find a C * @example @@ -14355,7 +14370,7 @@ export namespace Prisma { * @param {CFindRawArgs} args - Select which filters you would like to apply. * @example * const c = await prisma.c.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: CFindRawArgs): Prisma.PrismaPromise @@ -15054,6 +15069,7 @@ export namespace Prisma { }, ExtArgs["result"]["d"]> + export type DSelectScalar = { id?: boolean bool?: boolean @@ -15082,7 +15098,7 @@ export namespace Prisma { type DGetPayload = $Result.GetResult - type DCountArgs = + type DCountArgs = Omit & { select?: DCountAggregateInputType | true } @@ -15103,7 +15119,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__DClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one D that matches the filter or throw an error with \`error.code='P2025'\` + * Find one D that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {DFindUniqueOrThrowArgs} args - Arguments to find a D * @example @@ -15281,7 +15297,7 @@ export namespace Prisma { * @param {DFindRawArgs} args - Select which filters you would like to apply. * @example * const d = await prisma.d.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: DFindRawArgs): Prisma.PrismaPromise @@ -15934,6 +15950,7 @@ export namespace Prisma { }, ExtArgs["result"]["e"]> + export type ESelectScalar = { id?: boolean date?: boolean @@ -15956,7 +15973,7 @@ export namespace Prisma { type EGetPayload = $Result.GetResult - type ECountArgs = + type ECountArgs = Omit & { select?: ECountAggregateInputType | true } @@ -15977,7 +15994,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__EClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one E that matches the filter or throw an error with \`error.code='P2025'\` + * Find one E that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {EFindUniqueOrThrowArgs} args - Arguments to find a E * @example @@ -16155,7 +16172,7 @@ export namespace Prisma { * @param {EFindRawArgs} args - Select which filters you would like to apply. * @example * const e = await prisma.e.findRaw({ - * filter: { age: { $gt: 25 } } + * filter: { age: { $gt: 25 } } * }) */ findRaw(args?: EFindRawArgs): Prisma.PrismaPromise diff --git a/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema/__snapshots__/binary.test.ts.snap b/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema/__snapshots__/binary.test.ts.snap index b0445ebc5bb5..f8cd2733ec3a 100644 --- a/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema/__snapshots__/binary.test.ts.snap +++ b/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema/__snapshots__/binary.test.ts.snap @@ -477,7 +477,7 @@ export const ABeautifulEnum: typeof $Enums.ABeautifulEnum /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -486,7 +486,7 @@ export const ABeautifulEnum: typeof $Enums.ABeautifulEnum * const posts = await prisma.post.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ export class PrismaClient< @@ -498,7 +498,7 @@ export class PrismaClient< /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -507,7 +507,7 @@ export class PrismaClient< * const posts = await prisma.post.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ @@ -537,7 +537,7 @@ export class PrismaClient< * \`\`\` * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\` * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; @@ -549,7 +549,7 @@ export class PrismaClient< * \`\`\` * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; @@ -560,7 +560,7 @@ export class PrismaClient< * \`\`\` * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\` * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; @@ -572,7 +572,7 @@ export class PrismaClient< * \`\`\` * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; @@ -1251,6 +1251,10 @@ export namespace Prisma { args: Prisma.PostUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.PostUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.PostUpsertArgs result: $Utils.PayloadToResult @@ -1321,6 +1325,10 @@ export namespace Prisma { args: Prisma.UserUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.UserUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.UserUpsertArgs result: $Utils.PayloadToResult @@ -1391,6 +1399,10 @@ export namespace Prisma { args: Prisma.MUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.MUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.MUpsertArgs result: $Utils.PayloadToResult @@ -1461,6 +1473,10 @@ export namespace Prisma { args: Prisma.NUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.NUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.NUpsertArgs result: $Utils.PayloadToResult @@ -1531,6 +1547,10 @@ export namespace Prisma { args: Prisma.OneOptionalUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.OneOptionalUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.OneOptionalUpsertArgs result: $Utils.PayloadToResult @@ -1601,6 +1621,10 @@ export namespace Prisma { args: Prisma.ManyRequiredUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.ManyRequiredUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.ManyRequiredUpsertArgs result: $Utils.PayloadToResult @@ -1671,6 +1695,10 @@ export namespace Prisma { args: Prisma.OptionalSide1UpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.OptionalSide1UpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.OptionalSide1UpsertArgs result: $Utils.PayloadToResult @@ -1741,6 +1769,10 @@ export namespace Prisma { args: Prisma.OptionalSide2UpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.OptionalSide2UpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.OptionalSide2UpsertArgs result: $Utils.PayloadToResult @@ -1811,6 +1843,10 @@ export namespace Prisma { args: Prisma.AUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.AUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.AUpsertArgs result: $Utils.PayloadToResult @@ -1881,6 +1917,10 @@ export namespace Prisma { args: Prisma.BUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.BUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.BUpsertArgs result: $Utils.PayloadToResult @@ -1951,6 +1991,10 @@ export namespace Prisma { args: Prisma.CUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.CUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.CUpsertArgs result: $Utils.PayloadToResult @@ -2021,6 +2065,10 @@ export namespace Prisma { args: Prisma.DUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.DUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.DUpsertArgs result: $Utils.PayloadToResult @@ -2091,6 +2139,10 @@ export namespace Prisma { args: Prisma.EUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.EUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.EUpsertArgs result: $Utils.PayloadToResult @@ -2218,6 +2270,7 @@ export namespace Prisma { | 'createManyAndReturn' | 'update' | 'updateMany' + | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' @@ -2616,6 +2669,16 @@ export namespace Prisma { author?: boolean | UserDefaultArgs }, ExtArgs["result"]["post"]> + export type PostSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | UserDefaultArgs + }, ExtArgs["result"]["post"]> + export type PostSelectScalar = { id?: boolean createdAt?: boolean @@ -2631,6 +2694,9 @@ export namespace Prisma { export type PostIncludeCreateManyAndReturn = { author?: boolean | UserDefaultArgs } + export type PostIncludeUpdateManyAndReturn = { + author?: boolean | UserDefaultArgs + } export type $PostPayload = { name: "Post" @@ -2650,7 +2716,7 @@ export namespace Prisma { type PostGetPayload = $Result.GetResult - type PostCountArgs = + type PostCountArgs = Omit & { select?: PostCountAggregateInputType | true } @@ -2671,7 +2737,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__PostClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one Post that matches the filter or throw an error with \`error.code='P2025'\` + * Find one Post that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {PostFindUniqueOrThrowArgs} args - Arguments to find a Post * @example @@ -2773,7 +2839,7 @@ export namespace Prisma { * }) * * // Create many Posts and only return the \`id\` - * const postWithIdOnly = await prisma.post.createManyAndReturn({ + * const postWithIdOnly = await prisma.post.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -2849,6 +2915,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Posts and returns the data updated in the database. + * @param {PostUpdateManyAndReturnArgs} args - Arguments to update many Posts. + * @example + * // Update many Posts + * const post = await prisma.post.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Posts and only return the \`id\` + * const postWithIdOnly = await prisma.post.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one Post. * @param {PostUpsertArgs} args - Arguments to update or create a Post. @@ -3307,6 +3403,28 @@ export namespace Prisma { where?: PostWhereInput } + /** + * Post updateManyAndReturn + */ + export type PostUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: PostSelectUpdateManyAndReturn | null + /** + * The data used to update Posts. + */ + data: XOR + /** + * Filter which Posts to update + */ + where?: PostWhereInput + /** + * Choose, which related nodes to fetch as well + */ + include?: PostIncludeUpdateManyAndReturn | null + } + /** * Post upsert */ @@ -3675,6 +3793,23 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["user"]> + export type UserSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + email?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["user"]> + export type UserSelectScalar = { id?: boolean email?: boolean @@ -3697,6 +3832,7 @@ export namespace Prisma { _count?: boolean | UserCountOutputTypeDefaultArgs } export type UserIncludeCreateManyAndReturn = {} + export type UserIncludeUpdateManyAndReturn = {} export type $UserPayload = { name: "User" @@ -3724,7 +3860,7 @@ export namespace Prisma { type UserGetPayload = $Result.GetResult - type UserCountArgs = + type UserCountArgs = Omit & { select?: UserCountAggregateInputType | true } @@ -3745,7 +3881,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one User that matches the filter or throw an error with \`error.code='P2025'\` + * Find one User that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User * @example @@ -3847,7 +3983,7 @@ export namespace Prisma { * }) * * // Create many Users and only return the \`id\` - * const userWithIdOnly = await prisma.user.createManyAndReturn({ + * const userWithIdOnly = await prisma.user.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -3923,6 +4059,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Users and returns the data updated in the database. + * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. + * @example + * // Update many Users + * const user = await prisma.user.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Users and only return the \`id\` + * const userWithIdOnly = await prisma.user.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one User. * @param {UserUpsertArgs} args - Arguments to update or create a User. @@ -4385,6 +4551,24 @@ export namespace Prisma { where?: UserWhereInput } + /** + * User updateManyAndReturn + */ + export type UserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelectUpdateManyAndReturn | null + /** + * The data used to update Users. + */ + data: XOR + /** + * Filter which Users to update + */ + where?: UserWhereInput + } + /** * User upsert */ @@ -4764,6 +4948,22 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["m"]> + export type MSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["m"]> + export type MSelectScalar = { id?: boolean int?: boolean @@ -4785,6 +4985,7 @@ export namespace Prisma { _count?: boolean | MCountOutputTypeDefaultArgs } export type MIncludeCreateManyAndReturn = {} + export type MIncludeUpdateManyAndReturn = {} export type $MPayload = { name: "M" @@ -4811,7 +5012,7 @@ export namespace Prisma { type MGetPayload = $Result.GetResult - type MCountArgs = + type MCountArgs = Omit & { select?: MCountAggregateInputType | true } @@ -4832,7 +5033,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__MClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one M that matches the filter or throw an error with \`error.code='P2025'\` + * Find one M that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {MFindUniqueOrThrowArgs} args - Arguments to find a M * @example @@ -4934,7 +5135,7 @@ export namespace Prisma { * }) * * // Create many Ms and only return the \`id\` - * const mWithIdOnly = await prisma.m.createManyAndReturn({ + * const mWithIdOnly = await prisma.m.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -5010,6 +5211,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Ms and returns the data updated in the database. + * @param {MUpdateManyAndReturnArgs} args - Arguments to update many Ms. + * @example + * // Update many Ms + * const m = await prisma.m.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Ms and only return the \`id\` + * const mWithIdOnly = await prisma.m.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one M. * @param {MUpsertArgs} args - Arguments to update or create a M. @@ -5471,6 +5702,24 @@ export namespace Prisma { where?: MWhereInput } + /** + * M updateManyAndReturn + */ + export type MUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the M + */ + select?: MSelectUpdateManyAndReturn | null + /** + * The data used to update MS. + */ + data: XOR + /** + * Filter which MS to update + */ + where?: MWhereInput + } + /** * M upsert */ @@ -5850,6 +6099,22 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["n"]> + export type NSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["n"]> + export type NSelectScalar = { id?: boolean int?: boolean @@ -5871,6 +6136,7 @@ export namespace Prisma { _count?: boolean | NCountOutputTypeDefaultArgs } export type NIncludeCreateManyAndReturn = {} + export type NIncludeUpdateManyAndReturn = {} export type $NPayload = { name: "N" @@ -5897,7 +6163,7 @@ export namespace Prisma { type NGetPayload = $Result.GetResult - type NCountArgs = + type NCountArgs = Omit & { select?: NCountAggregateInputType | true } @@ -5918,7 +6184,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__NClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one N that matches the filter or throw an error with \`error.code='P2025'\` + * Find one N that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {NFindUniqueOrThrowArgs} args - Arguments to find a N * @example @@ -6020,7 +6286,7 @@ export namespace Prisma { * }) * * // Create many Ns and only return the \`id\` - * const nWithIdOnly = await prisma.n.createManyAndReturn({ + * const nWithIdOnly = await prisma.n.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -6096,6 +6362,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Ns and returns the data updated in the database. + * @param {NUpdateManyAndReturnArgs} args - Arguments to update many Ns. + * @example + * // Update many Ns + * const n = await prisma.n.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Ns and only return the \`id\` + * const nWithIdOnly = await prisma.n.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one N. * @param {NUpsertArgs} args - Arguments to update or create a N. @@ -6558,23 +6854,41 @@ export namespace Prisma { } /** - * N upsert + * N updateManyAndReturn */ - export type NUpsertArgs = { + export type NUpdateManyAndReturnArgs = { /** * Select specific fields to fetch from the N */ - select?: NSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: NInclude | null + select?: NSelectUpdateManyAndReturn | null /** - * The filter to search for the N to update in case it exists. + * The data used to update NS. */ - where: NWhereUniqueInput + data: XOR /** - * In case the N found by the \`where\` argument doesn't exist, create a new N with this data. + * Filter which NS to update + */ + where?: NWhereInput + } + + /** + * N upsert + */ + export type NUpsertArgs = { + /** + * Select specific fields to fetch from the N + */ + select?: NSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NInclude | null + /** + * The filter to search for the N to update in case it exists. + */ + where: NWhereUniqueInput + /** + * In case the N found by the \`where\` argument doesn't exist, create a new N with this data. */ create: XOR /** @@ -6936,6 +7250,22 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["oneOptional"]> + export type OneOptionalSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["oneOptional"]> + export type OneOptionalSelectScalar = { id?: boolean int?: boolean @@ -6957,6 +7287,7 @@ export namespace Prisma { _count?: boolean | OneOptionalCountOutputTypeDefaultArgs } export type OneOptionalIncludeCreateManyAndReturn = {} + export type OneOptionalIncludeUpdateManyAndReturn = {} export type $OneOptionalPayload = { name: "OneOptional" @@ -6983,7 +7314,7 @@ export namespace Prisma { type OneOptionalGetPayload = $Result.GetResult - type OneOptionalCountArgs = + type OneOptionalCountArgs = Omit & { select?: OneOptionalCountAggregateInputType | true } @@ -7004,7 +7335,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OneOptionalClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OneOptional that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OneOptional that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OneOptionalFindUniqueOrThrowArgs} args - Arguments to find a OneOptional * @example @@ -7106,7 +7437,7 @@ export namespace Prisma { * }) * * // Create many OneOptionals and only return the \`id\` - * const oneOptionalWithIdOnly = await prisma.oneOptional.createManyAndReturn({ + * const oneOptionalWithIdOnly = await prisma.oneOptional.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -7182,6 +7513,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more OneOptionals and returns the data updated in the database. + * @param {OneOptionalUpdateManyAndReturnArgs} args - Arguments to update many OneOptionals. + * @example + * // Update many OneOptionals + * const oneOptional = await prisma.oneOptional.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more OneOptionals and only return the \`id\` + * const oneOptionalWithIdOnly = await prisma.oneOptional.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one OneOptional. * @param {OneOptionalUpsertArgs} args - Arguments to update or create a OneOptional. @@ -7643,6 +8004,24 @@ export namespace Prisma { where?: OneOptionalWhereInput } + /** + * OneOptional updateManyAndReturn + */ + export type OneOptionalUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OneOptional + */ + select?: OneOptionalSelectUpdateManyAndReturn | null + /** + * The data used to update OneOptionals. + */ + data: XOR + /** + * Filter which OneOptionals to update + */ + where?: OneOptionalWhereInput + } + /** * OneOptional upsert */ @@ -8035,6 +8414,24 @@ export namespace Prisma { one?: boolean | ManyRequired$oneArgs }, ExtArgs["result"]["manyRequired"]> + export type ManyRequiredSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + oneOptionalId?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + one?: boolean | ManyRequired$oneArgs + }, ExtArgs["result"]["manyRequired"]> + export type ManyRequiredSelectScalar = { id?: boolean oneOptionalId?: boolean @@ -8058,6 +8455,9 @@ export namespace Prisma { export type ManyRequiredIncludeCreateManyAndReturn = { one?: boolean | ManyRequired$oneArgs } + export type ManyRequiredIncludeUpdateManyAndReturn = { + one?: boolean | ManyRequired$oneArgs + } export type $ManyRequiredPayload = { name: "ManyRequired" @@ -8085,7 +8485,7 @@ export namespace Prisma { type ManyRequiredGetPayload = $Result.GetResult - type ManyRequiredCountArgs = + type ManyRequiredCountArgs = Omit & { select?: ManyRequiredCountAggregateInputType | true } @@ -8106,7 +8506,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__ManyRequiredClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one ManyRequired that matches the filter or throw an error with \`error.code='P2025'\` + * Find one ManyRequired that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {ManyRequiredFindUniqueOrThrowArgs} args - Arguments to find a ManyRequired * @example @@ -8208,7 +8608,7 @@ export namespace Prisma { * }) * * // Create many ManyRequireds and only return the \`id\` - * const manyRequiredWithIdOnly = await prisma.manyRequired.createManyAndReturn({ + * const manyRequiredWithIdOnly = await prisma.manyRequired.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -8284,6 +8684,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more ManyRequireds and returns the data updated in the database. + * @param {ManyRequiredUpdateManyAndReturnArgs} args - Arguments to update many ManyRequireds. + * @example + * // Update many ManyRequireds + * const manyRequired = await prisma.manyRequired.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more ManyRequireds and only return the \`id\` + * const manyRequiredWithIdOnly = await prisma.manyRequired.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one ManyRequired. * @param {ManyRequiredUpsertArgs} args - Arguments to update or create a ManyRequired. @@ -8750,6 +9180,28 @@ export namespace Prisma { where?: ManyRequiredWhereInput } + /** + * ManyRequired updateManyAndReturn + */ + export type ManyRequiredUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the ManyRequired + */ + select?: ManyRequiredSelectUpdateManyAndReturn | null + /** + * The data used to update ManyRequireds. + */ + data: XOR + /** + * Filter which ManyRequireds to update + */ + where?: ManyRequiredWhereInput + /** + * Choose, which related nodes to fetch as well + */ + include?: ManyRequiredIncludeUpdateManyAndReturn | null + } + /** * ManyRequired upsert */ @@ -9137,6 +9589,24 @@ export namespace Prisma { opti?: boolean | OptionalSide1$optiArgs }, ExtArgs["result"]["optionalSide1"]> + export type OptionalSide1SelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + optionalSide2Id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + opti?: boolean | OptionalSide1$optiArgs + }, ExtArgs["result"]["optionalSide1"]> + export type OptionalSide1SelectScalar = { id?: boolean optionalSide2Id?: boolean @@ -9160,6 +9630,9 @@ export namespace Prisma { export type OptionalSide1IncludeCreateManyAndReturn = { opti?: boolean | OptionalSide1$optiArgs } + export type OptionalSide1IncludeUpdateManyAndReturn = { + opti?: boolean | OptionalSide1$optiArgs + } export type $OptionalSide1Payload = { name: "OptionalSide1" @@ -9187,7 +9660,7 @@ export namespace Prisma { type OptionalSide1GetPayload = $Result.GetResult - type OptionalSide1CountArgs = + type OptionalSide1CountArgs = Omit & { select?: OptionalSide1CountAggregateInputType | true } @@ -9208,7 +9681,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OptionalSide1Client<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OptionalSide1 that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OptionalSide1 that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OptionalSide1FindUniqueOrThrowArgs} args - Arguments to find a OptionalSide1 * @example @@ -9310,7 +9783,7 @@ export namespace Prisma { * }) * * // Create many OptionalSide1s and only return the \`id\` - * const optionalSide1WithIdOnly = await prisma.optionalSide1.createManyAndReturn({ + * const optionalSide1WithIdOnly = await prisma.optionalSide1.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -9386,6 +9859,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more OptionalSide1s and returns the data updated in the database. + * @param {OptionalSide1UpdateManyAndReturnArgs} args - Arguments to update many OptionalSide1s. + * @example + * // Update many OptionalSide1s + * const optionalSide1 = await prisma.optionalSide1.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more OptionalSide1s and only return the \`id\` + * const optionalSide1WithIdOnly = await prisma.optionalSide1.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one OptionalSide1. * @param {OptionalSide1UpsertArgs} args - Arguments to update or create a OptionalSide1. @@ -9852,6 +10355,28 @@ export namespace Prisma { where?: OptionalSide1WhereInput } + /** + * OptionalSide1 updateManyAndReturn + */ + export type OptionalSide1UpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OptionalSide1 + */ + select?: OptionalSide1SelectUpdateManyAndReturn | null + /** + * The data used to update OptionalSide1s. + */ + data: XOR + /** + * Filter which OptionalSide1s to update + */ + where?: OptionalSide1WhereInput + /** + * Choose, which related nodes to fetch as well + */ + include?: OptionalSide1IncludeUpdateManyAndReturn | null + } + /** * OptionalSide1 upsert */ @@ -10225,6 +10750,22 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["optionalSide2"]> + export type OptionalSide2SelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["optionalSide2"]> + export type OptionalSide2SelectScalar = { id?: boolean int?: boolean @@ -10245,6 +10786,7 @@ export namespace Prisma { opti?: boolean | OptionalSide2$optiArgs } export type OptionalSide2IncludeCreateManyAndReturn = {} + export type OptionalSide2IncludeUpdateManyAndReturn = {} export type $OptionalSide2Payload = { name: "OptionalSide2" @@ -10271,7 +10813,7 @@ export namespace Prisma { type OptionalSide2GetPayload = $Result.GetResult - type OptionalSide2CountArgs = + type OptionalSide2CountArgs = Omit & { select?: OptionalSide2CountAggregateInputType | true } @@ -10292,7 +10834,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OptionalSide2Client<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OptionalSide2 that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OptionalSide2 that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OptionalSide2FindUniqueOrThrowArgs} args - Arguments to find a OptionalSide2 * @example @@ -10394,7 +10936,7 @@ export namespace Prisma { * }) * * // Create many OptionalSide2s and only return the \`id\` - * const optionalSide2WithIdOnly = await prisma.optionalSide2.createManyAndReturn({ + * const optionalSide2WithIdOnly = await prisma.optionalSide2.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -10470,6 +11012,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more OptionalSide2s and returns the data updated in the database. + * @param {OptionalSide2UpdateManyAndReturnArgs} args - Arguments to update many OptionalSide2s. + * @example + * // Update many OptionalSide2s + * const optionalSide2 = await prisma.optionalSide2.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more OptionalSide2s and only return the \`id\` + * const optionalSide2WithIdOnly = await prisma.optionalSide2.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one OptionalSide2. * @param {OptionalSide2UpsertArgs} args - Arguments to update or create a OptionalSide2. @@ -10931,6 +11503,24 @@ export namespace Prisma { where?: OptionalSide2WhereInput } + /** + * OptionalSide2 updateManyAndReturn + */ + export type OptionalSide2UpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OptionalSide2 + */ + select?: OptionalSide2SelectUpdateManyAndReturn | null + /** + * The data used to update OptionalSide2s. + */ + data: XOR + /** + * Filter which OptionalSide2s to update + */ + where?: OptionalSide2WhereInput + } + /** * OptionalSide2 upsert */ @@ -11279,6 +11869,18 @@ export namespace Prisma { inc_bInt?: boolean }, ExtArgs["result"]["a"]> + export type ASelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean + int?: boolean + sInt?: boolean + bInt?: boolean + inc_int?: boolean + inc_sInt?: boolean + inc_bInt?: boolean + }, ExtArgs["result"]["a"]> + export type ASelectScalar = { id?: boolean email?: boolean @@ -11317,7 +11919,7 @@ export namespace Prisma { type AGetPayload = $Result.GetResult - type ACountArgs = + type ACountArgs = Omit & { select?: ACountAggregateInputType | true } @@ -11338,7 +11940,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__AClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one A that matches the filter or throw an error with \`error.code='P2025'\` + * Find one A that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {AFindUniqueOrThrowArgs} args - Arguments to find a A * @example @@ -11440,7 +12042,7 @@ export namespace Prisma { * }) * * // Create many As and only return the \`id\` - * const aWithIdOnly = await prisma.a.createManyAndReturn({ + * const aWithIdOnly = await prisma.a.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -11516,6 +12118,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more As and returns the data updated in the database. + * @param {AUpdateManyAndReturnArgs} args - Arguments to update many As. + * @example + * // Update many As + * const a = await prisma.a.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more As and only return the \`id\` + * const aWithIdOnly = await prisma.a.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one A. * @param {AUpsertArgs} args - Arguments to update or create a A. @@ -11944,6 +12576,24 @@ export namespace Prisma { where?: AWhereInput } + /** + * A updateManyAndReturn + */ + export type AUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the A + */ + select?: ASelectUpdateManyAndReturn | null + /** + * The data used to update AS. + */ + data: XOR + /** + * Filter which AS to update + */ + where?: AWhereInput + } + /** * A upsert */ @@ -12221,6 +12871,14 @@ export namespace Prisma { numFloat?: boolean }, ExtArgs["result"]["b"]> + export type BSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + float?: boolean + dFloat?: boolean + decFloat?: boolean + numFloat?: boolean + }, ExtArgs["result"]["b"]> + export type BSelectScalar = { id?: boolean float?: boolean @@ -12245,7 +12903,7 @@ export namespace Prisma { type BGetPayload = $Result.GetResult - type BCountArgs = + type BCountArgs = Omit & { select?: BCountAggregateInputType | true } @@ -12266,7 +12924,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__BClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one B that matches the filter or throw an error with \`error.code='P2025'\` + * Find one B that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {BFindUniqueOrThrowArgs} args - Arguments to find a B * @example @@ -12368,7 +13026,7 @@ export namespace Prisma { * }) * * // Create many Bs and only return the \`id\` - * const bWithIdOnly = await prisma.b.createManyAndReturn({ + * const bWithIdOnly = await prisma.b.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -12444,6 +13102,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Bs and returns the data updated in the database. + * @param {BUpdateManyAndReturnArgs} args - Arguments to update many Bs. + * @example + * // Update many Bs + * const b = await prisma.b.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Bs and only return the \`id\` + * const bWithIdOnly = await prisma.b.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one B. * @param {BUpsertArgs} args - Arguments to update or create a B. @@ -12868,6 +13556,24 @@ export namespace Prisma { where?: BWhereInput } + /** + * B updateManyAndReturn + */ + export type BUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the B + */ + select?: BSelectUpdateManyAndReturn | null + /** + * The data used to update BS. + */ + data: XOR + /** + * Filter which BS to update + */ + where?: BWhereInput + } + /** * B upsert */ @@ -13117,6 +13823,16 @@ export namespace Prisma { uuid?: boolean }, ExtArgs["result"]["c"]> + export type CSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + char?: boolean + vChar?: boolean + text?: boolean + bit?: boolean + vBit?: boolean + uuid?: boolean + }, ExtArgs["result"]["c"]> + export type CSelectScalar = { id?: boolean char?: boolean @@ -13145,7 +13861,7 @@ export namespace Prisma { type CGetPayload = $Result.GetResult - type CCountArgs = + type CCountArgs = Omit & { select?: CCountAggregateInputType | true } @@ -13166,7 +13882,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__CClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one C that matches the filter or throw an error with \`error.code='P2025'\` + * Find one C that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {CFindUniqueOrThrowArgs} args - Arguments to find a C * @example @@ -13268,7 +13984,7 @@ export namespace Prisma { * }) * * // Create many Cs and only return the \`id\` - * const cWithIdOnly = await prisma.c.createManyAndReturn({ + * const cWithIdOnly = await prisma.c.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -13344,6 +14060,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Cs and returns the data updated in the database. + * @param {CUpdateManyAndReturnArgs} args - Arguments to update many Cs. + * @example + * // Update many Cs + * const c = await prisma.c.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Cs and only return the \`id\` + * const cWithIdOnly = await prisma.c.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one C. * @param {CUpsertArgs} args - Arguments to update or create a C. @@ -13770,6 +14516,24 @@ export namespace Prisma { where?: CWhereInput } + /** + * C updateManyAndReturn + */ + export type CUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the C + */ + select?: CSelectUpdateManyAndReturn | null + /** + * The data used to update CS. + */ + data: XOR + /** + * Filter which CS to update + */ + where?: CWhereInput + } + /** * C upsert */ @@ -14041,6 +14805,16 @@ export namespace Prisma { list?: boolean }, ExtArgs["result"]["d"]> + export type DSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + bool?: boolean + byteA?: boolean + xml?: boolean + json?: boolean + jsonb?: boolean + list?: boolean + }, ExtArgs["result"]["d"]> + export type DSelectScalar = { id?: boolean bool?: boolean @@ -14069,7 +14843,7 @@ export namespace Prisma { type DGetPayload = $Result.GetResult - type DCountArgs = + type DCountArgs = Omit & { select?: DCountAggregateInputType | true } @@ -14090,7 +14864,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__DClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one D that matches the filter or throw an error with \`error.code='P2025'\` + * Find one D that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {DFindUniqueOrThrowArgs} args - Arguments to find a D * @example @@ -14192,7 +14966,7 @@ export namespace Prisma { * }) * * // Create many Ds and only return the \`id\` - * const dWithIdOnly = await prisma.d.createManyAndReturn({ + * const dWithIdOnly = await prisma.d.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -14268,6 +15042,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Ds and returns the data updated in the database. + * @param {DUpdateManyAndReturnArgs} args - Arguments to update many Ds. + * @example + * // Update many Ds + * const d = await prisma.d.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Ds and only return the \`id\` + * const dWithIdOnly = await prisma.d.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one D. * @param {DUpsertArgs} args - Arguments to update or create a D. @@ -14694,6 +15498,24 @@ export namespace Prisma { where?: DWhereInput } + /** + * D updateManyAndReturn + */ + export type DUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the D + */ + select?: DSelectUpdateManyAndReturn | null + /** + * The data used to update DS. + */ + data: XOR + /** + * Filter which DS to update + */ + where?: DWhereInput + } + /** * D upsert */ @@ -14916,6 +15738,13 @@ export namespace Prisma { ts?: boolean }, ExtArgs["result"]["e"]> + export type ESelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + date?: boolean + time?: boolean + ts?: boolean + }, ExtArgs["result"]["e"]> + export type ESelectScalar = { id?: boolean date?: boolean @@ -14938,7 +15767,7 @@ export namespace Prisma { type EGetPayload = $Result.GetResult - type ECountArgs = + type ECountArgs = Omit & { select?: ECountAggregateInputType | true } @@ -14959,7 +15788,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__EClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one E that matches the filter or throw an error with \`error.code='P2025'\` + * Find one E that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {EFindUniqueOrThrowArgs} args - Arguments to find a E * @example @@ -15061,7 +15890,7 @@ export namespace Prisma { * }) * * // Create many Es and only return the \`id\` - * const eWithIdOnly = await prisma.e.createManyAndReturn({ + * const eWithIdOnly = await prisma.e.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -15137,6 +15966,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Es and returns the data updated in the database. + * @param {EUpdateManyAndReturnArgs} args - Arguments to update many Es. + * @example + * // Update many Es + * const e = await prisma.e.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Es and only return the \`id\` + * const eWithIdOnly = await prisma.e.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one E. * @param {EUpsertArgs} args - Arguments to update or create a E. @@ -15560,6 +16419,24 @@ export namespace Prisma { where?: EWhereInput } + /** + * E updateManyAndReturn + */ + export type EUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the E + */ + select?: ESelectUpdateManyAndReturn | null + /** + * The data used to update ES. + */ + data: XOR + /** + * Filter which ES to update + */ + where?: EWhereInput + } + /** * E upsert */ diff --git a/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema/__snapshots__/library.test.ts.snap b/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema/__snapshots__/library.test.ts.snap index 43285499c3f3..df27c38e1f7e 100644 --- a/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema/__snapshots__/library.test.ts.snap +++ b/packages/client/src/__tests__/integration/happy/not-so-exhaustive-schema/__snapshots__/library.test.ts.snap @@ -477,7 +477,7 @@ export const ABeautifulEnum: typeof $Enums.ABeautifulEnum /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -486,7 +486,7 @@ export const ABeautifulEnum: typeof $Enums.ABeautifulEnum * const posts = await prisma.post.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ export class PrismaClient< @@ -498,7 +498,7 @@ export class PrismaClient< /** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -507,7 +507,7 @@ export class PrismaClient< * const posts = await prisma.post.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */ @@ -537,7 +537,7 @@ export class PrismaClient< * \`\`\` * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\` * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; @@ -549,7 +549,7 @@ export class PrismaClient< * \`\`\` * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; @@ -560,7 +560,7 @@ export class PrismaClient< * \`\`\` * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\` * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; @@ -572,7 +572,7 @@ export class PrismaClient< * \`\`\` * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; @@ -1251,6 +1251,10 @@ export namespace Prisma { args: Prisma.PostUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.PostUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.PostUpsertArgs result: $Utils.PayloadToResult @@ -1321,6 +1325,10 @@ export namespace Prisma { args: Prisma.UserUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.UserUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.UserUpsertArgs result: $Utils.PayloadToResult @@ -1391,6 +1399,10 @@ export namespace Prisma { args: Prisma.MUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.MUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.MUpsertArgs result: $Utils.PayloadToResult @@ -1461,6 +1473,10 @@ export namespace Prisma { args: Prisma.NUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.NUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.NUpsertArgs result: $Utils.PayloadToResult @@ -1531,6 +1547,10 @@ export namespace Prisma { args: Prisma.OneOptionalUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.OneOptionalUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.OneOptionalUpsertArgs result: $Utils.PayloadToResult @@ -1601,6 +1621,10 @@ export namespace Prisma { args: Prisma.ManyRequiredUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.ManyRequiredUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.ManyRequiredUpsertArgs result: $Utils.PayloadToResult @@ -1671,6 +1695,10 @@ export namespace Prisma { args: Prisma.OptionalSide1UpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.OptionalSide1UpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.OptionalSide1UpsertArgs result: $Utils.PayloadToResult @@ -1741,6 +1769,10 @@ export namespace Prisma { args: Prisma.OptionalSide2UpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.OptionalSide2UpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.OptionalSide2UpsertArgs result: $Utils.PayloadToResult @@ -1811,6 +1843,10 @@ export namespace Prisma { args: Prisma.AUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.AUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.AUpsertArgs result: $Utils.PayloadToResult @@ -1881,6 +1917,10 @@ export namespace Prisma { args: Prisma.BUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.BUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.BUpsertArgs result: $Utils.PayloadToResult @@ -1951,6 +1991,10 @@ export namespace Prisma { args: Prisma.CUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.CUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.CUpsertArgs result: $Utils.PayloadToResult @@ -2021,6 +2065,10 @@ export namespace Prisma { args: Prisma.DUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.DUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.DUpsertArgs result: $Utils.PayloadToResult @@ -2091,6 +2139,10 @@ export namespace Prisma { args: Prisma.EUpdateManyArgs result: BatchPayload } + updateManyAndReturn: { + args: Prisma.EUpdateManyAndReturnArgs + result: $Utils.PayloadToResult[] + } upsert: { args: Prisma.EUpsertArgs result: $Utils.PayloadToResult @@ -2218,6 +2270,7 @@ export namespace Prisma { | 'createManyAndReturn' | 'update' | 'updateMany' + | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' @@ -2616,6 +2669,16 @@ export namespace Prisma { author?: boolean | UserDefaultArgs }, ExtArgs["result"]["post"]> + export type PostSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | UserDefaultArgs + }, ExtArgs["result"]["post"]> + export type PostSelectScalar = { id?: boolean createdAt?: boolean @@ -2631,6 +2694,9 @@ export namespace Prisma { export type PostIncludeCreateManyAndReturn = { author?: boolean | UserDefaultArgs } + export type PostIncludeUpdateManyAndReturn = { + author?: boolean | UserDefaultArgs + } export type $PostPayload = { name: "Post" @@ -2650,7 +2716,7 @@ export namespace Prisma { type PostGetPayload = $Result.GetResult - type PostCountArgs = + type PostCountArgs = Omit & { select?: PostCountAggregateInputType | true } @@ -2671,7 +2737,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__PostClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one Post that matches the filter or throw an error with \`error.code='P2025'\` + * Find one Post that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {PostFindUniqueOrThrowArgs} args - Arguments to find a Post * @example @@ -2773,7 +2839,7 @@ export namespace Prisma { * }) * * // Create many Posts and only return the \`id\` - * const postWithIdOnly = await prisma.post.createManyAndReturn({ + * const postWithIdOnly = await prisma.post.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -2849,6 +2915,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Posts and returns the data updated in the database. + * @param {PostUpdateManyAndReturnArgs} args - Arguments to update many Posts. + * @example + * // Update many Posts + * const post = await prisma.post.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Posts and only return the \`id\` + * const postWithIdOnly = await prisma.post.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one Post. * @param {PostUpsertArgs} args - Arguments to update or create a Post. @@ -3307,6 +3403,28 @@ export namespace Prisma { where?: PostWhereInput } + /** + * Post updateManyAndReturn + */ + export type PostUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: PostSelectUpdateManyAndReturn | null + /** + * The data used to update Posts. + */ + data: XOR + /** + * Filter which Posts to update + */ + where?: PostWhereInput + /** + * Choose, which related nodes to fetch as well + */ + include?: PostIncludeUpdateManyAndReturn | null + } + /** * Post upsert */ @@ -3675,6 +3793,23 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["user"]> + export type UserSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + email?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["user"]> + export type UserSelectScalar = { id?: boolean email?: boolean @@ -3697,6 +3832,7 @@ export namespace Prisma { _count?: boolean | UserCountOutputTypeDefaultArgs } export type UserIncludeCreateManyAndReturn = {} + export type UserIncludeUpdateManyAndReturn = {} export type $UserPayload = { name: "User" @@ -3724,7 +3860,7 @@ export namespace Prisma { type UserGetPayload = $Result.GetResult - type UserCountArgs = + type UserCountArgs = Omit & { select?: UserCountAggregateInputType | true } @@ -3745,7 +3881,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__UserClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one User that matches the filter or throw an error with \`error.code='P2025'\` + * Find one User that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User * @example @@ -3847,7 +3983,7 @@ export namespace Prisma { * }) * * // Create many Users and only return the \`id\` - * const userWithIdOnly = await prisma.user.createManyAndReturn({ + * const userWithIdOnly = await prisma.user.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -3923,6 +4059,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Users and returns the data updated in the database. + * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. + * @example + * // Update many Users + * const user = await prisma.user.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Users and only return the \`id\` + * const userWithIdOnly = await prisma.user.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one User. * @param {UserUpsertArgs} args - Arguments to update or create a User. @@ -4385,6 +4551,24 @@ export namespace Prisma { where?: UserWhereInput } + /** + * User updateManyAndReturn + */ + export type UserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: UserSelectUpdateManyAndReturn | null + /** + * The data used to update Users. + */ + data: XOR + /** + * Filter which Users to update + */ + where?: UserWhereInput + } + /** * User upsert */ @@ -4764,6 +4948,22 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["m"]> + export type MSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["m"]> + export type MSelectScalar = { id?: boolean int?: boolean @@ -4785,6 +4985,7 @@ export namespace Prisma { _count?: boolean | MCountOutputTypeDefaultArgs } export type MIncludeCreateManyAndReturn = {} + export type MIncludeUpdateManyAndReturn = {} export type $MPayload = { name: "M" @@ -4811,7 +5012,7 @@ export namespace Prisma { type MGetPayload = $Result.GetResult - type MCountArgs = + type MCountArgs = Omit & { select?: MCountAggregateInputType | true } @@ -4832,7 +5033,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__MClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one M that matches the filter or throw an error with \`error.code='P2025'\` + * Find one M that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {MFindUniqueOrThrowArgs} args - Arguments to find a M * @example @@ -4934,7 +5135,7 @@ export namespace Prisma { * }) * * // Create many Ms and only return the \`id\` - * const mWithIdOnly = await prisma.m.createManyAndReturn({ + * const mWithIdOnly = await prisma.m.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -5010,6 +5211,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Ms and returns the data updated in the database. + * @param {MUpdateManyAndReturnArgs} args - Arguments to update many Ms. + * @example + * // Update many Ms + * const m = await prisma.m.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Ms and only return the \`id\` + * const mWithIdOnly = await prisma.m.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one M. * @param {MUpsertArgs} args - Arguments to update or create a M. @@ -5471,6 +5702,24 @@ export namespace Prisma { where?: MWhereInput } + /** + * M updateManyAndReturn + */ + export type MUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the M + */ + select?: MSelectUpdateManyAndReturn | null + /** + * The data used to update MS. + */ + data: XOR + /** + * Filter which MS to update + */ + where?: MWhereInput + } + /** * M upsert */ @@ -5850,6 +6099,22 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["n"]> + export type NSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["n"]> + export type NSelectScalar = { id?: boolean int?: boolean @@ -5871,6 +6136,7 @@ export namespace Prisma { _count?: boolean | NCountOutputTypeDefaultArgs } export type NIncludeCreateManyAndReturn = {} + export type NIncludeUpdateManyAndReturn = {} export type $NPayload = { name: "N" @@ -5897,7 +6163,7 @@ export namespace Prisma { type NGetPayload = $Result.GetResult - type NCountArgs = + type NCountArgs = Omit & { select?: NCountAggregateInputType | true } @@ -5918,7 +6184,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__NClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one N that matches the filter or throw an error with \`error.code='P2025'\` + * Find one N that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {NFindUniqueOrThrowArgs} args - Arguments to find a N * @example @@ -6020,7 +6286,7 @@ export namespace Prisma { * }) * * // Create many Ns and only return the \`id\` - * const nWithIdOnly = await prisma.n.createManyAndReturn({ + * const nWithIdOnly = await prisma.n.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -6096,6 +6362,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Ns and returns the data updated in the database. + * @param {NUpdateManyAndReturnArgs} args - Arguments to update many Ns. + * @example + * // Update many Ns + * const n = await prisma.n.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Ns and only return the \`id\` + * const nWithIdOnly = await prisma.n.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one N. * @param {NUpsertArgs} args - Arguments to update or create a N. @@ -6558,23 +6854,41 @@ export namespace Prisma { } /** - * N upsert + * N updateManyAndReturn */ - export type NUpsertArgs = { + export type NUpdateManyAndReturnArgs = { /** * Select specific fields to fetch from the N */ - select?: NSelect | null - /** - * Choose, which related nodes to fetch as well - */ - include?: NInclude | null + select?: NSelectUpdateManyAndReturn | null /** - * The filter to search for the N to update in case it exists. + * The data used to update NS. */ - where: NWhereUniqueInput + data: XOR /** - * In case the N found by the \`where\` argument doesn't exist, create a new N with this data. + * Filter which NS to update + */ + where?: NWhereInput + } + + /** + * N upsert + */ + export type NUpsertArgs = { + /** + * Select specific fields to fetch from the N + */ + select?: NSelect | null + /** + * Choose, which related nodes to fetch as well + */ + include?: NInclude | null + /** + * The filter to search for the N to update in case it exists. + */ + where: NWhereUniqueInput + /** + * In case the N found by the \`where\` argument doesn't exist, create a new N with this data. */ create: XOR /** @@ -6936,6 +7250,22 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["oneOptional"]> + export type OneOptionalSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["oneOptional"]> + export type OneOptionalSelectScalar = { id?: boolean int?: boolean @@ -6957,6 +7287,7 @@ export namespace Prisma { _count?: boolean | OneOptionalCountOutputTypeDefaultArgs } export type OneOptionalIncludeCreateManyAndReturn = {} + export type OneOptionalIncludeUpdateManyAndReturn = {} export type $OneOptionalPayload = { name: "OneOptional" @@ -6983,7 +7314,7 @@ export namespace Prisma { type OneOptionalGetPayload = $Result.GetResult - type OneOptionalCountArgs = + type OneOptionalCountArgs = Omit & { select?: OneOptionalCountAggregateInputType | true } @@ -7004,7 +7335,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OneOptionalClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OneOptional that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OneOptional that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OneOptionalFindUniqueOrThrowArgs} args - Arguments to find a OneOptional * @example @@ -7106,7 +7437,7 @@ export namespace Prisma { * }) * * // Create many OneOptionals and only return the \`id\` - * const oneOptionalWithIdOnly = await prisma.oneOptional.createManyAndReturn({ + * const oneOptionalWithIdOnly = await prisma.oneOptional.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -7182,6 +7513,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more OneOptionals and returns the data updated in the database. + * @param {OneOptionalUpdateManyAndReturnArgs} args - Arguments to update many OneOptionals. + * @example + * // Update many OneOptionals + * const oneOptional = await prisma.oneOptional.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more OneOptionals and only return the \`id\` + * const oneOptionalWithIdOnly = await prisma.oneOptional.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one OneOptional. * @param {OneOptionalUpsertArgs} args - Arguments to update or create a OneOptional. @@ -7643,6 +8004,24 @@ export namespace Prisma { where?: OneOptionalWhereInput } + /** + * OneOptional updateManyAndReturn + */ + export type OneOptionalUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OneOptional + */ + select?: OneOptionalSelectUpdateManyAndReturn | null + /** + * The data used to update OneOptionals. + */ + data: XOR + /** + * Filter which OneOptionals to update + */ + where?: OneOptionalWhereInput + } + /** * OneOptional upsert */ @@ -8035,6 +8414,24 @@ export namespace Prisma { one?: boolean | ManyRequired$oneArgs }, ExtArgs["result"]["manyRequired"]> + export type ManyRequiredSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + oneOptionalId?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + one?: boolean | ManyRequired$oneArgs + }, ExtArgs["result"]["manyRequired"]> + export type ManyRequiredSelectScalar = { id?: boolean oneOptionalId?: boolean @@ -8058,6 +8455,9 @@ export namespace Prisma { export type ManyRequiredIncludeCreateManyAndReturn = { one?: boolean | ManyRequired$oneArgs } + export type ManyRequiredIncludeUpdateManyAndReturn = { + one?: boolean | ManyRequired$oneArgs + } export type $ManyRequiredPayload = { name: "ManyRequired" @@ -8085,7 +8485,7 @@ export namespace Prisma { type ManyRequiredGetPayload = $Result.GetResult - type ManyRequiredCountArgs = + type ManyRequiredCountArgs = Omit & { select?: ManyRequiredCountAggregateInputType | true } @@ -8106,7 +8506,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__ManyRequiredClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one ManyRequired that matches the filter or throw an error with \`error.code='P2025'\` + * Find one ManyRequired that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {ManyRequiredFindUniqueOrThrowArgs} args - Arguments to find a ManyRequired * @example @@ -8208,7 +8608,7 @@ export namespace Prisma { * }) * * // Create many ManyRequireds and only return the \`id\` - * const manyRequiredWithIdOnly = await prisma.manyRequired.createManyAndReturn({ + * const manyRequiredWithIdOnly = await prisma.manyRequired.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -8284,6 +8684,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more ManyRequireds and returns the data updated in the database. + * @param {ManyRequiredUpdateManyAndReturnArgs} args - Arguments to update many ManyRequireds. + * @example + * // Update many ManyRequireds + * const manyRequired = await prisma.manyRequired.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more ManyRequireds and only return the \`id\` + * const manyRequiredWithIdOnly = await prisma.manyRequired.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one ManyRequired. * @param {ManyRequiredUpsertArgs} args - Arguments to update or create a ManyRequired. @@ -8750,6 +9180,28 @@ export namespace Prisma { where?: ManyRequiredWhereInput } + /** + * ManyRequired updateManyAndReturn + */ + export type ManyRequiredUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the ManyRequired + */ + select?: ManyRequiredSelectUpdateManyAndReturn | null + /** + * The data used to update ManyRequireds. + */ + data: XOR + /** + * Filter which ManyRequireds to update + */ + where?: ManyRequiredWhereInput + /** + * Choose, which related nodes to fetch as well + */ + include?: ManyRequiredIncludeUpdateManyAndReturn | null + } + /** * ManyRequired upsert */ @@ -9137,6 +9589,24 @@ export namespace Prisma { opti?: boolean | OptionalSide1$optiArgs }, ExtArgs["result"]["optionalSide1"]> + export type OptionalSide1SelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + optionalSide2Id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + opti?: boolean | OptionalSide1$optiArgs + }, ExtArgs["result"]["optionalSide1"]> + export type OptionalSide1SelectScalar = { id?: boolean optionalSide2Id?: boolean @@ -9160,6 +9630,9 @@ export namespace Prisma { export type OptionalSide1IncludeCreateManyAndReturn = { opti?: boolean | OptionalSide1$optiArgs } + export type OptionalSide1IncludeUpdateManyAndReturn = { + opti?: boolean | OptionalSide1$optiArgs + } export type $OptionalSide1Payload = { name: "OptionalSide1" @@ -9187,7 +9660,7 @@ export namespace Prisma { type OptionalSide1GetPayload = $Result.GetResult - type OptionalSide1CountArgs = + type OptionalSide1CountArgs = Omit & { select?: OptionalSide1CountAggregateInputType | true } @@ -9208,7 +9681,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OptionalSide1Client<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OptionalSide1 that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OptionalSide1 that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OptionalSide1FindUniqueOrThrowArgs} args - Arguments to find a OptionalSide1 * @example @@ -9310,7 +9783,7 @@ export namespace Prisma { * }) * * // Create many OptionalSide1s and only return the \`id\` - * const optionalSide1WithIdOnly = await prisma.optionalSide1.createManyAndReturn({ + * const optionalSide1WithIdOnly = await prisma.optionalSide1.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -9386,6 +9859,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more OptionalSide1s and returns the data updated in the database. + * @param {OptionalSide1UpdateManyAndReturnArgs} args - Arguments to update many OptionalSide1s. + * @example + * // Update many OptionalSide1s + * const optionalSide1 = await prisma.optionalSide1.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more OptionalSide1s and only return the \`id\` + * const optionalSide1WithIdOnly = await prisma.optionalSide1.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one OptionalSide1. * @param {OptionalSide1UpsertArgs} args - Arguments to update or create a OptionalSide1. @@ -9852,6 +10355,28 @@ export namespace Prisma { where?: OptionalSide1WhereInput } + /** + * OptionalSide1 updateManyAndReturn + */ + export type OptionalSide1UpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OptionalSide1 + */ + select?: OptionalSide1SelectUpdateManyAndReturn | null + /** + * The data used to update OptionalSide1s. + */ + data: XOR + /** + * Filter which OptionalSide1s to update + */ + where?: OptionalSide1WhereInput + /** + * Choose, which related nodes to fetch as well + */ + include?: OptionalSide1IncludeUpdateManyAndReturn | null + } + /** * OptionalSide1 upsert */ @@ -10225,6 +10750,22 @@ export namespace Prisma { optionalBoolean?: boolean }, ExtArgs["result"]["optionalSide2"]> + export type OptionalSide2SelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + int?: boolean + optionalInt?: boolean + float?: boolean + optionalFloat?: boolean + string?: boolean + optionalString?: boolean + json?: boolean + optionalJson?: boolean + enum?: boolean + optionalEnum?: boolean + boolean?: boolean + optionalBoolean?: boolean + }, ExtArgs["result"]["optionalSide2"]> + export type OptionalSide2SelectScalar = { id?: boolean int?: boolean @@ -10245,6 +10786,7 @@ export namespace Prisma { opti?: boolean | OptionalSide2$optiArgs } export type OptionalSide2IncludeCreateManyAndReturn = {} + export type OptionalSide2IncludeUpdateManyAndReturn = {} export type $OptionalSide2Payload = { name: "OptionalSide2" @@ -10271,7 +10813,7 @@ export namespace Prisma { type OptionalSide2GetPayload = $Result.GetResult - type OptionalSide2CountArgs = + type OptionalSide2CountArgs = Omit & { select?: OptionalSide2CountAggregateInputType | true } @@ -10292,7 +10834,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__OptionalSide2Client<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one OptionalSide2 that matches the filter or throw an error with \`error.code='P2025'\` + * Find one OptionalSide2 that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {OptionalSide2FindUniqueOrThrowArgs} args - Arguments to find a OptionalSide2 * @example @@ -10394,7 +10936,7 @@ export namespace Prisma { * }) * * // Create many OptionalSide2s and only return the \`id\` - * const optionalSide2WithIdOnly = await prisma.optionalSide2.createManyAndReturn({ + * const optionalSide2WithIdOnly = await prisma.optionalSide2.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -10470,6 +11012,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more OptionalSide2s and returns the data updated in the database. + * @param {OptionalSide2UpdateManyAndReturnArgs} args - Arguments to update many OptionalSide2s. + * @example + * // Update many OptionalSide2s + * const optionalSide2 = await prisma.optionalSide2.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more OptionalSide2s and only return the \`id\` + * const optionalSide2WithIdOnly = await prisma.optionalSide2.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one OptionalSide2. * @param {OptionalSide2UpsertArgs} args - Arguments to update or create a OptionalSide2. @@ -10931,6 +11503,24 @@ export namespace Prisma { where?: OptionalSide2WhereInput } + /** + * OptionalSide2 updateManyAndReturn + */ + export type OptionalSide2UpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the OptionalSide2 + */ + select?: OptionalSide2SelectUpdateManyAndReturn | null + /** + * The data used to update OptionalSide2s. + */ + data: XOR + /** + * Filter which OptionalSide2s to update + */ + where?: OptionalSide2WhereInput + } + /** * OptionalSide2 upsert */ @@ -11279,6 +11869,18 @@ export namespace Prisma { inc_bInt?: boolean }, ExtArgs["result"]["a"]> + export type ASelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean + int?: boolean + sInt?: boolean + bInt?: boolean + inc_int?: boolean + inc_sInt?: boolean + inc_bInt?: boolean + }, ExtArgs["result"]["a"]> + export type ASelectScalar = { id?: boolean email?: boolean @@ -11317,7 +11919,7 @@ export namespace Prisma { type AGetPayload = $Result.GetResult - type ACountArgs = + type ACountArgs = Omit & { select?: ACountAggregateInputType | true } @@ -11338,7 +11940,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__AClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one A that matches the filter or throw an error with \`error.code='P2025'\` + * Find one A that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {AFindUniqueOrThrowArgs} args - Arguments to find a A * @example @@ -11440,7 +12042,7 @@ export namespace Prisma { * }) * * // Create many As and only return the \`id\` - * const aWithIdOnly = await prisma.a.createManyAndReturn({ + * const aWithIdOnly = await prisma.a.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -11516,6 +12118,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more As and returns the data updated in the database. + * @param {AUpdateManyAndReturnArgs} args - Arguments to update many As. + * @example + * // Update many As + * const a = await prisma.a.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more As and only return the \`id\` + * const aWithIdOnly = await prisma.a.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one A. * @param {AUpsertArgs} args - Arguments to update or create a A. @@ -11944,6 +12576,24 @@ export namespace Prisma { where?: AWhereInput } + /** + * A updateManyAndReturn + */ + export type AUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the A + */ + select?: ASelectUpdateManyAndReturn | null + /** + * The data used to update AS. + */ + data: XOR + /** + * Filter which AS to update + */ + where?: AWhereInput + } + /** * A upsert */ @@ -12221,6 +12871,14 @@ export namespace Prisma { numFloat?: boolean }, ExtArgs["result"]["b"]> + export type BSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + float?: boolean + dFloat?: boolean + decFloat?: boolean + numFloat?: boolean + }, ExtArgs["result"]["b"]> + export type BSelectScalar = { id?: boolean float?: boolean @@ -12245,7 +12903,7 @@ export namespace Prisma { type BGetPayload = $Result.GetResult - type BCountArgs = + type BCountArgs = Omit & { select?: BCountAggregateInputType | true } @@ -12266,7 +12924,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__BClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one B that matches the filter or throw an error with \`error.code='P2025'\` + * Find one B that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {BFindUniqueOrThrowArgs} args - Arguments to find a B * @example @@ -12368,7 +13026,7 @@ export namespace Prisma { * }) * * // Create many Bs and only return the \`id\` - * const bWithIdOnly = await prisma.b.createManyAndReturn({ + * const bWithIdOnly = await prisma.b.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -12444,6 +13102,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Bs and returns the data updated in the database. + * @param {BUpdateManyAndReturnArgs} args - Arguments to update many Bs. + * @example + * // Update many Bs + * const b = await prisma.b.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Bs and only return the \`id\` + * const bWithIdOnly = await prisma.b.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one B. * @param {BUpsertArgs} args - Arguments to update or create a B. @@ -12868,6 +13556,24 @@ export namespace Prisma { where?: BWhereInput } + /** + * B updateManyAndReturn + */ + export type BUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the B + */ + select?: BSelectUpdateManyAndReturn | null + /** + * The data used to update BS. + */ + data: XOR + /** + * Filter which BS to update + */ + where?: BWhereInput + } + /** * B upsert */ @@ -13117,6 +13823,16 @@ export namespace Prisma { uuid?: boolean }, ExtArgs["result"]["c"]> + export type CSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + char?: boolean + vChar?: boolean + text?: boolean + bit?: boolean + vBit?: boolean + uuid?: boolean + }, ExtArgs["result"]["c"]> + export type CSelectScalar = { id?: boolean char?: boolean @@ -13145,7 +13861,7 @@ export namespace Prisma { type CGetPayload = $Result.GetResult - type CCountArgs = + type CCountArgs = Omit & { select?: CCountAggregateInputType | true } @@ -13166,7 +13882,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__CClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one C that matches the filter or throw an error with \`error.code='P2025'\` + * Find one C that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {CFindUniqueOrThrowArgs} args - Arguments to find a C * @example @@ -13268,7 +13984,7 @@ export namespace Prisma { * }) * * // Create many Cs and only return the \`id\` - * const cWithIdOnly = await prisma.c.createManyAndReturn({ + * const cWithIdOnly = await prisma.c.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -13344,6 +14060,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Cs and returns the data updated in the database. + * @param {CUpdateManyAndReturnArgs} args - Arguments to update many Cs. + * @example + * // Update many Cs + * const c = await prisma.c.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Cs and only return the \`id\` + * const cWithIdOnly = await prisma.c.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one C. * @param {CUpsertArgs} args - Arguments to update or create a C. @@ -13770,6 +14516,24 @@ export namespace Prisma { where?: CWhereInput } + /** + * C updateManyAndReturn + */ + export type CUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the C + */ + select?: CSelectUpdateManyAndReturn | null + /** + * The data used to update CS. + */ + data: XOR + /** + * Filter which CS to update + */ + where?: CWhereInput + } + /** * C upsert */ @@ -14041,6 +14805,16 @@ export namespace Prisma { list?: boolean }, ExtArgs["result"]["d"]> + export type DSelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + bool?: boolean + byteA?: boolean + xml?: boolean + json?: boolean + jsonb?: boolean + list?: boolean + }, ExtArgs["result"]["d"]> + export type DSelectScalar = { id?: boolean bool?: boolean @@ -14069,7 +14843,7 @@ export namespace Prisma { type DGetPayload = $Result.GetResult - type DCountArgs = + type DCountArgs = Omit & { select?: DCountAggregateInputType | true } @@ -14090,7 +14864,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__DClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one D that matches the filter or throw an error with \`error.code='P2025'\` + * Find one D that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {DFindUniqueOrThrowArgs} args - Arguments to find a D * @example @@ -14192,7 +14966,7 @@ export namespace Prisma { * }) * * // Create many Ds and only return the \`id\` - * const dWithIdOnly = await prisma.d.createManyAndReturn({ + * const dWithIdOnly = await prisma.d.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -14268,6 +15042,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Ds and returns the data updated in the database. + * @param {DUpdateManyAndReturnArgs} args - Arguments to update many Ds. + * @example + * // Update many Ds + * const d = await prisma.d.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Ds and only return the \`id\` + * const dWithIdOnly = await prisma.d.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one D. * @param {DUpsertArgs} args - Arguments to update or create a D. @@ -14694,6 +15498,24 @@ export namespace Prisma { where?: DWhereInput } + /** + * D updateManyAndReturn + */ + export type DUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the D + */ + select?: DSelectUpdateManyAndReturn | null + /** + * The data used to update DS. + */ + data: XOR + /** + * Filter which DS to update + */ + where?: DWhereInput + } + /** * D upsert */ @@ -14916,6 +15738,13 @@ export namespace Prisma { ts?: boolean }, ExtArgs["result"]["e"]> + export type ESelectUpdateManyAndReturn = $Extensions.GetSelect<{ + id?: boolean + date?: boolean + time?: boolean + ts?: boolean + }, ExtArgs["result"]["e"]> + export type ESelectScalar = { id?: boolean date?: boolean @@ -14938,7 +15767,7 @@ export namespace Prisma { type EGetPayload = $Result.GetResult - type ECountArgs = + type ECountArgs = Omit & { select?: ECountAggregateInputType | true } @@ -14959,7 +15788,7 @@ export namespace Prisma { findUnique(args: SelectSubset>): Prisma__EClient<$Result.GetResult, T, "findUnique"> | null, null, ExtArgs> /** - * Find one E that matches the filter or throw an error with \`error.code='P2025'\` + * Find one E that matches the filter or throw an error with \`error.code='P2025'\` * if no matches were found. * @param {EFindUniqueOrThrowArgs} args - Arguments to find a E * @example @@ -15061,7 +15890,7 @@ export namespace Prisma { * }) * * // Create many Es and only return the \`id\` - * const eWithIdOnly = await prisma.e.createManyAndReturn({ + * const eWithIdOnly = await prisma.e.createManyAndReturn({ * select: { id: true }, * data: [ * // ... provide data here @@ -15137,6 +15966,36 @@ export namespace Prisma { */ updateMany(args: SelectSubset>): Prisma.PrismaPromise + /** + * Update zero or more Es and returns the data updated in the database. + * @param {EUpdateManyAndReturnArgs} args - Arguments to update many Es. + * @example + * // Update many Es + * const e = await prisma.e.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Es and only return the \`id\` + * const eWithIdOnly = await prisma.e.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing \`undefined\` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: SelectSubset>): Prisma.PrismaPromise<$Result.GetResult, T, "updateManyAndReturn">> + /** * Create or update one E. * @param {EUpsertArgs} args - Arguments to update or create a E. @@ -15560,6 +16419,24 @@ export namespace Prisma { where?: EWhereInput } + /** + * E updateManyAndReturn + */ + export type EUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the E + */ + select?: ESelectUpdateManyAndReturn | null + /** + * The data used to update ES. + */ + data: XOR + /** + * Filter which ES to update + */ + where?: EWhereInput + } + /** * E upsert */ diff --git a/packages/client/src/generation/TSClient/Model.ts b/packages/client/src/generation/TSClient/Model.ts index 09db86e93d17..672a568e93c2 100644 --- a/packages/client/src/generation/TSClient/Model.ts +++ b/packages/client/src/generation/TSClient/Model.ts @@ -20,13 +20,16 @@ import { getGroupByName, getGroupByPayloadName, getIncludeCreateManyAndReturnName, + getIncludeUpdateManyAndReturnName, getMaxAggregateName, getMinAggregateName, getModelArgName, getModelFieldArgsName, getPayloadName, getSelectCreateManyAndReturnName, + getSelectUpdateManyAndReturnName, getSumAggregateName, + getUpdateManyAndReturnOutputType, } from '../utils' import { InputField } from './../TSClient' import { ArgsTypeBuilder } from './Args' @@ -44,6 +47,7 @@ import { getModelActions } from './utils/getModelActions' export class Model implements Generable { protected type: DMMF.OutputType protected createManyAndReturnType: undefined | DMMF.OutputType + protected updateManyAndReturnType: undefined | DMMF.OutputType protected mapping?: DMMF.ModelMapping private dmmf: DMMFHelper constructor(protected readonly model: DMMF.Model, protected readonly context: GenerateContext) { @@ -51,6 +55,7 @@ export class Model implements Generable { this.type = this.context.dmmf.outputTypeMap.model[model.name] this.createManyAndReturnType = this.context.dmmf.outputTypeMap.model[getCreateManyAndReturnOutputType(model.name)] + this.updateManyAndReturnType = this.context.dmmf.outputTypeMap.model[getUpdateManyAndReturnOutputType(model.name)] this.mapping = this.context.dmmf.mappings.modelOperations.find((m) => m.model === model.name)! } @@ -91,6 +96,19 @@ export class Model implements Generable { ) } argsTypes.push(args.createExport()) + } else if (action === 'updateManyAndReturn') { + const args = new ArgsTypeBuilder(this.type, this.context, action as DMMF.ModelAction) + .addSelectArg(getSelectUpdateManyAndReturnName(this.type.name)) + .addOmitArg() + .addSchemaArgs(field.args) + + if (this.updateManyAndReturnType) { + args.addIncludeArgIfHasRelations( + getIncludeUpdateManyAndReturnName(this.model.name), + this.updateManyAndReturnType, + ) + } + argsTypes.push(args.createExport()) } else if (action !== 'groupBy' && action !== 'aggregate') { argsTypes.push( new ArgsTypeBuilder(this.type, this.context, action as DMMF.ModelAction) @@ -359,6 +377,21 @@ export type ${getAggregateGetName(model.name)} = + ? `type ${countArgsName} = Omit<${getModelArgName(name, DMMF.ModelAction.findMany)}, ${excludedArgsForCountType}> & { select?: ${getCountAggregateInputName(name)} | true } @@ -673,7 +719,10 @@ export function getReturnType({ return ts.prismaPromise(ts.namedType('BatchPayload')) } - const isList = actionName === DMMF.ModelAction.findMany || actionName === DMMF.ModelAction.createManyAndReturn + const isList = + actionName === DMMF.ModelAction.findMany || + actionName === DMMF.ModelAction.createManyAndReturn || + actionName === DMMF.ModelAction.updateManyAndReturn /** * Important: We handle findMany or isList special, as we don't want chaining from there diff --git a/packages/client/src/generation/TSClient/PrismaClient.ts b/packages/client/src/generation/TSClient/PrismaClient.ts index 1d5666b06c92..dd9bb07d135d 100644 --- a/packages/client/src/generation/TSClient/PrismaClient.ts +++ b/packages/client/src/generation/TSClient/PrismaClient.ts @@ -84,6 +84,7 @@ function clientTypeMapModelsResultDefinition( if (action === 'createMany') return ts.namedType('BatchPayload') if (action === 'createManyAndReturn') return ts.array(payloadToResult(modelName)) if (action === 'updateMany') return ts.namedType('BatchPayload') + if (action === 'updateManyAndReturn') return ts.array(payloadToResult(modelName)) if (action === 'findMany') return ts.array(payloadToResult(modelName)) if (action === 'findFirst') return ts.unionType([payloadToResult(modelName), ts.nullType]) if (action === 'findUnique') return ts.unionType([payloadToResult(modelName), ts.nullType]) @@ -262,7 +263,7 @@ function queryRawDefinition(context: GenerateContext) { * \`\`\` * const result = await prisma.$queryRaw\`SELECT * FROM User WHERE id = \${1} OR email = \${'user@email.com'};\` * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; @@ -274,7 +275,7 @@ function queryRawDefinition(context: GenerateContext) { * \`\`\` * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise;` @@ -293,7 +294,7 @@ function executeRawDefinition(context: GenerateContext) { * \`\`\` * const result = await prisma.$executeRaw\`UPDATE User SET cool = \${true} WHERE email = \${'user@email.com'};\` * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; @@ -305,7 +306,7 @@ function executeRawDefinition(context: GenerateContext) { * \`\`\` * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') * \`\`\` - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). */ $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise;` @@ -357,7 +358,7 @@ function metricDefinition(context: GenerateContext) { .setDocComment( ts.docComment` Gives access to the client metrics in json or prometheus format. - + @example \`\`\` const metrics = await prisma.$metrics.json() @@ -390,7 +391,7 @@ function runCommandRawDefinition(context: GenerateContext) { explain: false, }) \`\`\` - + Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). `) @@ -445,7 +446,7 @@ export class PrismaClientClass implements Generable { return `/** * ## Prisma Client ʲˢ - * + * * Type-safe database client for TypeScript & Node.js * @example * \`\`\` @@ -454,7 +455,7 @@ export class PrismaClientClass implements Generable { * const ${lowerCase(example.plural)} = await prisma.${lowerCase(example.model)}.findMany() * \`\`\` * - * + * * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). */` } @@ -584,6 +585,7 @@ export type PrismaAction = | 'createManyAndReturn' | 'update' | 'updateMany' + | 'updateManyAndReturn' | 'upsert' | 'delete' | 'deleteMany' @@ -652,7 +654,7 @@ export type TransactionClient = Omit { const onlySelect = ctx.firstScalar ? `\n// Create many ${ctx.plural} and only return the \`${ctx.firstScalar.name}\` -const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({ +const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({ select: { ${ctx.firstScalar.name}: true }, data: [ // ... provide data here @@ -152,7 +152,7 @@ const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ }, findUniqueOrThrow: { body: (ctx) => - `Find one ${ctx.singular} that matches the filter or throw an error with \`error.code='P2025'\` + `Find one ${ctx.singular} that matches the filter or throw an error with \`error.code='P2025'\` if no matches were found. @param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to find a ${ctx.singular} @example @@ -378,6 +378,42 @@ const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ where: (singular, plural) => `Filter which ${plural} to update`, }, }, + updateManyAndReturn: { + body: (ctx) => { + const onlySelect = ctx.firstScalar + ? `\n// Update zero or more ${ctx.plural} and only return the \`${ctx.firstScalar.name}\` +const ${lowerCase(ctx.mapping.model)}With${capitalize(ctx.firstScalar.name)}Only = await ${ctx.method}({ + select: { ${ctx.firstScalar.name}: true }, + where: { + // ... provide filter here + }, + data: [ + // ... provide data here + ] +})` + : '' + + return `Update zero or more ${ctx.plural} and returns the data updated in the database. +@param {${getModelArgName(ctx.model.name, ctx.action)}} args - Arguments to update many ${ctx.plural}. +@example +// Update many ${ctx.plural} +const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ + where: { + // ... provide filter here + }, + data: [ + // ... provide data here + ] +}) +${onlySelect} +${undefinedNote} +` + }, + fields: { + data: (singular, plural) => `The data used to update ${plural}.`, + where: (singular, plural) => `Filter which ${plural} to update`, + }, + }, deleteMany: { body: (ctx) => `Delete zero or more ${ctx.plural}. @@ -418,7 +454,7 @@ const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ @param {${getModelArgName(ctx.model.name, ctx.action)}} args - Select which filters you would like to apply. @example const ${lowerCase(ctx.mapping.model)} = await ${ctx.method}({ - filter: { age: { $gt: 25 } } + filter: { age: { $gt: 25 } } })`, fields: { filter: () => diff --git a/packages/client/src/generation/utils.ts b/packages/client/src/generation/utils.ts index 8f9584a7219a..8fc9b4cc6b6f 100644 --- a/packages/client/src/generation/utils.ts +++ b/packages/client/src/generation/utils.ts @@ -12,6 +12,10 @@ export function getSelectCreateManyAndReturnName(modelName: string): string { return `${modelName}SelectCreateManyAndReturn` } +export function getSelectUpdateManyAndReturnName(modelName: string): string { + return `${modelName}SelectUpdateManyAndReturn` +} + export function getIncludeName(modelName: string): string { return `${modelName}Include` } @@ -20,10 +24,18 @@ export function getIncludeCreateManyAndReturnName(modelName: string): string { return `${modelName}IncludeCreateManyAndReturn` } +export function getIncludeUpdateManyAndReturnName(modelName: string): string { + return `${modelName}IncludeUpdateManyAndReturn` +} + export function getCreateManyAndReturnOutputType(modelName: string): string { return `CreateMany${modelName}AndReturnOutputType` } +export function getUpdateManyAndReturnOutputType(modelName: string): string { + return `UpdateMany${modelName}AndReturnOutputType` +} + export function getOmitName(modelName: string): string { return `${modelName}Omit` } @@ -120,6 +132,8 @@ export function getModelArgName(modelName: string, action?: DMMF.ModelAction): s return `${modelName}UpdateArgs` case DMMF.ModelAction.updateMany: return `${modelName}UpdateManyArgs` + case DMMF.ModelAction.updateManyAndReturn: + return `${modelName}UpdateManyAndReturnArgs` case DMMF.ModelAction.delete: return `${modelName}DeleteArgs` case DMMF.ModelAction.create: diff --git a/packages/client/src/runtime/core/engines/common/types/JsonProtocol.ts b/packages/client/src/runtime/core/engines/common/types/JsonProtocol.ts index 83dba5c1c67b..e3c0dfdcca19 100644 --- a/packages/client/src/runtime/core/engines/common/types/JsonProtocol.ts +++ b/packages/client/src/runtime/core/engines/common/types/JsonProtocol.ts @@ -22,6 +22,7 @@ export type JsonQueryAction = | 'createManyAndReturn' | 'updateOne' | 'updateMany' + | 'updateManyAndReturn' | 'deleteOne' | 'deleteMany' | 'upsertOne' diff --git a/packages/client/src/runtime/core/jsonProtocol/isWrite.ts b/packages/client/src/runtime/core/jsonProtocol/isWrite.ts index a306bceb06b7..4083f675116f 100644 --- a/packages/client/src/runtime/core/jsonProtocol/isWrite.ts +++ b/packages/client/src/runtime/core/jsonProtocol/isWrite.ts @@ -19,6 +19,7 @@ const writeMap: Record = { queryRaw: false, runCommandRaw: true, updateMany: true, + updateManyAndReturn: true, updateOne: true, upsertOne: true, } diff --git a/packages/client/src/runtime/core/jsonProtocol/serializeJsonQuery.test.ts b/packages/client/src/runtime/core/jsonProtocol/serializeJsonQuery.test.ts index 609477d75c12..a9cbdc7bc44e 100644 --- a/packages/client/src/runtime/core/jsonProtocol/serializeJsonQuery.test.ts +++ b/packages/client/src/runtime/core/jsonProtocol/serializeJsonQuery.test.ts @@ -126,6 +126,38 @@ test('createManyAndReturn', () => { `) }) +test('updateMany', () => { + expect(serialize({ modelName: 'User', action: 'updateMany', args: {} })).toMatchInlineSnapshot(` + "{ + "modelName": "User", + "action": "updateMany", + "query": { + "arguments": {}, + "selection": { + "$composites": true, + "$scalars": true + } + } + }" + `) +}) + +test('updateManyAndReturn', () => { + expect(serialize({ modelName: 'User', action: 'updateManyAndReturn', args: {} })).toMatchInlineSnapshot(` + "{ + "modelName": "User", + "action": "updateManyAndReturn", + "query": { + "arguments": {}, + "selection": { + "$composites": true, + "$scalars": true + } + } + }" + `) +}) + test('delete', () => { expect(serialize({ modelName: 'User', action: 'delete', args: {} })).toMatchInlineSnapshot(` "{ diff --git a/packages/client/src/runtime/core/jsonProtocol/serializeJsonQuery.ts b/packages/client/src/runtime/core/jsonProtocol/serializeJsonQuery.ts index b4b222b5b766..fbdf07cdd442 100644 --- a/packages/client/src/runtime/core/jsonProtocol/serializeJsonQuery.ts +++ b/packages/client/src/runtime/core/jsonProtocol/serializeJsonQuery.ts @@ -44,6 +44,7 @@ const jsActionToProtocolAction: Record = { createManyAndReturn: 'createManyAndReturn', update: 'updateOne', updateMany: 'updateMany', + updateManyAndReturn: 'updateManyAndReturn', upsert: 'upsertOne', delete: 'deleteOne', deleteMany: 'deleteMany', @@ -533,6 +534,7 @@ class SerializeContext { case 'createManyAndReturn': case 'create': case 'update': + case 'updateManyAndReturn': case 'delete': return true case 'executeRaw': diff --git a/packages/client/src/runtime/core/types/exported/Result.ts b/packages/client/src/runtime/core/types/exported/Result.ts index f3951e6001d8..8448e581597a 100644 --- a/packages/client/src/runtime/core/types/exported/Result.ts +++ b/packages/client/src/runtime/core/types/exported/Result.ts @@ -18,6 +18,7 @@ export type Operation = // updates | 'update' | 'updateMany' +| 'updateManyAndReturn' | 'upsert' // deletes | 'delete' @@ -156,6 +157,7 @@ export type GetResult[], update: GetFindResult, updateMany: GetBatchResult, + updateManyAndReturn: GetFindResult[], upsert: GetFindResult, delete: GetFindResult, deleteMany: GetBatchResult, diff --git a/packages/client/src/runtime/externalToInternalDmmf.ts b/packages/client/src/runtime/externalToInternalDmmf.ts index 9e6310339f82..fea33ab474c6 100644 --- a/packages/client/src/runtime/externalToInternalDmmf.ts +++ b/packages/client/src/runtime/externalToInternalDmmf.ts @@ -44,6 +44,7 @@ function getMappings(mappings: ExternalDMMF.Mappings, datamodel: DMMF.Datamodel) update: mapping.updateOne || mapping.updateSingle || mapping.update, deleteMany: mapping.deleteMany, updateMany: mapping.updateMany, + updateManyAndReturn: mapping.updateManyAndReturn, upsert: mapping.upsertOne || mapping.upsertSingle || mapping.upsert, aggregate: mapping.aggregate, groupBy: mapping.groupBy, diff --git a/packages/client/tests/functional/extensions/defineExtension.ts b/packages/client/tests/functional/extensions/defineExtension.ts index 651aad36afe1..3ff061fc8837 100644 --- a/packages/client/tests/functional/extensions/defineExtension.ts +++ b/packages/client/tests/functional/extensions/defineExtension.ts @@ -333,6 +333,12 @@ function allResultsGenericExtensionObjectViaDefault() { _updateMany(this: T, _args: PrismaDefault.Exact>) { return {} as PrismaDefault.Result }, + _updateManyAndReturn( + this: T, + _args: PrismaDefault.Exact>, + ) { + return {} as PrismaDefault.Result + }, _upsert(this: T, _args: PrismaDefault.Exact>) { return {} as PrismaDefault.Result }, @@ -619,6 +625,12 @@ testMatrix.setupTestSuite(() => { const updateMany = await prisma.user.updateMany({ where: { id: '1' }, data: { email: '' } }) expectTypeOf().toEqualTypeOf() + const _updateManyAndReturn = xprisma.user._updateManyAndReturn({ where: { id: '1' }, data: { email: '' } }) + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + const updateManyAndReturn = await prisma.user.updateManyAndReturn({ where: { id: '1' }, data: { email: '' } }) + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf().toEqualTypeOf() + const _upsert = xprisma.user._upsert({ where: { id: '1' }, create: { email: '', firstName: '', lastName: '' }, diff --git a/packages/client/tests/functional/extensions/query.ts b/packages/client/tests/functional/extensions/query.ts index bf5c2be3cbad..cbcf0ef980b8 100644 --- a/packages/client/tests/functional/extensions/query.ts +++ b/packages/client/tests/functional/extensions/query.ts @@ -771,6 +771,7 @@ testMatrix.setupTestSuite( | 'createManyAndReturn' // PostgreSQL, CockroachDB & SQLite only | 'update' | 'updateMany' + | 'updateManyAndReturn' // PostgreSQL, CockroachDB & SQLite only | 'upsert' | 'delete' | 'deleteMany' @@ -828,7 +829,7 @@ testMatrix.setupTestSuite( expectTypeOf(args).not.toBeAny() expectTypeOf(query).toBeFunction() - expectTypeOf(operation).toMatchTypeOf< + expectTypeOf(operation).toMatchTypeOf < | 'findFirst' | 'findFirstOrThrow' | 'findUnique' @@ -839,6 +840,7 @@ testMatrix.setupTestSuite( | 'createManyAndReturn' // PostgreSQL, CockroachDB & SQLite only | 'update' | 'updateMany' + | 'updateManyAndReturn' // PostgreSQL, CockroachDB & SQLite only | 'upsert' | 'delete' | 'deleteMany' @@ -1379,6 +1381,18 @@ testMatrix.setupTestSuite( return data }, + async updateManyAndReturn({ args, query, operation }) { + const data = await query(args) + + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf(operation).toEqualTypeOf<'updateManyAndReturn'>() + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf(args).toEqualTypeOf() + expectTypeOf(data).toMatchTypeOf[]>() + expectTypeOf(data[0].posts).toMatchTypeOf[] | undefined>() + + return data + }, async upsert({ args, query, operation }) { const data = await query(args) @@ -1541,6 +1555,20 @@ testMatrix.setupTestSuite( return data } + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + if (operation === 'updateManyAndReturn') { + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + const data = await query(args) + + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf(operation).toEqualTypeOf<'updateManyAndReturn'>() + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf(args).toEqualTypeOf() + expectTypeOf(data).toMatchTypeOf[]>() + expectTypeOf(data[0].posts).toMatchTypeOf[] | undefined>() + + return data + } if (operation === 'upsert') { const data = await query(args) @@ -1709,6 +1737,20 @@ testMatrix.setupTestSuite( return data } + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + if (model === 'User' && operation === 'updateManyAndReturn') { + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + const data = await query(args) + + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf(operation).toEqualTypeOf<'updateManyAndReturn'>() + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf(args).toEqualTypeOf() + expectTypeOf(data).toMatchTypeOf[]>() + expectTypeOf(data[0].posts).toMatchTypeOf[] | undefined>() + + return data + } if (model === 'User' && operation === 'upsert') { const data = await query(args) @@ -1902,6 +1944,20 @@ testMatrix.setupTestSuite( return data }, + async updateManyAndReturn({ args, query, operation, model }) { + if (model !== 'User') return query(args) + + const data = await query(args) + + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf(operation).toEqualTypeOf<'updateManyAndReturn'>() + // @ts-test-if: provider == Providers.POSTGRESQL || provider === Providers.COCKROACHDB || provider === Providers.SQLITE + expectTypeOf(args).toEqualTypeOf() + expectTypeOf(data).toMatchTypeOf[]>() + expectTypeOf(data[0].posts).toMatchTypeOf[] | undefined>() + + return data + }, async upsert({ args, query, operation, model }) { if (model !== 'User') return query(args) diff --git a/packages/client/tests/functional/methods/updateManyAndReturn-supported/_matrix.ts b/packages/client/tests/functional/methods/updateManyAndReturn-supported/_matrix.ts new file mode 100644 index 000000000000..31521bbc0ba8 --- /dev/null +++ b/packages/client/tests/functional/methods/updateManyAndReturn-supported/_matrix.ts @@ -0,0 +1,16 @@ +import { defineMatrix } from '../../_utils/defineMatrix' +import { Providers } from '../../_utils/providers' + +export default defineMatrix(() => [ + [ + { + provider: Providers.POSTGRESQL, + }, + { + provider: Providers.COCKROACHDB, + }, + { + provider: Providers.SQLITE, + }, + ], +]) diff --git a/packages/client/tests/functional/methods/updateManyAndReturn-supported/prisma/_schema.ts b/packages/client/tests/functional/methods/updateManyAndReturn-supported/prisma/_schema.ts new file mode 100644 index 000000000000..ce26947a1f50 --- /dev/null +++ b/packages/client/tests/functional/methods/updateManyAndReturn-supported/prisma/_schema.ts @@ -0,0 +1,29 @@ +import { idForProvider } from '../../../_utils/idForProvider' +import testMatrix from '../_matrix' + +export default testMatrix.setupSchema(({ provider }) => { + return /* Prisma */ ` + generator client { + provider = "prisma-client-js" + } + + datasource db { + provider = "${provider}" + url = env("DATABASE_URI_${provider}") + } + + model User { + id ${idForProvider(provider)} + email String @unique + name String? + posts Post[] + } + + model Post { + id ${idForProvider(provider)} + title String + user User @relation(fields: [userId], references: [id]) + userId String + } + ` +}) diff --git a/packages/client/tests/functional/methods/updateManyAndReturn-supported/tests.ts b/packages/client/tests/functional/methods/updateManyAndReturn-supported/tests.ts new file mode 100644 index 000000000000..9afc3f32efef --- /dev/null +++ b/packages/client/tests/functional/methods/updateManyAndReturn-supported/tests.ts @@ -0,0 +1,323 @@ +import { faker } from '@faker-js/faker' + +import { Providers } from '../../_utils/providers' +import testMatrix from './_matrix' +// @ts-ignore +import type { PrismaClient } from './node_modules/@prisma/client' + +declare let prisma: PrismaClient + +testMatrix.setupTestSuite( + () => { + test('should update and return many records', async () => { + const email1 = faker.internet.email() + const email2 = faker.internet.email() + const email3 = faker.internet.email() + const email4 = faker.internet.email() + + const updatedName = faker.person.fullName() + + await prisma.user.createMany({ + data: [ + { + email: email1, + }, + { + email: email2, + }, + { + email: email3, + }, + { + email: email4, + }, + ], + }) + + const users = await prisma.user.updateManyAndReturn({ + data: { + name: updatedName, + }, + where: {}, + }) + + expect(users).toMatchObject([ + { + email: email1, + id: expect.any(String), + name: updatedName, + }, + { + email: email2, + id: expect.any(String), + name: updatedName, + }, + { + email: email3, + id: expect.any(String), + name: updatedName, + }, + { + email: email4, + id: expect.any(String), + name: updatedName, + }, + ]) + }) + + test('should update and return one record', async () => { + const email1 = faker.internet.email() + const email2 = faker.internet.email() + + await prisma.user.create({ + data: { + email: email1, + }, + }) + + const users = await prisma.user.updateManyAndReturn({ + data: { + email: email2, + }, + where: { + email: email1, + }, + }) + + expect(users).toMatchObject([ + { + email: email2, + id: expect.any(String), + name: null, + }, + ]) + }) + + test('should update and return records satisfying the where clause', async () => { + const email1 = faker.internet.email() + const email2 = faker.internet.email() + const email3 = faker.internet.email() + const email4 = faker.internet.email() + + const updatedName = faker.person.fullName() + + await prisma.user.createMany({ + data: [ + { + email: email1, + }, + { + email: email2, + }, + { + email: email3, + }, + { + email: email4, + }, + ], + }) + + const users = await prisma.user.updateManyAndReturn({ + data: { + name: updatedName, + }, + where: { + email: { + in: [email1, email2], + }, + }, + }) + + expect(users).toMatchObject([ + { + email: email1, + id: expect.any(String), + name: updatedName, + }, + { + email: email2, + id: expect.any(String), + name: updatedName, + }, + ]) + }) + + test('should accept select', async () => { + const email1 = faker.internet.email() + const updatedName = faker.person.fullName() + + await prisma.user.create({ + data: { + email: email1, + }, + }) + + const users = await prisma.user.updateManyAndReturn({ + select: { id: true }, + data: { + name: updatedName, + }, + where: { + email: email1, + }, + }) + + expect(users).toMatchObject([ + { + id: expect.any(String), + }, + ]) + }) + + test('should accept include on the post side', async () => { + const email1 = faker.internet.email() + + const users = await prisma.user.createManyAndReturn({ + data: [ + { + email: email1, + }, + ], + }) + + await prisma.post.create({ + data: { + userId: users[0].id, + title: 'New post', + }, + }) + + const posts = await prisma.post.updateManyAndReturn({ + include: { + user: true, + }, + data: { + title: 'Updated post', + }, + where: { + userId: users[0].id, + }, + }) + + expect(posts).toMatchObject([ + { + id: expect.any(String), + title: expect.any(String), + userId: expect.any(String), + user: { + id: expect.any(String), + email: email1, + }, + }, + ]) + }) + + test('should fail include on the user side', async () => { + const email1 = faker.internet.email() + + await expect( + prisma.user.updateManyAndReturn({ + // @ts-expect-error + include: { + posts: true, + }, + data: { + email: email1, + }, + }), + ).rejects.toThrow('Unknown field `posts` for include statement on model `UpdateManyUserAndReturnOutputType`.') + }) + + test('take should fail', async () => { + const email1 = faker.internet.email() + + await expect( + prisma.user.updateManyAndReturn({ + // @ts-expect-error + take: 1, + data: { + email: email1, + }, + }), + ).rejects.toThrow('Unknown argument `take`') + }) + + test('orderBy should fail', async () => { + const email1 = faker.internet.email() + + await expect( + prisma.user.updateManyAndReturn({ + // @ts-expect-error + orderBy: { + email: 'asc', + }, + data: { + email: email1, + }, + }), + ).rejects.toThrow('Unknown argument `orderBy`.') + }) + + test('distinct should fail', async () => { + const email1 = faker.internet.email() + + await expect( + prisma.user.updateManyAndReturn({ + // @ts-expect-error + distinct: 'id', + data: { + email: email1, + }, + }), + ).rejects.toThrow('Unknown argument `distinct`.') + }) + + test('select _count should fail', async () => { + const email1 = faker.internet.email() + + await expect( + prisma.user.updateManyAndReturn({ + select: { + // @ts-expect-error + _count: true, + }, + data: { + email: email1, + }, + }), + ).rejects.toThrow( + 'Unknown field `_count` for select statement on model `UpdateManyUserAndReturnOutputType`. Available options are marked with ?.', + ) + }) + + test('include _count should fail', async () => { + const email1 = faker.internet.email() + + await expect( + prisma.user.updateManyAndReturn({ + // @ts-expect-error + include: { + _count: true, + }, + data: { + email: email1, + }, + }), + ).rejects.toThrow( + 'Unknown field `_count` for include statement on model `UpdateManyUserAndReturnOutputType`. Available options are marked with ?.', + ) + }) + }, + { + skipDriverAdapter: { + from: ['js_d1'], + reason: + 'D1 driver adapter does not return the correct number of created records. See https://github.com/prisma/team-orm/issues/1069', + }, + optOut: { + from: [Providers.MONGODB, Providers.SQLSERVER, Providers.MYSQL], + reason: 'Excluded dbs are missing the "ConnectorCapability::InsertReturning". They are tested separately.', + }, + }, +) diff --git a/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/_matrix.ts b/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/_matrix.ts new file mode 100644 index 000000000000..948cb102b5a8 --- /dev/null +++ b/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/_matrix.ts @@ -0,0 +1,16 @@ +import { defineMatrix } from '../../_utils/defineMatrix' +import { Providers } from '../../_utils/providers' + +export default defineMatrix(() => [ + [ + { + provider: Providers.SQLSERVER, + }, + { + provider: Providers.MONGODB, + }, + { + provider: Providers.MYSQL, + }, + ], +]) diff --git a/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/prisma/_schema.ts b/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/prisma/_schema.ts new file mode 100644 index 000000000000..ce26947a1f50 --- /dev/null +++ b/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/prisma/_schema.ts @@ -0,0 +1,29 @@ +import { idForProvider } from '../../../_utils/idForProvider' +import testMatrix from '../_matrix' + +export default testMatrix.setupSchema(({ provider }) => { + return /* Prisma */ ` + generator client { + provider = "prisma-client-js" + } + + datasource db { + provider = "${provider}" + url = env("DATABASE_URI_${provider}") + } + + model User { + id ${idForProvider(provider)} + email String @unique + name String? + posts Post[] + } + + model Post { + id ${idForProvider(provider)} + title String + user User @relation(fields: [userId], references: [id]) + userId String + } + ` +}) diff --git a/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/tests.ts b/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/tests.ts new file mode 100644 index 000000000000..5abdc683d52e --- /dev/null +++ b/packages/client/tests/functional/methods/updateManyAndReturn-unsupported/tests.ts @@ -0,0 +1,26 @@ +import { expectTypeOf } from 'expect-type' + +import { Providers } from '../../_utils/providers' +import testMatrix from './_matrix' +// @ts-ignore +import type { PrismaClient } from './node_modules/@prisma/client' + +declare let prisma: PrismaClient + +testMatrix.setupTestSuite( + () => { + test('should fail as updateManyAndReturn is not supported on tested providers', () => { + // @ts-expect-error + prisma.user.updateManyAndReturn() + + expectTypeOf(prisma.user).not.toHaveProperty('updateManyAndReturn') + }) + }, + { + optOut: { + from: [Providers.POSTGRESQL, Providers.COCKROACHDB, Providers.SQLITE], + reason: + 'Excluded dbs support the "ConnectorCapability::UpdateReturning". This test is only about making sure that it does not show up where it is not supported.', + }, + }, +) diff --git a/packages/engines/package.json b/packages/engines/package.json index 7fea893d6e01..c3b1125a257e 100644 --- a/packages/engines/package.json +++ b/packages/engines/package.json @@ -22,7 +22,7 @@ }, "dependencies": { "@prisma/debug": "workspace:*", - "@prisma/engines-version": "6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6", + "@prisma/engines-version": "6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f", "@prisma/fetch-engine": "workspace:*", "@prisma/get-platform": "workspace:*" }, diff --git a/packages/fetch-engine/package.json b/packages/fetch-engine/package.json index ea479147a189..d81c9fb6a2fe 100644 --- a/packages/fetch-engine/package.json +++ b/packages/fetch-engine/package.json @@ -43,7 +43,7 @@ }, "dependencies": { "@prisma/debug": "workspace:*", - "@prisma/engines-version": "6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6", + "@prisma/engines-version": "6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f", "@prisma/get-platform": "workspace:*" }, "scripts": { diff --git a/packages/generator-helper/src/dmmf.ts b/packages/generator-helper/src/dmmf.ts index 00880ce90c33..78a3c160b42d 100644 --- a/packages/generator-helper/src/dmmf.ts +++ b/packages/generator-helper/src/dmmf.ts @@ -247,6 +247,7 @@ export namespace DMMF { createManyAndReturn?: string | null update?: string | null updateMany?: string | null + updateManyAndReturn?: string | null upsert?: string | null delete?: string | null deleteMany?: string | null @@ -268,6 +269,7 @@ export namespace DMMF { createManyAndReturn = 'createManyAndReturn', update = 'update', updateMany = 'updateMany', + updateManyAndReturn = 'updateManyAndReturn', upsert = 'upsert', delete = 'delete', deleteMany = 'deleteMany', diff --git a/packages/internals/package.json b/packages/internals/package.json index 42500583e121..b8d5a9408861 100644 --- a/packages/internals/package.json +++ b/packages/internals/package.json @@ -85,7 +85,7 @@ "@prisma/fetch-engine": "workspace:*", "@prisma/generator-helper": "workspace:*", "@prisma/get-platform": "workspace:*", - "@prisma/prisma-schema-wasm": "6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6", + "@prisma/prisma-schema-wasm": "6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f", "@prisma/schema-files-loader": "workspace:*", "arg": "5.0.2", "prompts": "2.4.2" diff --git a/packages/internals/src/__tests__/engine-commands/__snapshots__/getDmmf.test.ts.snap b/packages/internals/src/__tests__/engine-commands/__snapshots__/getDmmf.test.ts.snap index f2d7ede0a9a0..b1d91af8ed2b 100644 --- a/packages/internals/src/__tests__/engine-commands/__snapshots__/getDmmf.test.ts.snap +++ b/packages/internals/src/__tests__/engine-commands/__snapshots__/getDmmf.test.ts.snap @@ -214,6 +214,7 @@ exports[`getDMMF success @@id model 1`] = ` "groupBy": "groupByUser1", "model": "User1", "updateMany": "updateManyUser1", + "updateManyAndReturn": "updateManyUser1AndReturn", "updateOne": "updateOneUser1", "upsertOne": "upsertOneUser1", }, @@ -232,6 +233,7 @@ exports[`getDMMF success @@id model 1`] = ` "groupBy": "groupByUser2", "model": "User2", "updateMany": "updateManyUser2", + "updateManyAndReturn": "updateManyUser2AndReturn", "updateOne": "updateOneUser2", "upsertOne": "upsertOneUser2", }, @@ -5621,6 +5623,51 @@ exports[`getDMMF success @@id model 1`] = ` ], "name": "CreateManyUser1AndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "firstName", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "lastName", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "isAdmin", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Boolean", + }, + }, + ], + "name": "UpdateManyUser1AndReturnOutputType", + }, { "fields": [ { @@ -5666,6 +5713,51 @@ exports[`getDMMF success @@id model 1`] = ` ], "name": "CreateManyUser2AndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "firstName", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "lastName", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "isAdmin", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Boolean", + }, + }, + ], + "name": "UpdateManyUser2AndReturnOutputType", + }, ], "prisma": [ { @@ -7030,6 +7122,50 @@ exports[`getDMMF success @@id model 1`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User1UpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User1UncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User1WhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyUser1AndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyUser1AndReturnOutputType", + }, + }, { "args": [ { @@ -7348,6 +7484,50 @@ exports[`getDMMF success @@id model 1`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User2UpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User2UncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User2WhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyUser2AndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyUser2AndReturnOutputType", + }, + }, { "args": [ { @@ -8281,6 +8461,7 @@ exports[`getDMMF success @@map model 2`] = ` "groupBy": "groupByUser", "model": "User", "updateMany": "updateManyUser", + "updateManyAndReturn": "updateManyUserAndReturn", "updateOne": "updateOneUser", "upsertOne": "upsertOneUser", }, @@ -11378,6 +11559,31 @@ exports[`getDMMF success @@map model 2`] = ` ], "name": "CreateManyUserAndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "email", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + ], + "name": "UpdateManyUserAndReturnOutputType", + }, ], "prisma": [ { @@ -12211,6 +12417,50 @@ exports[`getDMMF success @@map model 2`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "UserUpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "UserUncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "UserWhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyUserAndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyUserAndReturnOutputType", + }, + }, { "args": [ { @@ -13012,6 +13262,7 @@ exports[`getDMMF success @@unique model 1`] = ` "groupBy": "groupByPost", "model": "Post", "updateMany": "updateManyPost", + "updateManyAndReturn": "updateManyPostAndReturn", "updateOne": "updateOnePost", "upsertOne": "upsertOnePost", }, @@ -13030,6 +13281,7 @@ exports[`getDMMF success @@unique model 1`] = ` "groupBy": "groupByUser", "model": "User", "updateMany": "updateManyUser", + "updateManyAndReturn": "updateManyUserAndReturn", "updateOne": "updateOneUser", "upsertOne": "upsertOneUser", }, @@ -13048,6 +13300,7 @@ exports[`getDMMF success @@unique model 1`] = ` "groupBy": "groupByUser1", "model": "User1", "updateMany": "updateManyUser1", + "updateManyAndReturn": "updateManyUser1AndReturn", "updateOne": "updateOneUser1", "upsertOne": "upsertOneUser1", }, @@ -13066,6 +13319,7 @@ exports[`getDMMF success @@unique model 1`] = ` "groupBy": "groupByUser2", "model": "User2", "updateMany": "updateManyUser2", + "updateManyAndReturn": "updateManyUser2AndReturn", "updateOne": "updateOneUser2", "upsertOne": "upsertOneUser2", }, @@ -22818,6 +23072,87 @@ exports[`getDMMF success @@unique model 1`] = ` ], "name": "CreateManyPostAndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "authorId", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "title", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "published", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Boolean", + }, + }, + { + "args": [], + "isNullable": false, + "name": "author", + "outputType": { + "isList": false, + "location": "outputObjectTypes", + "namespace": "model", + "type": "User", + }, + }, + ], + "name": "UpdateManyPostAndReturnOutputType", + }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "email", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + ], + "name": "CreateManyUserAndReturnOutputType", + }, { "fields": [ { @@ -22841,7 +23176,7 @@ exports[`getDMMF success @@unique model 1`] = ` }, }, ], - "name": "CreateManyUserAndReturnOutputType", + "name": "UpdateManyUserAndReturnOutputType", }, { "fields": [ @@ -22888,6 +23223,51 @@ exports[`getDMMF success @@unique model 1`] = ` ], "name": "CreateManyUser1AndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "firstName", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "lastName", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "isAdmin", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Boolean", + }, + }, + ], + "name": "UpdateManyUser1AndReturnOutputType", + }, { "fields": [ { @@ -22933,6 +23313,51 @@ exports[`getDMMF success @@unique model 1`] = ` ], "name": "CreateManyUser2AndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "firstName", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "lastName", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "isAdmin", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Boolean", + }, + }, + ], + "name": "UpdateManyUser2AndReturnOutputType", + }, ], "prisma": [ { @@ -25359,6 +25784,50 @@ exports[`getDMMF success @@unique model 1`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "PostUpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "PostUncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "PostWhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyPostAndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyPostAndReturnOutputType", + }, + }, { "args": [ { @@ -25677,6 +26146,50 @@ exports[`getDMMF success @@unique model 1`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "UserUpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "UserUncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "UserWhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyUserAndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyUserAndReturnOutputType", + }, + }, { "args": [ { @@ -25995,6 +26508,50 @@ exports[`getDMMF success @@unique model 1`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User1UpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User1UncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User1WhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyUser1AndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyUser1AndReturnOutputType", + }, + }, { "args": [ { @@ -26313,6 +26870,50 @@ exports[`getDMMF success @@unique model 1`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User2UpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User2UncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "User2WhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyUser2AndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyUser2AndReturnOutputType", + }, + }, { "args": [ { @@ -27741,7 +28342,7 @@ exports[`getDMMF success @@unique model 1`] = ` } `; -exports[`getDMMF success big schema read via datamodel path 1`] = `154156458`; +exports[`getDMMF success big schema read via datamodel path 1`] = `159611340`; exports[`getDMMF success chinook introspected schema 1`] = `993396`; @@ -27988,6 +28589,7 @@ exports[`getDMMF success multiple files 1`] = ` "groupBy": "groupByA", "model": "A", "updateMany": "updateManyA", + "updateManyAndReturn": "updateManyAAndReturn", "updateOne": "updateOneA", "upsertOne": "upsertOneA", }, @@ -28006,6 +28608,7 @@ exports[`getDMMF success multiple files 1`] = ` "groupBy": "groupByB", "model": "B", "updateMany": "updateManyB", + "updateManyAndReturn": "updateManyBAndReturn", "updateOne": "updateOneB", "upsertOne": "upsertOneB", }, @@ -31670,6 +32273,31 @@ exports[`getDMMF success multiple files 1`] = ` ], "name": "CreateManyAAndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "name", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + ], + "name": "UpdateManyAAndReturnOutputType", + }, { "fields": [ { @@ -31695,6 +32323,31 @@ exports[`getDMMF success multiple files 1`] = ` ], "name": "CreateManyBAndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + { + "args": [], + "isNullable": false, + "name": "title", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + ], + "name": "UpdateManyBAndReturnOutputType", + }, ], "prisma": [ { @@ -33035,6 +33688,50 @@ exports[`getDMMF success multiple files 1`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AUpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AUncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AWhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyAAndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyAAndReturnOutputType", + }, + }, { "args": [ { @@ -33329,6 +34026,50 @@ exports[`getDMMF success multiple files 1`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "BUpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "BUncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "BWhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyBAndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyBAndReturnOutputType", + }, + }, { "args": [ { @@ -33884,7 +34625,7 @@ exports[`getDMMF success multiple files 1`] = ` } `; -exports[`getDMMF success odoo introspected schema 1`] = `137324072`; +exports[`getDMMF success odoo introspected schema 1`] = `137815019`; exports[`getDMMF success simple model, mongodb 1`] = ` { @@ -46321,6 +47062,7 @@ exports[`getDMMF success simple model, postgresql 2`] = ` "groupBy": "groupByA", "model": "A", "updateMany": "updateManyA", + "updateManyAndReturn": "updateManyAAndReturn", "updateOne": "updateOneA", "upsertOne": "upsertOneA", }, @@ -49418,6 +50160,31 @@ exports[`getDMMF success simple model, postgresql 2`] = ` ], "name": "CreateManyAAndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "name", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + ], + "name": "UpdateManyAAndReturnOutputType", + }, ], "prisma": [ { @@ -50251,6 +51018,50 @@ exports[`getDMMF success simple model, postgresql 2`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AUpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AUncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AWhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyAAndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyAAndReturnOutputType", + }, + }, { "args": [ { @@ -54872,6 +55683,7 @@ exports[`getDMMF success simple model, sqlite 2`] = ` "groupBy": "groupByA", "model": "A", "updateMany": "updateManyA", + "updateManyAndReturn": "updateManyAAndReturn", "updateOne": "updateOneA", "upsertOne": "upsertOneA", }, @@ -57717,6 +58529,31 @@ exports[`getDMMF success simple model, sqlite 2`] = ` ], "name": "CreateManyAAndReturnOutputType", }, + { + "fields": [ + { + "args": [], + "isNullable": false, + "name": "id", + "outputType": { + "isList": false, + "location": "scalar", + "type": "Int", + }, + }, + { + "args": [], + "isNullable": false, + "name": "name", + "outputType": { + "isList": false, + "location": "scalar", + "type": "String", + }, + }, + ], + "name": "UpdateManyAAndReturnOutputType", + }, ], "prisma": [ { @@ -58526,6 +59363,50 @@ exports[`getDMMF success simple model, sqlite 2`] = ` "type": "AffectedRowsOutput", }, }, + { + "args": [ + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AUpdateManyMutationInput", + }, + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AUncheckedUpdateManyInput", + }, + ], + "isNullable": false, + "isRequired": true, + "name": "data", + }, + { + "inputTypes": [ + { + "isList": false, + "location": "inputObjectTypes", + "namespace": "prisma", + "type": "AWhereInput", + }, + ], + "isNullable": false, + "isRequired": false, + "name": "where", + }, + ], + "isNullable": false, + "name": "updateManyAAndReturn", + "outputType": { + "isList": true, + "location": "outputObjectTypes", + "namespace": "model", + "type": "UpdateManyAAndReturnOutputType", + }, + }, { "args": [ { diff --git a/packages/migrate/package.json b/packages/migrate/package.json index 01d755f08bc1..3233e82a13c7 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -56,7 +56,7 @@ }, "dependencies": { "@prisma/debug": "workspace:*", - "@prisma/engines-version": "6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6", + "@prisma/engines-version": "6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f", "@prisma/generator-helper": "workspace:*", "@prisma/get-platform": "workspace:*", "@prisma/internals": "workspace:*", diff --git a/packages/schema-files-loader/package.json b/packages/schema-files-loader/package.json index 4a261b2a48dd..135efe45c937 100644 --- a/packages/schema-files-loader/package.json +++ b/packages/schema-files-loader/package.json @@ -22,7 +22,7 @@ ], "sideEffects": false, "dependencies": { - "@prisma/prisma-schema-wasm": "6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6", + "@prisma/prisma-schema-wasm": "6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f", "fs-extra": "11.1.1" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 27fd2399c227..a75d411e176a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -622,8 +622,8 @@ importers: specifier: workspace:* version: link:../engines '@prisma/engines-version': - specifier: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 - version: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 + specifier: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f + version: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f '@prisma/fetch-engine': specifier: workspace:* version: link:../fetch-engine @@ -649,8 +649,8 @@ importers: specifier: workspace:* version: link:../pg-worker '@prisma/query-engine-wasm': - specifier: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 - version: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 + specifier: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f + version: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f '@snaplet/copycat': specifier: 0.17.3 version: 0.17.3 @@ -868,8 +868,8 @@ importers: specifier: workspace:* version: link:../debug '@prisma/engines-version': - specifier: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 - version: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 + specifier: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f + version: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f '@prisma/fetch-engine': specifier: workspace:* version: link:../fetch-engine @@ -905,8 +905,8 @@ importers: specifier: workspace:* version: link:../debug '@prisma/engines-version': - specifier: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 - version: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 + specifier: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f + version: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f '@prisma/get-platform': specifier: workspace:* version: link:../get-platform @@ -1227,8 +1227,8 @@ importers: specifier: workspace:* version: link:../get-platform '@prisma/prisma-schema-wasm': - specifier: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 - version: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 + specifier: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f + version: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f '@prisma/schema-files-loader': specifier: workspace:* version: link:../schema-files-loader @@ -1399,8 +1399,8 @@ importers: specifier: workspace:* version: link:../debug '@prisma/engines-version': - specifier: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 - version: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 + specifier: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f + version: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f '@prisma/generator-helper': specifier: workspace:* version: link:../generator-helper @@ -1551,8 +1551,8 @@ importers: packages/schema-files-loader: dependencies: '@prisma/prisma-schema-wasm': - specifier: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 - version: 6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6 + specifier: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f + version: 6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f fs-extra: specifier: 11.1.1 version: 11.1.1 @@ -2755,19 +2755,19 @@ packages: resolution: {integrity: sha512-t2XdOfrVgcF7AW791FtdPS27NyNqcE1SpoXgk3HpziousvUMsJi4Q6NL3JyOBpsMOrvk94749o8yyonvX5quPw==} engines: {node: '>=16'} - '@prisma/engines-version@6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6': - resolution: {integrity: sha512-/RSp1JM+Bgf3y69TP77GpLalVzIcES5QssOHsT6QeVHVmXXdCaJdUgir+Xs+SjB7X7wlDs/5d3LAzF7p+6v+jw==} + '@prisma/engines-version@6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f': + resolution: {integrity: sha512-rti9pHqH8qEupAXZwBQiIdbD/zP4rxT59iuDg4dlTaAKGimSg8WcyHu4DQoXJj4pwQKGeFDb+ZGoZNorXeke7g==} '@prisma/mini-proxy@0.9.5': resolution: {integrity: sha512-0MLaxUjGbZGJGx9fIy1kbAH65hcZHCP6yes8xCTVcWumo64uzAxuvZdf5l1EPCZrDnj+iZNAy0U364oOAN+gXQ==} engines: {node: '>=16'} hasBin: true - '@prisma/prisma-schema-wasm@6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6': - resolution: {integrity: sha512-LPETQan7EHqrtFZYmYnpoAvMjEfCKxzqoiPUnf5+OzgB01i8f85sjb/kNv6SFmw2T71Umr0nExcpkXGWUQHwTQ==} + '@prisma/prisma-schema-wasm@6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f': + resolution: {integrity: sha512-OjePLqgrtq1U7DVxjhJNRAnfmnwJRJGLh17dJA2Cth63zmclzm5WPhYs4bZJQ+b031M3edYkCwRuUqr7OPGeGA==} - '@prisma/query-engine-wasm@6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6': - resolution: {integrity: sha512-pPnOox+w5l561bm9I7CA27k15dX12gcrPweAaA9JxojNywTr1cG51f6dERbA27LtwyDXm3Dj0Nb3g+IBssaTHw==} + '@prisma/query-engine-wasm@6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f': + resolution: {integrity: sha512-eggPTTcMQx3BewY+Z2+xR75ugg5qCcDJ2lw8VcTK/7CoUslj2FLwMNUlW8BgMfUDv7tVh7NdFXIulcLGHjmJ2g==} '@prisma/studio-common@0.503.0': resolution: {integrity: sha512-YLI4uf8hNIg5RaX7lPPSH6qLeSknygMB/2aEqfnWA1kWCHvkTkYEtSoSXLEAIbVc0LWWDawCcDPxFH12v6oSnA==} @@ -5288,7 +5288,6 @@ packages: libsql@0.3.10: resolution: {integrity: sha512-/8YMTbwWFPmrDWY+YFK3kYqVPFkMgQre0DGmBaOmjogMdSe+7GHm1/q9AZ61AWkEub/vHmi+bA4tqIzVhKnqzg==} - cpu: [x64, arm64, wasm32] os: [darwin, linux, win32] lilconfig@2.1.0: @@ -8502,13 +8501,13 @@ snapshots: '@planetscale/database@1.18.0': {} - '@prisma/engines-version@6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6': {} + '@prisma/engines-version@6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f': {} '@prisma/mini-proxy@0.9.5': {} - '@prisma/prisma-schema-wasm@6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6': {} + '@prisma/prisma-schema-wasm@6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f': {} - '@prisma/query-engine-wasm@6.2.0-6.cc0167b764494213f0e42d0867d48643c39c83b6': {} + '@prisma/query-engine-wasm@6.2.0-11.c49e56c20818c325095752dd0ae895b0dc7bad9f': {} '@prisma/studio-common@0.503.0': dependencies: