Skip to content

Commit

Permalink
fix(client): support list defaults in DMMF types (#13984)
Browse files Browse the repository at this point in the history
  • Loading branch information
aqrln committed Jun 24, 2022
1 parent 8e90f8a commit da4538d
Show file tree
Hide file tree
Showing 5 changed files with 191 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ exports.Prisma.DScalarFieldEnum = makeEnum({
byteA: 'byteA',
xml: 'xml',
json: 'json',
jsonb: 'jsonb'
jsonb: 'jsonb',
list: 'list'
});

exports.Prisma.EScalarFieldEnum = makeEnum({
Expand Down Expand Up @@ -328,6 +329,7 @@ export type Embed = {
embedEmbedList: EmbedEmbed[]
requiredEmbedEmbed: EmbedEmbed
optionalEmbedEmbed: EmbedEmbed | null
scalarList: number[]
}

/**
Expand Down Expand Up @@ -566,6 +568,7 @@ export type D = {
xml: string
json: Prisma.JsonValue
jsonb: Prisma.JsonValue
list: number[]
}

/**
Expand Down Expand Up @@ -1704,6 +1707,7 @@ export namespace Prisma {
embedEmbedList?: boolean | EmbedEmbedArgs
requiredEmbedEmbed?: boolean | EmbedEmbedArgs
optionalEmbedEmbed?: boolean | EmbedEmbedArgs
scalarList?: boolean
}

export type EmbedInclude = {
Expand Down Expand Up @@ -14447,10 +14451,20 @@ export namespace Prisma {

export type AggregateD = {
_count: DCountAggregateOutputType | null
_avg: DAvgAggregateOutputType | null
_sum: DSumAggregateOutputType | null
_min: DMinAggregateOutputType | null
_max: DMaxAggregateOutputType | null
}

export type DAvgAggregateOutputType = {
list: number | null
}

export type DSumAggregateOutputType = {
list: number[] | null
}

export type DMinAggregateOutputType = {
id: string | null
bool: boolean | null
Expand All @@ -14472,10 +14486,19 @@ export namespace Prisma {
xml: number
json: number
jsonb: number
list: number
_all: number
}


export type DAvgAggregateInputType = {
list?: true
}

export type DSumAggregateInputType = {
list?: true
}

export type DMinAggregateInputType = {
id?: true
bool?: true
Expand All @@ -14497,6 +14520,7 @@ export namespace Prisma {
xml?: true
json?: true
jsonb?: true
list?: true
_all?: true
}

Expand Down Expand Up @@ -14540,6 +14564,18 @@ export namespace Prisma {
* Count returned DS
**/
_count?: true | DCountAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to average
**/
_avg?: DAvgAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
* Select which fields to sum
**/
_sum?: DSumAggregateInputType
/**
* {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs}
*
Expand Down Expand Up @@ -14573,6 +14609,8 @@ export namespace Prisma {
take?: number
skip?: number
_count?: DCountAggregateInputType | true
_avg?: DAvgAggregateInputType
_sum?: DSumAggregateInputType
_min?: DMinAggregateInputType
_max?: DMaxAggregateInputType
}
Expand All @@ -14585,7 +14623,10 @@ export namespace Prisma {
xml: string
json: JsonValue
jsonb: JsonValue
list: number[]
_count: DCountAggregateOutputType | null
_avg: DAvgAggregateOutputType | null
_sum: DSumAggregateOutputType | null
_min: DMinAggregateOutputType | null
_max: DMaxAggregateOutputType | null
}
Expand All @@ -14611,6 +14652,7 @@ export namespace Prisma {
xml?: boolean
json?: boolean
jsonb?: boolean
list?: boolean
}

export type DGetPayload<
Expand Down Expand Up @@ -16506,7 +16548,8 @@ export namespace Prisma {
byteA: 'byteA',
xml: 'xml',
json: 'json',
jsonb: 'jsonb'
jsonb: 'jsonb',
list: 'list'
};

export type DScalarFieldEnum = (typeof DScalarFieldEnum)[keyof typeof DScalarFieldEnum]
Expand Down Expand Up @@ -17392,6 +17435,7 @@ export namespace Prisma {
xml?: StringFilter | string
json?: JsonFilter
jsonb?: JsonFilter
list?: IntNullableListFilter
}

export type DOrderByWithRelationInput = {
Expand All @@ -17401,6 +17445,7 @@ export namespace Prisma {
xml?: SortOrder
json?: SortOrder
jsonb?: SortOrder
list?: SortOrder
}

export type DWhereUniqueInput = {
Expand All @@ -17414,9 +17459,12 @@ export namespace Prisma {
xml?: SortOrder
json?: SortOrder
jsonb?: SortOrder
list?: SortOrder
_count?: DCountOrderByAggregateInput
_avg?: DAvgOrderByAggregateInput
_max?: DMaxOrderByAggregateInput
_min?: DMinOrderByAggregateInput
_sum?: DSumOrderByAggregateInput
}

export type DScalarWhereWithAggregatesInput = {
Expand All @@ -17429,6 +17477,7 @@ export namespace Prisma {
xml?: StringWithAggregatesFilter | string
json?: JsonWithAggregatesFilter
jsonb?: JsonWithAggregatesFilter
list?: IntNullableListFilter
}

export type EWhereInput = {
Expand Down Expand Up @@ -18585,6 +18634,7 @@ export namespace Prisma {
xml: string
json: InputJsonValue
jsonb: InputJsonValue
list?: DCreatelistInput | Enumerable<number>
}

export type DUncheckedCreateInput = {
Expand All @@ -18594,6 +18644,7 @@ export namespace Prisma {
xml: string
json: InputJsonValue
jsonb: InputJsonValue
list?: DCreatelistInput | Enumerable<number>
}

export type DUpdateInput = {
Expand All @@ -18602,6 +18653,7 @@ export namespace Prisma {
xml?: StringFieldUpdateOperationsInput | string
json?: InputJsonValue | InputJsonValue
jsonb?: InputJsonValue | InputJsonValue
list?: DUpdatelistInput | Enumerable<number>
}

export type DUncheckedUpdateInput = {
Expand All @@ -18610,6 +18662,7 @@ export namespace Prisma {
xml?: StringFieldUpdateOperationsInput | string
json?: InputJsonValue | InputJsonValue
jsonb?: InputJsonValue | InputJsonValue
list?: DUpdatelistInput | Enumerable<number>
}

export type DCreateManyInput = {
Expand All @@ -18619,6 +18672,7 @@ export namespace Prisma {
xml: string
json: InputJsonValue
jsonb: InputJsonValue
list?: DCreatelistInput | Enumerable<number>
}

export type DUpdateManyMutationInput = {
Expand All @@ -18627,6 +18681,7 @@ export namespace Prisma {
xml?: StringFieldUpdateOperationsInput | string
json?: InputJsonValue | InputJsonValue
jsonb?: InputJsonValue | InputJsonValue
list?: DUpdatelistInput | Enumerable<number>
}

export type DUncheckedUpdateManyInput = {
Expand All @@ -18635,6 +18690,7 @@ export namespace Prisma {
xml?: StringFieldUpdateOperationsInput | string
json?: InputJsonValue | InputJsonValue
jsonb?: InputJsonValue | InputJsonValue
list?: DUpdatelistInput | Enumerable<number>
}

export type ECreateInput = {
Expand Down Expand Up @@ -19129,6 +19185,7 @@ export namespace Prisma {
embedEmbedList?: Enumerable<EmbedEmbedObjectEqualityInput>
requiredEmbedEmbed: EmbedEmbedObjectEqualityInput
optionalEmbedEmbed?: EmbedEmbedObjectEqualityInput | null
scalarList?: Enumerable<number>
}

export type EmbedCompositeFilter = {
Expand Down Expand Up @@ -19160,6 +19217,7 @@ export namespace Prisma {
embedEmbedList?: EmbedEmbedOrderByCompositeAggregateInput
requiredEmbedEmbed?: EmbedEmbedOrderByInput
optionalEmbedEmbed?: EmbedEmbedOrderByInput
scalarList?: SortOrder
}

export type UserOrderByRelationAggregateInput = {
Expand Down Expand Up @@ -19727,13 +19785,26 @@ export namespace Prisma {
not?: NestedBytesFilter | Buffer
}

export type IntNullableListFilter = {
equals?: Enumerable<number> | null
has?: number | null
hasEvery?: Enumerable<number>
hasSome?: Enumerable<number>
isEmpty?: boolean
}

export type DCountOrderByAggregateInput = {
id?: SortOrder
bool?: SortOrder
byteA?: SortOrder
xml?: SortOrder
json?: SortOrder
jsonb?: SortOrder
list?: SortOrder
}

export type DAvgOrderByAggregateInput = {
list?: SortOrder
}

export type DMaxOrderByAggregateInput = {
Expand All @@ -19750,6 +19821,10 @@ export namespace Prisma {
xml?: SortOrder
}

export type DSumOrderByAggregateInput = {
list?: SortOrder
}

export type BytesWithAggregatesFilter = {
equals?: Buffer
in?: Enumerable<Buffer>
Expand Down Expand Up @@ -19926,6 +20001,7 @@ export namespace Prisma {
embedEmbedList?: Enumerable<EmbedEmbedCreateInput>
requiredEmbedEmbed: EmbedEmbedCreateInput
optionalEmbedEmbed?: EmbedEmbedCreateInput | null
scalarList?: EmbedCreatescalarListInput | Enumerable<number>
}

export type EmbedCreateEnvelopeInput = {
Expand Down Expand Up @@ -20204,10 +20280,19 @@ export namespace Prisma {
divide?: bigint | number
}

export type DCreatelistInput = {
set: Enumerable<number>
}

export type BytesFieldUpdateOperationsInput = {
set?: Buffer
}

export type DUpdatelistInput = {
set?: Enumerable<number>
push?: number | Enumerable<number>
}

export type NestedStringFilter = {
equals?: string
in?: Enumerable<string>
Expand Down Expand Up @@ -20505,6 +20590,7 @@ export namespace Prisma {
embedEmbedList?: XOR<EmbedEmbedCompositeListFilter, Enumerable<EmbedEmbedObjectEqualityInput>>
requiredEmbedEmbed?: XOR<EmbedEmbedCompositeFilter, EmbedEmbedObjectEqualityInput>
optionalEmbedEmbed?: XOR<EmbedEmbedNullableCompositeFilter, EmbedEmbedObjectEqualityInput> | null
scalarList?: IntNullableListFilter
}

export type EmbedEmbedObjectEqualityInput = {
Expand Down Expand Up @@ -20751,6 +20837,10 @@ export namespace Prisma {
boolean: boolean
}

export type EmbedCreatescalarListInput = {
set: Enumerable<number>
}

export type UserCreateWithoutEmbedHolderInput = {
id?: string
email: string
Expand Down Expand Up @@ -20811,6 +20901,7 @@ export namespace Prisma {
embedEmbedList?: XOR<EmbedEmbedListUpdateEnvelopeInput, Enumerable<EmbedEmbedCreateInput>>
requiredEmbedEmbed?: XOR<EmbedEmbedUpdateEnvelopeInput, EmbedEmbedCreateInput>
optionalEmbedEmbed?: XOR<EmbedEmbedNullableUpdateEnvelopeInput, EmbedEmbedCreateInput> | null
scalarList?: EmbedUpdatescalarListInput | Enumerable<number>
}

export type EmbedUpsertInput = {
Expand Down Expand Up @@ -21384,6 +21475,11 @@ export namespace Prisma {
unset?: boolean
}

export type EmbedUpdatescalarListInput = {
set?: Enumerable<number>
push?: number | Enumerable<number>
}

export type UserUpdateWithoutEmbedHolderInput = {
email?: StringFieldUpdateOperationsInput | string
int?: IntFieldUpdateOperationsInput | number
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
}

datasource db {
Expand Down Expand Up @@ -55,6 +55,7 @@ type Embed {
embedEmbedList EmbedEmbed[]
requiredEmbedEmbed EmbedEmbed
optionalEmbedEmbed EmbedEmbed?
scalarList Int[] @default([1])
}

type EmbedEmbed {
Expand Down Expand Up @@ -138,7 +139,7 @@ model OptionalSide1 {
id String @id @default(auto()) @map("_id") @db.ObjectId
opti OptionalSide2? @relation(fields: [optionalSide2Id], references: [id])
optionalSide2Id String? @unique
optionalSide2Id String? @unique
int Int
optionalInt Int?
float Float
Expand Down Expand Up @@ -191,9 +192,9 @@ model A {
}

model B {
id String @id @default(auto()) @map("_id") @db.ObjectId
float Float // @db.Real
dFloat Float // @db.DoublePrecision
id String @id @default(auto()) @map("_id") @db.ObjectId
float Float // @db.Real
dFloat Float // @db.DoublePrecision
}

model C {
Expand All @@ -213,6 +214,7 @@ model D {
xml String // @db.Xml
json Json // @db.Json
jsonb Json // @db.JsonB
list Int[] @default([1, 2, 3])
}

model E {
Expand Down

0 comments on commit da4538d

Please sign in to comment.