Skip to content

Commit

Permalink
feat(client): client extensions query (#16408)
Browse files Browse the repository at this point in the history
  • Loading branch information
millsp authored and jkomyno committed Dec 21, 2022
1 parent 397f1cb commit cfb0fa3
Show file tree
Hide file tree
Showing 20 changed files with 1,129 additions and 209 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Expand Up @@ -1037,7 +1037,7 @@ jobs:
CI: true
SKIP_GIT: true
GITHUB_CONTEXT: ${{ toJson(github) }}
NODE_OPTIONS: '--max-old-space-size=10240' # allow Node.js to allocate at most 10gb of heap
NODE_OPTIONS: '--max-old-space-size=14336' # allow Node.js to allocate at most 14gb of heap
JEST_JUNIT_SUITE_NAME: '${{ github.job }}/client/${{ matrix.os }}/node-${{ matrix.node }}/${{ matrix.queryEngine }}'

- uses: codecov/codecov-action@v3
Expand Down
Expand Up @@ -1043,9 +1043,9 @@ export namespace Prisma {
[K in keyof T]-?: {} extends Prisma__Pick<T, K> ? never : K
}[keyof T]

export type TruthyKeys<T> = {
[key in keyof T]: T[key] extends false | undefined | null ? never : key
}[keyof T]
export type TruthyKeys<T> = keyof {
[K in keyof T as T[K] extends false | undefined | null ? never : K]: K
}

export type TrueKeys<T> = TruthyKeys<Prisma__Pick<T, RequiredKeys<T>>>

Expand Down Expand Up @@ -1519,7 +1519,7 @@ export namespace Prisma {
? UserCountOutputType
: S extends { select: any } & (UserCountOutputTypeArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof UserCountOutputType ? UserCountOutputType[P] : never
}
: UserCountOutputType
Expand Down Expand Up @@ -1563,7 +1563,7 @@ export namespace Prisma {
? EmbedHolderCountOutputType
: S extends { select: any } & (EmbedHolderCountOutputTypeArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof EmbedHolderCountOutputType ? EmbedHolderCountOutputType[P] : never
}
: EmbedHolderCountOutputType
Expand Down Expand Up @@ -1607,7 +1607,7 @@ export namespace Prisma {
? MCountOutputType
: S extends { select: any } & (MCountOutputTypeArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof MCountOutputType ? MCountOutputType[P] : never
}
: MCountOutputType
Expand Down Expand Up @@ -1651,7 +1651,7 @@ export namespace Prisma {
? NCountOutputType
: S extends { select: any } & (NCountOutputTypeArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof NCountOutputType ? NCountOutputType[P] : never
}
: NCountOutputType
Expand Down Expand Up @@ -1695,7 +1695,7 @@ export namespace Prisma {
? OneOptionalCountOutputType
: S extends { select: any } & (OneOptionalCountOutputTypeArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof OneOptionalCountOutputType ? OneOptionalCountOutputType[P] : never
}
: OneOptionalCountOutputType
Expand Down Expand Up @@ -1752,10 +1752,10 @@ export namespace Prisma {
? Embed
: S extends { select: any } & (EmbedArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'embedEmbedList' ? Array < EmbedEmbedGetPayload<Exclude<S['select'], undefined | null>[P]>> :
P extends 'requiredEmbedEmbed' ? EmbedEmbedGetPayload<Exclude<S['select'], undefined | null>[P]> :
P extends 'optionalEmbedEmbed' ? EmbedEmbedGetPayload<Exclude<S['select'], undefined | null>[P]> | null : P extends keyof Embed ? Embed[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'embedEmbedList' ? Array < EmbedEmbedGetPayload<S['select'][P]>> :
P extends 'requiredEmbedEmbed' ? EmbedEmbedGetPayload<S['select'][P]> :
P extends 'optionalEmbedEmbed' ? EmbedEmbedGetPayload<S['select'][P]> | null : P extends keyof Embed ? Embed[P] : never
}
: Embed

Expand Down Expand Up @@ -1866,7 +1866,7 @@ export namespace Prisma {
? EmbedEmbed
: S extends { select: any } & (EmbedEmbedArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof EmbedEmbed ? EmbedEmbed[P] : never
}
: EmbedEmbed
Expand Down Expand Up @@ -2139,13 +2139,13 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (PostArgs | PostFindManyArgs)
? Post & {
[P in TrueKeys<S['include']>]:
P extends 'author' ? UserGetPayload<Exclude<S['include'], undefined | null>[P]> : never
[P in TruthyKeys<S['include']>]:
P extends 'author' ? UserGetPayload<S['include'][P]> : never
}
: S extends { select: any } & (PostArgs | PostFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'author' ? UserGetPayload<Exclude<S['select'], undefined | null>[P]> : P extends keyof Post ? Post[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'author' ? UserGetPayload<S['select'][P]> : P extends keyof Post ? Post[P] : never
}
: Post

Expand Down Expand Up @@ -3309,17 +3309,17 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (UserArgs | UserFindManyArgs)
? User & {
[P in TrueKeys<S['include']>]:
P extends 'posts' ? Array < PostGetPayload<Exclude<S['include'], undefined | null>[P]>> :
P extends 'embedHolder' ? EmbedHolderGetPayload<Exclude<S['include'], undefined | null>[P]> :
P extends '_count' ? UserCountOutputTypeGetPayload<Exclude<S['include'], undefined | null>[P]> : never
[P in TruthyKeys<S['include']>]:
P extends 'posts' ? Array < PostGetPayload<S['include'][P]>> :
P extends 'embedHolder' ? EmbedHolderGetPayload<S['include'][P]> :
P extends '_count' ? UserCountOutputTypeGetPayload<S['include'][P]> : never
}
: S extends { select: any } & (UserArgs | UserFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'posts' ? Array < PostGetPayload<Exclude<S['select'], undefined | null>[P]>> :
P extends 'embedHolder' ? EmbedHolderGetPayload<Exclude<S['select'], undefined | null>[P]> :
P extends '_count' ? UserCountOutputTypeGetPayload<Exclude<S['select'], undefined | null>[P]> : P extends keyof User ? User[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'posts' ? Array < PostGetPayload<S['select'][P]>> :
P extends 'embedHolder' ? EmbedHolderGetPayload<S['select'][P]> :
P extends '_count' ? UserCountOutputTypeGetPayload<S['select'][P]> : P extends keyof User ? User[P] : never
}
: User

Expand Down Expand Up @@ -4360,18 +4360,18 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (EmbedHolderArgs | EmbedHolderFindManyArgs)
? EmbedHolder & {
[P in TrueKeys<S['include']>]:
P extends 'User' ? Array < UserGetPayload<Exclude<S['include'], undefined | null>[P]>> :
P extends '_count' ? EmbedHolderCountOutputTypeGetPayload<Exclude<S['include'], undefined | null>[P]> : never
[P in TruthyKeys<S['include']>]:
P extends 'User' ? Array < UserGetPayload<S['include'][P]>> :
P extends '_count' ? EmbedHolderCountOutputTypeGetPayload<S['include'][P]> : never
}
: S extends { select: any } & (EmbedHolderArgs | EmbedHolderFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'embedList' ? Array < EmbedGetPayload<Exclude<S['select'], undefined | null>[P]>> :
P extends 'requiredEmbed' ? EmbedGetPayload<Exclude<S['select'], undefined | null>[P]> :
P extends 'optionalEmbed' ? EmbedGetPayload<Exclude<S['select'], undefined | null>[P]> | null :
P extends 'User' ? Array < UserGetPayload<Exclude<S['select'], undefined | null>[P]>> :
P extends '_count' ? EmbedHolderCountOutputTypeGetPayload<Exclude<S['select'], undefined | null>[P]> : P extends keyof EmbedHolder ? EmbedHolder[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'embedList' ? Array < EmbedGetPayload<S['select'][P]>> :
P extends 'requiredEmbed' ? EmbedGetPayload<S['select'][P]> :
P extends 'optionalEmbed' ? EmbedGetPayload<S['select'][P]> | null :
P extends 'User' ? Array < UserGetPayload<S['select'][P]>> :
P extends '_count' ? EmbedHolderCountOutputTypeGetPayload<S['select'][P]> : P extends keyof EmbedHolder ? EmbedHolder[P] : never
}
: EmbedHolder

Expand Down Expand Up @@ -5527,15 +5527,15 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (MArgs | MFindManyArgs)
? M & {
[P in TrueKeys<S['include']>]:
P extends 'n' ? Array < NGetPayload<Exclude<S['include'], undefined | null>[P]>> :
P extends '_count' ? MCountOutputTypeGetPayload<Exclude<S['include'], undefined | null>[P]> : never
[P in TruthyKeys<S['include']>]:
P extends 'n' ? Array < NGetPayload<S['include'][P]>> :
P extends '_count' ? MCountOutputTypeGetPayload<S['include'][P]> : never
}
: S extends { select: any } & (MArgs | MFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'n' ? Array < NGetPayload<Exclude<S['select'], undefined | null>[P]>> :
P extends '_count' ? MCountOutputTypeGetPayload<Exclude<S['select'], undefined | null>[P]> : P extends keyof M ? M[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'n' ? Array < NGetPayload<S['select'][P]>> :
P extends '_count' ? MCountOutputTypeGetPayload<S['select'][P]> : P extends keyof M ? M[P] : never
}
: M

Expand Down Expand Up @@ -6685,15 +6685,15 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (NArgs | NFindManyArgs)
? N & {
[P in TrueKeys<S['include']>]:
P extends 'm' ? Array < MGetPayload<Exclude<S['include'], undefined | null>[P]>> :
P extends '_count' ? NCountOutputTypeGetPayload<Exclude<S['include'], undefined | null>[P]> : never
[P in TruthyKeys<S['include']>]:
P extends 'm' ? Array < MGetPayload<S['include'][P]>> :
P extends '_count' ? NCountOutputTypeGetPayload<S['include'][P]> : never
}
: S extends { select: any } & (NArgs | NFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'm' ? Array < MGetPayload<Exclude<S['select'], undefined | null>[P]>> :
P extends '_count' ? NCountOutputTypeGetPayload<Exclude<S['select'], undefined | null>[P]> : P extends keyof N ? N[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'm' ? Array < MGetPayload<S['select'][P]>> :
P extends '_count' ? NCountOutputTypeGetPayload<S['select'][P]> : P extends keyof N ? N[P] : never
}
: N

Expand Down Expand Up @@ -7839,15 +7839,15 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (OneOptionalArgs | OneOptionalFindManyArgs)
? OneOptional & {
[P in TrueKeys<S['include']>]:
P extends 'many' ? Array < ManyRequiredGetPayload<Exclude<S['include'], undefined | null>[P]>> :
P extends '_count' ? OneOptionalCountOutputTypeGetPayload<Exclude<S['include'], undefined | null>[P]> : never
[P in TruthyKeys<S['include']>]:
P extends 'many' ? Array < ManyRequiredGetPayload<S['include'][P]>> :
P extends '_count' ? OneOptionalCountOutputTypeGetPayload<S['include'][P]> : never
}
: S extends { select: any } & (OneOptionalArgs | OneOptionalFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'many' ? Array < ManyRequiredGetPayload<Exclude<S['select'], undefined | null>[P]>> :
P extends '_count' ? OneOptionalCountOutputTypeGetPayload<Exclude<S['select'], undefined | null>[P]> : P extends keyof OneOptional ? OneOptional[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'many' ? Array < ManyRequiredGetPayload<S['select'][P]>> :
P extends '_count' ? OneOptionalCountOutputTypeGetPayload<S['select'][P]> : P extends keyof OneOptional ? OneOptional[P] : never
}
: OneOptional

Expand Down Expand Up @@ -8999,13 +8999,13 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (ManyRequiredArgs | ManyRequiredFindManyArgs)
? ManyRequired & {
[P in TrueKeys<S['include']>]:
P extends 'one' ? OneOptionalGetPayload<Exclude<S['include'], undefined | null>[P]> | null : never
[P in TruthyKeys<S['include']>]:
P extends 'one' ? OneOptionalGetPayload<S['include'][P]> | null : never
}
: S extends { select: any } & (ManyRequiredArgs | ManyRequiredFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'one' ? OneOptionalGetPayload<Exclude<S['select'], undefined | null>[P]> | null : P extends keyof ManyRequired ? ManyRequired[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'one' ? OneOptionalGetPayload<S['select'][P]> | null : P extends keyof ManyRequired ? ManyRequired[P] : never
}
: ManyRequired

Expand Down Expand Up @@ -10157,13 +10157,13 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (OptionalSide1Args | OptionalSide1FindManyArgs)
? OptionalSide1 & {
[P in TrueKeys<S['include']>]:
P extends 'opti' ? OptionalSide2GetPayload<Exclude<S['include'], undefined | null>[P]> | null : never
[P in TruthyKeys<S['include']>]:
P extends 'opti' ? OptionalSide2GetPayload<S['include'][P]> | null : never
}
: S extends { select: any } & (OptionalSide1Args | OptionalSide1FindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'opti' ? OptionalSide2GetPayload<Exclude<S['select'], undefined | null>[P]> | null : P extends keyof OptionalSide1 ? OptionalSide1[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'opti' ? OptionalSide2GetPayload<S['select'][P]> | null : P extends keyof OptionalSide1 ? OptionalSide1[P] : never
}
: OptionalSide1

Expand Down Expand Up @@ -11307,13 +11307,13 @@ export namespace Prisma {
S extends undefined ? never :
S extends { include: any } & (OptionalSide2Args | OptionalSide2FindManyArgs)
? OptionalSide2 & {
[P in TrueKeys<S['include']>]:
P extends 'opti' ? OptionalSide1GetPayload<Exclude<S['include'], undefined | null>[P]> | null : never
[P in TruthyKeys<S['include']>]:
P extends 'opti' ? OptionalSide1GetPayload<S['include'][P]> | null : never
}
: S extends { select: any } & (OptionalSide2Args | OptionalSide2FindManyArgs)
? {
[P in TrueKeys<S['select']>]:
P extends 'opti' ? OptionalSide1GetPayload<Exclude<S['select'], undefined | null>[P]> | null : P extends keyof OptionalSide2 ? OptionalSide2[P] : never
[P in TruthyKeys<S['select']>]:
P extends 'opti' ? OptionalSide1GetPayload<S['select'][P]> | null : P extends keyof OptionalSide2 ? OptionalSide2[P] : never
}
: OptionalSide2

Expand Down Expand Up @@ -12402,7 +12402,7 @@ export namespace Prisma {
? A
: S extends { select: any } & (AArgs | AFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof A ? A[P] : never
}
: A
Expand Down Expand Up @@ -13413,7 +13413,7 @@ export namespace Prisma {
? B
: S extends { select: any } & (BArgs | BFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof B ? B[P] : never
}
: B
Expand Down Expand Up @@ -14418,7 +14418,7 @@ export namespace Prisma {
? C
: S extends { select: any } & (CArgs | CFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof C ? C[P] : never
}
: C
Expand Down Expand Up @@ -15445,7 +15445,7 @@ export namespace Prisma {
? D
: S extends { select: any } & (DArgs | DFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof D ? D[P] : never
}
: D
Expand Down Expand Up @@ -16426,7 +16426,7 @@ export namespace Prisma {
? E
: S extends { select: any } & (EArgs | EFindManyArgs)
? {
[P in TrueKeys<S['select']>]:
[P in TruthyKeys<S['select']>]:
P extends keyof E ? E[P] : never
}
: E
Expand Down

0 comments on commit cfb0fa3

Please sign in to comment.