diff --git a/prisma-fmt/src/get_dmmf.rs b/prisma-fmt/src/get_dmmf.rs index 151cb7691ee5..412b297d93af 100644 --- a/prisma-fmt/src/get_dmmf.rs +++ b/prisma-fmt/src/get_dmmf.rs @@ -124,7 +124,7 @@ mod tests { }); let expected = expect![[ - r#"{"datamodel":{"enums":[],"models":[{"name":"A","dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"b_id","kind":"scalar","isList":false,"isRequired":true,"isUnique":true,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"b","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"B","relationName":"AToB","relationFromFields":["b_id"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},{"name":"B","dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"a","kind":"object","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"A","relationName":"AToB","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false}],"types":[]},"schema":{"inputObjectTypes":{"prisma":[{"name":"AWhereInput","meta":{"source":"A"},"constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]},{"name":"b","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BRelationFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AOrderByWithRelationInput","constraints":{"maxNumFields":1,"minNumFields":0},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AWhereUniqueInput","meta":{"source":"A"},"constraints":{"maxNumFields":null,"minNumFields":1,"fields":["id","b_id"]},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"b","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BRelationFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AOrderByWithAggregationInput","constraints":{"maxNumFields":1,"minNumFields":0},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"_count","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACountOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_max","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AMaxOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_min","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AMinOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AScalarWhereWithAggregatesInput","meta":{"source":"A"},"constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]}]},{"name":"BWhereInput","meta":{"source":"B"},"constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]},{"name":"a","isRequired":false,"isNullable":true,"inputTypes":[{"type":"ANullableRelationFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"Null","location":"scalar","isList":false}]}]},{"name":"BOrderByWithRelationInput","constraints":{"maxNumFields":1,"minNumFields":0},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BWhereUniqueInput","meta":{"source":"B"},"constraints":{"maxNumFields":null,"minNumFields":1,"fields":["id"]},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"a","isRequired":false,"isNullable":true,"inputTypes":[{"type":"ANullableRelationFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"Null","location":"scalar","isList":false}]}]},{"name":"BOrderByWithAggregationInput","constraints":{"maxNumFields":1,"minNumFields":0},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"_count","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCountOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_max","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BMaxOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_min","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BMinOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BScalarWhereWithAggregatesInput","meta":{"source":"B"},"constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]}]},{"name":"ACreateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"b","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateNestedOneWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedCreateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"AUpdateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"b","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BUpdateOneRequiredWithoutANestedInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedUpdateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ACreateManyInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"AUpdateManyMutationInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedUpdateManyInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BCreateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateNestedOneWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUncheckedCreateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUncheckedCreateNestedOneWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUpdateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpdateOneWithoutBNestedInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUncheckedUpdateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUncheckedUpdateOneWithoutBNestedInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BCreateManyInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"BUpdateManyMutationInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUncheckedUpdateManyInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"StringFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"contains","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"startsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"endsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"mode","isRequired":false,"isNullable":false,"inputTypes":[{"type":"QueryMode","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BRelationFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"is","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"isNot","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ACountOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"AMaxOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"AMinOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"StringWithAggregatesFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"contains","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"startsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"endsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"mode","isRequired":false,"isNullable":false,"inputTypes":[{"type":"QueryMode","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"NestedStringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_count","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedIntFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_min","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_max","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ANullableRelationFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"is","isRequired":false,"isNullable":true,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"Null","location":"scalar","isList":false}]},{"name":"isNot","isRequired":false,"isNullable":true,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"Null","location":"scalar","isList":false}]}]},{"name":"BCountOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"BMaxOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"BMinOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"BCreateNestedOneWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCreateOrConnectWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"StringFieldUpdateOperationsInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"set","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"BUpdateOneRequiredWithoutANestedInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCreateOrConnectWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"upsert","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BUpsertWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BUpdateToOneWithWhereWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ACreateNestedOneWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateOrConnectWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedCreateNestedOneWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateOrConnectWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUpdateOneWithoutBNestedInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateOrConnectWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"upsert","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpsertWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"disconnect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"delete","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpdateToOneWithWhereWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedUpdateOneWithoutBNestedInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateOrConnectWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"upsert","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpsertWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"disconnect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"delete","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpdateToOneWithWhereWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"NestedStringFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"contains","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"startsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"endsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"NestedStringWithAggregatesFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"contains","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"startsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"endsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"NestedStringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_count","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedIntFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_min","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_max","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"NestedIntFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":true},{"type":"ListIntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":true},{"type":"ListIntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"NestedIntFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BCreateWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"BUncheckedCreateWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"BCreateOrConnectWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUpsertWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"update","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUpdateToOneWithWhereWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUpdateWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUncheckedUpdateWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ACreateWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"AUncheckedCreateWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"ACreateOrConnectWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUpsertWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"update","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUpdateToOneWithWhereWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUpdateWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedUpdateWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]}]},"outputObjectTypes":{"prisma":[{"name":"Query","fields":[{"name":"findFirstA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findFirstAOrThrow","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findManyA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":false,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":true}},{"name":"aggregateA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AggregateA","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"groupByA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithAggregationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithAggregationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"by","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true},{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"having","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AGroupByOutputType","namespace":"prisma","location":"outputObjectTypes","isList":true}},{"name":"findUniqueA","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findUniqueAOrThrow","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findFirstB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findFirstBOrThrow","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findManyB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":true}},{"name":"aggregateB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AggregateB","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"groupByB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithAggregationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithAggregationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"by","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true},{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"having","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"BGroupByOutputType","namespace":"prisma","location":"outputObjectTypes","isList":true}},{"name":"findUniqueB","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findUniqueBOrThrow","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}}]},{"name":"Mutation","fields":[{"name":"createOneA","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"upsertOneA","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"createManyA","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"ACreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"skipDuplicates","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"deleteOneA","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"updateOneA","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"updateManyA","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateManyMutationInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"deleteManyA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"createOneB","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"upsertOneB","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"createManyB","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BCreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"skipDuplicates","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"deleteOneB","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"updateOneB","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"updateManyB","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateManyMutationInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"deleteManyB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"executeRaw","args":[{"name":"query","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"parameters","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Json","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"Json","location":"scalar","isList":false}},{"name":"queryRaw","args":[{"name":"query","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"parameters","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Json","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"Json","location":"scalar","isList":false}}]},{"name":"AggregateA","fields":[{"name":"_count","args":[],"isNullable":true,"outputType":{"type":"ACountAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_min","args":[],"isNullable":true,"outputType":{"type":"AMinAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_max","args":[],"isNullable":true,"outputType":{"type":"AMaxAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}}]},{"name":"AGroupByOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"_count","args":[],"isNullable":true,"outputType":{"type":"ACountAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_min","args":[],"isNullable":true,"outputType":{"type":"AMinAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_max","args":[],"isNullable":true,"outputType":{"type":"AMaxAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}}]},{"name":"AggregateB","fields":[{"name":"_count","args":[],"isNullable":true,"outputType":{"type":"BCountAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_min","args":[],"isNullable":true,"outputType":{"type":"BMinAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_max","args":[],"isNullable":true,"outputType":{"type":"BMaxAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}}]},{"name":"BGroupByOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"_count","args":[],"isNullable":true,"outputType":{"type":"BCountAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_min","args":[],"isNullable":true,"outputType":{"type":"BMinAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_max","args":[],"isNullable":true,"outputType":{"type":"BMaxAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}}]},{"name":"AffectedRowsOutput","fields":[{"name":"count","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}}]},{"name":"ACountAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}},{"name":"_all","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}}]},{"name":"AMinAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}}]},{"name":"AMaxAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}}]},{"name":"BCountAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}},{"name":"_all","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}}]},{"name":"BMinAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}}]},{"name":"BMaxAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}}]}],"model":[{"name":"A","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b","args":[],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}}]},{"name":"B","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"a","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}}]}]},"enumTypes":{"prisma":[{"name":"TransactionIsolationLevel","values":["ReadUncommitted","ReadCommitted","RepeatableRead","Serializable"]},{"name":"AScalarFieldEnum","values":["id","b_id"]},{"name":"BScalarFieldEnum","values":["id"]},{"name":"SortOrder","values":["asc","desc"]},{"name":"QueryMode","values":["default","insensitive"]}]},"fieldRefTypes":{"prisma":[{"name":"StringFieldRefInput","allowTypes":[{"type":"String","location":"scalar","isList":false}],"fields":[{"name":"_ref","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"_container","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"ListStringFieldRefInput","allowTypes":[{"type":"String","location":"scalar","isList":true}],"fields":[{"name":"_ref","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"_container","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"IntFieldRefInput","allowTypes":[{"type":"Int","location":"scalar","isList":false}],"fields":[{"name":"_ref","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"_container","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"ListIntFieldRefInput","allowTypes":[{"type":"Int","location":"scalar","isList":true}],"fields":[{"name":"_ref","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"_container","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]}]}},"mappings":{"modelOperations":[{"model":"A","aggregate":"aggregateA","createMany":"createManyA","createOne":"createOneA","deleteMany":"deleteManyA","deleteOne":"deleteOneA","findFirst":"findFirstA","findFirstOrThrow":"findFirstAOrThrow","findMany":"findManyA","findUnique":"findUniqueA","findUniqueOrThrow":"findUniqueAOrThrow","groupBy":"groupByA","updateMany":"updateManyA","updateOne":"updateOneA","upsertOne":"upsertOneA"},{"model":"B","aggregate":"aggregateB","createMany":"createManyB","createOne":"createOneB","deleteMany":"deleteManyB","deleteOne":"deleteOneB","findFirst":"findFirstB","findFirstOrThrow":"findFirstBOrThrow","findMany":"findManyB","findUnique":"findUniqueB","findUniqueOrThrow":"findUniqueBOrThrow","groupBy":"groupByB","updateMany":"updateManyB","updateOne":"updateOneB","upsertOne":"upsertOneB"}],"otherOperations":{"read":[],"write":["executeRaw","queryRaw"]}}}"# + r#"{"datamodel":{"enums":[],"models":[{"name":"A","dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"b_id","kind":"scalar","isList":false,"isRequired":true,"isUnique":true,"isId":false,"isReadOnly":true,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"b","kind":"object","isList":false,"isRequired":true,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"B","relationName":"AToB","relationFromFields":["b_id"],"relationToFields":["id"],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false},{"name":"B","dbName":null,"fields":[{"name":"id","kind":"scalar","isList":false,"isRequired":true,"isUnique":false,"isId":true,"isReadOnly":false,"hasDefaultValue":false,"type":"String","isGenerated":false,"isUpdatedAt":false},{"name":"a","kind":"object","isList":false,"isRequired":false,"isUnique":false,"isId":false,"isReadOnly":false,"hasDefaultValue":false,"type":"A","relationName":"AToB","relationFromFields":[],"relationToFields":[],"isGenerated":false,"isUpdatedAt":false}],"primaryKey":null,"uniqueFields":[],"uniqueIndexes":[],"isGenerated":false}],"types":[]},"schema":{"inputObjectTypes":{"prisma":[{"name":"AWhereInput","meta":{"source":"A"},"constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]},{"name":"b","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BRelationFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AOrderByWithRelationInput","constraints":{"maxNumFields":1,"minNumFields":0},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AWhereUniqueInput","meta":{"source":"A"},"constraints":{"maxNumFields":null,"minNumFields":1,"fields":["id","b_id"]},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"b","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BRelationFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AOrderByWithAggregationInput","constraints":{"maxNumFields":1,"minNumFields":0},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"_count","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACountOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_max","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AMaxOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_min","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AMinOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AScalarWhereWithAggregatesInput","meta":{"source":"A"},"constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]}]},{"name":"BWhereInput","meta":{"source":"B"},"constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]},{"name":"a","isRequired":false,"isNullable":true,"inputTypes":[{"type":"ANullableRelationFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"Null","location":"scalar","isList":false}]}]},{"name":"BOrderByWithRelationInput","constraints":{"maxNumFields":1,"minNumFields":0},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BWhereUniqueInput","meta":{"source":"B"},"constraints":{"maxNumFields":null,"minNumFields":1,"fields":["id"]},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"a","isRequired":false,"isNullable":true,"inputTypes":[{"type":"ANullableRelationFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"Null","location":"scalar","isList":false}]}]},{"name":"BOrderByWithAggregationInput","constraints":{"maxNumFields":1,"minNumFields":0},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"_count","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCountOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_max","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BMaxOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_min","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BMinOrderByAggregateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BScalarWhereWithAggregatesInput","meta":{"source":"B"},"constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"AND","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"OR","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"NOT","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"StringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"String","location":"scalar","isList":false}]}]},{"name":"ACreateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"b","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateNestedOneWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedCreateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"AUpdateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"b","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BUpdateOneRequiredWithoutANestedInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedUpdateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ACreateManyInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"b_id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"AUpdateManyMutationInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedUpdateManyInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BCreateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateNestedOneWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUncheckedCreateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUncheckedCreateNestedOneWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUpdateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpdateOneWithoutBNestedInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUncheckedUpdateInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"a","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUncheckedUpdateOneWithoutBNestedInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BCreateManyInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"BUpdateManyMutationInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUncheckedUpdateManyInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"StringFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"contains","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"startsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"endsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"mode","isRequired":false,"isNullable":false,"inputTypes":[{"type":"QueryMode","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BRelationFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"is","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"isNot","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ACountOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"AMaxOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"AMinOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"b_id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"StringWithAggregatesFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"contains","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"startsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"endsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"mode","isRequired":false,"isNullable":false,"inputTypes":[{"type":"QueryMode","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"NestedStringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_count","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedIntFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_min","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_max","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ANullableRelationFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"is","isRequired":false,"isNullable":true,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"Null","location":"scalar","isList":false}]},{"name":"isNot","isRequired":false,"isNullable":true,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"Null","location":"scalar","isList":false}]}]},{"name":"BCountOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"BMaxOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"BMinOrderByAggregateInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"SortOrder","namespace":"prisma","location":"enumTypes","isList":false}]}]},{"name":"BCreateNestedOneWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCreateOrConnectWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"StringFieldUpdateOperationsInput","constraints":{"maxNumFields":1,"minNumFields":1},"fields":[{"name":"set","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"BUpdateOneRequiredWithoutANestedInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BCreateOrConnectWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"upsert","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BUpsertWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BUpdateToOneWithWhereWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ACreateNestedOneWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateOrConnectWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedCreateNestedOneWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateOrConnectWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUpdateOneWithoutBNestedInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateOrConnectWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"upsert","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpsertWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"disconnect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"delete","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpdateToOneWithWhereWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedUpdateOneWithoutBNestedInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"create","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connectOrCreate","isRequired":false,"isNullable":false,"inputTypes":[{"type":"ACreateOrConnectWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"upsert","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpsertWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"disconnect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"delete","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false},{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"connect","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AUpdateToOneWithWhereWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"NestedStringFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"contains","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"startsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"endsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"NestedStringWithAggregatesFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":true},{"type":"ListStringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"contains","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"startsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"endsWith","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"NestedStringWithAggregatesFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_count","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedIntFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_min","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"_max","isRequired":false,"isNullable":false,"inputTypes":[{"type":"NestedStringFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"NestedIntFilter","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"equals","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"in","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":true},{"type":"ListIntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"notIn","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":true},{"type":"ListIntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"lte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gt","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"gte","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"IntFieldRefInput","namespace":"prisma","location":"fieldRefTypes","isList":false}]},{"name":"not","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false},{"type":"NestedIntFilter","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BCreateWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"BUncheckedCreateWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"BCreateOrConnectWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUpsertWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"update","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUpdateToOneWithWhereWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateWithoutAInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUpdateWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"BUncheckedUpdateWithoutAInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"ACreateWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"AUncheckedCreateWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"ACreateOrConnectWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUpsertWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"update","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUpdateToOneWithWhereWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateWithoutBInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUpdateWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]},{"name":"AUncheckedUpdateWithoutBInput","constraints":{"maxNumFields":null,"minNumFields":null},"fields":[{"name":"id","isRequired":false,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false},{"type":"StringFieldUpdateOperationsInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}]}]},"outputObjectTypes":{"prisma":[{"name":"Query","fields":[{"name":"findFirstA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findFirstAOrThrow","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findManyA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":false,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":true}},{"name":"aggregateA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AggregateA","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"groupByA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AOrderByWithAggregationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"AOrderByWithAggregationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"by","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true},{"type":"AScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"having","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AGroupByOutputType","namespace":"prisma","location":"outputObjectTypes","isList":true}},{"name":"findUniqueA","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findUniqueAOrThrow","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findFirstB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findFirstBOrThrow","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findManyB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"distinct","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false},{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true}]}],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":true}},{"name":"aggregateB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithRelationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"cursor","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AggregateB","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"groupByB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"orderBy","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BOrderByWithAggregationInput","namespace":"prisma","location":"inputObjectTypes","isList":true},{"type":"BOrderByWithAggregationInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"by","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":true},{"type":"BScalarFieldEnum","namespace":"prisma","location":"enumTypes","isList":false}]},{"name":"having","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BScalarWhereWithAggregatesInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"take","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]},{"name":"skip","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Int","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"BGroupByOutputType","namespace":"prisma","location":"outputObjectTypes","isList":true}},{"name":"findUniqueB","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"findUniqueBOrThrow","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}}]},{"name":"Mutation","fields":[{"name":"createOneA","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"upsertOneA","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"createManyA","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"ACreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"skipDuplicates","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"createManyAAndReturn","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"ACreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"ACreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"skipDuplicates","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"CreateManyAAndReturnOutputType","namespace":"model","location":"outputObjectTypes","isList":true}},{"name":"deleteOneA","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"updateOneA","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"updateManyA","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"AUpdateManyMutationInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"AUncheckedUpdateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"deleteManyA","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"createOneB","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"upsertOneB","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"create","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedCreateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"update","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"createManyB","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BCreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"skipDuplicates","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"createManyBAndReturn","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BCreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BCreateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":true}]},{"name":"skipDuplicates","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Boolean","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"CreateManyBAndReturnOutputType","namespace":"model","location":"outputObjectTypes","isList":true}},{"name":"deleteOneB","args":[{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"updateOneB","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BWhereUniqueInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}},{"name":"updateManyB","args":[{"name":"data","isRequired":true,"isNullable":false,"inputTypes":[{"type":"BUpdateManyMutationInput","namespace":"prisma","location":"inputObjectTypes","isList":false},{"type":"BUncheckedUpdateManyInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]},{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"deleteManyB","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"BWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":false,"outputType":{"type":"AffectedRowsOutput","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"executeRaw","args":[{"name":"query","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"parameters","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Json","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"Json","location":"scalar","isList":false}},{"name":"queryRaw","args":[{"name":"query","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"parameters","isRequired":false,"isNullable":false,"inputTypes":[{"type":"Json","location":"scalar","isList":false}]}],"isNullable":false,"outputType":{"type":"Json","location":"scalar","isList":false}}]},{"name":"AggregateA","fields":[{"name":"_count","args":[],"isNullable":true,"outputType":{"type":"ACountAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_min","args":[],"isNullable":true,"outputType":{"type":"AMinAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_max","args":[],"isNullable":true,"outputType":{"type":"AMaxAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}}]},{"name":"AGroupByOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"_count","args":[],"isNullable":true,"outputType":{"type":"ACountAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_min","args":[],"isNullable":true,"outputType":{"type":"AMinAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_max","args":[],"isNullable":true,"outputType":{"type":"AMaxAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}}]},{"name":"AggregateB","fields":[{"name":"_count","args":[],"isNullable":true,"outputType":{"type":"BCountAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_min","args":[],"isNullable":true,"outputType":{"type":"BMinAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_max","args":[],"isNullable":true,"outputType":{"type":"BMaxAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}}]},{"name":"BGroupByOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"_count","args":[],"isNullable":true,"outputType":{"type":"BCountAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_min","args":[],"isNullable":true,"outputType":{"type":"BMinAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}},{"name":"_max","args":[],"isNullable":true,"outputType":{"type":"BMaxAggregateOutputType","namespace":"prisma","location":"outputObjectTypes","isList":false}}]},{"name":"AffectedRowsOutput","fields":[{"name":"count","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}}]},{"name":"ACountAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}},{"name":"_all","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}}]},{"name":"AMinAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}}]},{"name":"AMaxAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}}]},{"name":"BCountAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}},{"name":"_all","args":[],"isNullable":false,"outputType":{"type":"Int","location":"scalar","isList":false}}]},{"name":"BMinAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}}]},{"name":"BMaxAggregateOutputType","fields":[{"name":"id","args":[],"isNullable":true,"outputType":{"type":"String","location":"scalar","isList":false}}]}],"model":[{"name":"A","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b","args":[],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}}]},{"name":"B","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"a","args":[{"name":"where","isRequired":false,"isNullable":false,"inputTypes":[{"type":"AWhereInput","namespace":"prisma","location":"inputObjectTypes","isList":false}]}],"isNullable":true,"outputType":{"type":"A","namespace":"model","location":"outputObjectTypes","isList":false}}]},{"name":"CreateManyAAndReturnOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b_id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}},{"name":"b","args":[],"isNullable":false,"outputType":{"type":"B","namespace":"model","location":"outputObjectTypes","isList":false}}]},{"name":"CreateManyBAndReturnOutputType","fields":[{"name":"id","args":[],"isNullable":false,"outputType":{"type":"String","location":"scalar","isList":false}}]}]},"enumTypes":{"prisma":[{"name":"TransactionIsolationLevel","values":["ReadUncommitted","ReadCommitted","RepeatableRead","Serializable"]},{"name":"AScalarFieldEnum","values":["id","b_id"]},{"name":"BScalarFieldEnum","values":["id"]},{"name":"SortOrder","values":["asc","desc"]},{"name":"QueryMode","values":["default","insensitive"]}]},"fieldRefTypes":{"prisma":[{"name":"StringFieldRefInput","allowTypes":[{"type":"String","location":"scalar","isList":false}],"fields":[{"name":"_ref","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"_container","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"ListStringFieldRefInput","allowTypes":[{"type":"String","location":"scalar","isList":true}],"fields":[{"name":"_ref","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"_container","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"IntFieldRefInput","allowTypes":[{"type":"Int","location":"scalar","isList":false}],"fields":[{"name":"_ref","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"_container","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]},{"name":"ListIntFieldRefInput","allowTypes":[{"type":"Int","location":"scalar","isList":true}],"fields":[{"name":"_ref","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]},{"name":"_container","isRequired":true,"isNullable":false,"inputTypes":[{"type":"String","location":"scalar","isList":false}]}]}]}},"mappings":{"modelOperations":[{"model":"A","aggregate":"aggregateA","createMany":"createManyA","createManyAndReturn":"createManyAAndReturn","createOne":"createOneA","deleteMany":"deleteManyA","deleteOne":"deleteOneA","findFirst":"findFirstA","findFirstOrThrow":"findFirstAOrThrow","findMany":"findManyA","findUnique":"findUniqueA","findUniqueOrThrow":"findUniqueAOrThrow","groupBy":"groupByA","updateMany":"updateManyA","updateOne":"updateOneA","upsertOne":"upsertOneA"},{"model":"B","aggregate":"aggregateB","createMany":"createManyB","createManyAndReturn":"createManyBAndReturn","createOne":"createOneB","deleteMany":"deleteManyB","deleteOne":"deleteOneB","findFirst":"findFirstB","findFirstOrThrow":"findFirstBOrThrow","findMany":"findManyB","findUnique":"findUniqueB","findUniqueOrThrow":"findUniqueBOrThrow","groupBy":"groupByB","updateMany":"updateManyB","updateOne":"updateOneB","upsertOne":"upsertOneB"}],"otherOperations":{"read":[],"write":["executeRaw","queryRaw"]}}}"# ]]; let response = get_dmmf(&request.to_string()).unwrap(); diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create_many_and_return.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create_many_and_return.rs new file mode 100644 index 000000000000..f02aaf81e600 --- /dev/null +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/create_many_and_return.rs @@ -0,0 +1,829 @@ +use query_engine_tests::*; + +#[test_suite(capabilities(CreateMany, InsertReturning))] +mod create_many { + use indoc::indoc; + use query_engine_tests::{assert_error, run_query}; + + fn schema_1() -> String { + let schema = indoc! { + r#"model Test { + #id(id, Int, @id) + str1 String + str2 String? + str3 String? @default("SOME_DEFAULT") + } + "# + }; + + schema.to_owned() + } + + #[connector_test(schema(schema_1))] + async fn basic_create_many(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { + createManyTestAndReturn(data: [ + { id: 1, str1: "1", str2: "1", str3: "1"}, + { id: 2, str1: "2", str3: null}, + { id: 3, str1: "1"}, + ]) { + id str1 str2 str3 + } + }"#), + @r###"{"data":{"createManyTestAndReturn":[{"id":1,"str1":"1","str2":"1","str3":"1"},{"id":2,"str1":"2","str2":null,"str3":null},{"id":3,"str1":"1","str2":null,"str3":"SOME_DEFAULT"}]}}"### + ); + + Ok(()) + } + + #[connector_test(schema(schema_1))] + async fn basic_create_many_shorthand(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { + createManyTestAndReturn(data: { id: 1, str1: "1", str2: "1", str3: "1"}) { + str1 str2 str3 + } + }"#), + @r###"{"data":{"createManyTestAndReturn":[{"str1":"1","str2":"1","str3":"1"}]}}"### + ); + + Ok(()) + } + + fn schema_2() -> String { + let schema = indoc! { + r#"model Test { + #id(id, Int, @id @default(autoincrement())) + str1 String + str2 String? + str3 String? @default("SOME_DEFAULT") + }"# + }; + + schema.to_owned() + } + + // Covers: AutoIncrement ID working with basic autonincrement functionality. + #[connector_test( + schema(schema_2), + capabilities(CreateManyWriteableAutoIncId, InsertReturning), + exclude(CockroachDb) + )] + async fn basic_create_many_autoincrement(runner: Runner) -> TestResult<()> { + let res = run_query_json!( + &runner, + r#"mutation { + createManyTestAndReturn(data: [ + { id: 123, str1: "1", str2: "1", str3: "1"}, + { id: 321, str1: "2", str3: null}, + { str1: "1"}, + ]) { + id str1 str2 str3 + } + }"#, + &["data", "createManyTestAndReturn"] + ); + + let mut res = match res { + serde_json::Value::Array(items) => items, + _ => panic!("Expected an array"), + }; + + // Order is not deterministic on SQLite + res.sort_by_key(|x| x["id"].as_i64().unwrap()); + + let json_res_string = serde_json::Value::Array(res).to_string(); + + is_one_of!( + json_res_string, + [ + r#"[{"id":1,"str1":"1","str2":null,"str3":"SOME_DEFAULT"},{"id":123,"str1":"1","str2":"1","str3":"1"},{"id":321,"str1":"2","str2":null,"str3":null}]"#, + // Sqlite sets the next autoincrement as MAX(id) + 1 + r#"[{"id":123,"str1":"1","str2":"1","str3":"1"},{"id":321,"str1":"2","str2":null,"str3":null},{"id":322,"str1":"1","str2":null,"str3":"SOME_DEFAULT"}]"# + ] + ); + + Ok(()) + } + + fn schema_2_cockroachdb() -> String { + let schema = indoc! { + r#"model Test { + #id(id, BigInt, @id @default(autoincrement())) + str1 String + str2 String? + str3 String? @default("SOME_DEFAULT") + }"# + }; + + schema.to_owned() + } + + // Covers: AutoIncrement ID working with basic autonincrement functionality. + #[connector_test(schema(schema_2_cockroachdb), only(CockroachDb))] + async fn basic_create_many_autoincrement_cockroachdb(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { + createManyTestAndReturn(data: [ + { id: 123, str1: "1", str2: "1", str3: "1"}, + { id: 321, str1: "2", str3: null}, + { str1: "1"}, + ]) { + str1 str2 str3 + } + }"#), + @r###"{"data":{"createManyTestAndReturn":[{"str1":"1","str2":"1","str3":"1"},{"str1":"2","str2":null,"str3":null},{"str1":"1","str2":null,"str3":"SOME_DEFAULT"}]}}"### + ); + + Ok(()) + } + + fn schema_3() -> String { + let schema = indoc! { + r#"model Test { + #id(id, Int, @id) + str String? @default("SOME_DEFAULT") + }"# + }; + + schema.to_owned() + } + + // "createMany" should "correctly use defaults and nulls" + #[connector_test(schema(schema_3))] + async fn create_many_defaults_nulls(runner: Runner) -> TestResult<()> { + // Not providing a value must provide the default, providing null must result in null. + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { + createManyTestAndReturn(data: [ + { id: 1 }, + { id: 2, str: null } + ]) { + id str + } + }"#), + @r###"{"data":{"createManyTestAndReturn":[{"id":1,"str":"SOME_DEFAULT"},{"id":2,"str":null}]}}"### + ); + + insta::assert_snapshot!( + run_query!(&runner, r#"{ + findManyTest { + id + str + } + }"#), + @r###"{"data":{"findManyTest":[{"id":1,"str":"SOME_DEFAULT"},{"id":2,"str":null}]}}"### + ); + + Ok(()) + } + + fn schema_4() -> String { + let schema = indoc! { + r#"model Test { + #id(id, Int, @id) + }"# + }; + + schema.to_owned() + } + + // "createMany" should "error on duplicates by default" + #[connector_test(schema(schema_4))] + async fn create_many_error_dups(runner: Runner) -> TestResult<()> { + assert_error!( + &runner, + r#"mutation { + createManyTestAndReturn(data: [ + { id: 1 }, + { id: 1 } + ]) { + id + } + }"#, + 2002, + "Unique constraint failed" + ); + + Ok(()) + } + + // "createMany" should "not error on duplicates with skipDuplicates true" + #[connector_test(schema(schema_4), capabilities(CreateMany, CreateSkipDuplicates, InsertReturning))] + async fn create_many_no_error_skip_dup(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { + createManyTestAndReturn(skipDuplicates: true, data: [ + { id: 1 }, + { id: 1 } + ]) { + id + } + }"#), + @r###"{"data":{"createManyTestAndReturn":[{"id":1}]}}"### + ); + + Ok(()) + } + + // "createMany" should "allow creating a large number of records (horizontal partitioning check)" + // Note: Checks were originally higher, but test method (command line args) blows up... + // Covers: Batching by row number. + // Each DB allows a certain amount of params per single query, and a certain number of rows. + // Each created row has 1 param and we create 1000 records. + // TODO: unexclude d1 once https://github.com/prisma/team-orm/issues/1070 is fixed + #[connector_test(schema(schema_4), exclude(Sqlite("cfd1")))] + async fn large_num_records_horizontal(runner: Runner) -> TestResult<()> { + let mut records: Vec = vec![]; + + for i in 1..=1000 { + records.push(format!("{{ id: {i} }}")); + } + + let res = run_query_json!( + &runner, + format!( + r#"mutation {{ + createManyTestAndReturn(data: [{}]) {{ + id + }} + }}"#, + records.join(", ") + ), + &["data", "createManyTestAndReturn"] + ); + + assert_eq!(res.as_array().map(|a| a.len()), Some(1000)); + + Ok(()) + } + + fn schema_5() -> String { + let schema = indoc! { + r#"model Test { + #id(id, Int, @id) + a Int + b Int + c Int + }"# + }; + + schema.to_owned() + } + + // "createMany" should "allow creating a large number of records (vertical partitioning check)" + // Note: Checks were originally higher, but test method (command line args) blows up... + // Covers: Batching by row number. + // Each DB allows a certain amount of params per single query, and a certain number of rows. + // Each created row has 4 params and we create 1000 rows. + // TODO: unexclude d1 once https://github.com/prisma/team-orm/issues/1070 is fixed + #[connector_test(schema(schema_5), exclude(Sqlite("cfd1")))] + async fn large_num_records_vertical(runner: Runner) -> TestResult<()> { + let mut records: Vec = vec![]; + + for i in 1..=2000 { + records.push(format!("{{ id: {i}, a: {i}, b: {i}, c: {i} }}")); + } + + let res = run_query_json!( + &runner, + format!( + r#"mutation {{ + createManyTestAndReturn(data: [{}]) {{ + a b c + }} + }}"#, + records.join(", ") + ), + &["data", "createManyTestAndReturn"] + ); + + assert_eq!(res.as_array().map(|a| a.len()), Some(2000)); + + Ok(()) + } + + fn schema_6() -> String { + let schema = indoc! { + r#" + model TestModel { + #id(id, Int, @id) + updatedAt DateTime @map("updated_at") + } + "# + }; + + schema.to_owned() + } + + #[connector_test(schema(schema_6))] + async fn create_many_map_behavior(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, format!(r#"mutation {{ + createManyTestModelAndReturn(data: [ + {{ id: 1, updatedAt: "{}" }}, + {{ id: 2, updatedAt: "{}" }} + ]) {{ + id updatedAt + }} + }}"#, date_iso_string(2009, 8, 1), date_iso_string(1337, 1, 1))), + @r###"{"data":{"createManyTestModelAndReturn":[{"id":1,"updatedAt":"2009-08-01T00:00:00.000Z"},{"id":2,"updatedAt":"1337-01-01T00:00:00.000Z"}]}}"### + ); + + Ok(()) + } + + fn schema_11_child() -> String { + let schema = indoc! { + r#"model Test { + #id(id, Int, @id) + + child Child? + } + + model Child { + #id(id, Int, @id) + + testId Int? @unique + test Test? @relation(fields: [testId], references: [id]) + + }"# + }; + + schema.to_owned() + } + + #[connector_test(schema(schema_1m_child))] + async fn create_many_11_inline_rel_read_works(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { createManyTestAndReturn(data: [{ id: 1 }, { id: 2 }]) { id } }"#), + @r###"{"data":{"createManyTestAndReturn":[{"id":1},{"id":2}]}}"### + ); + + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { + createManyChildAndReturn(data: [ + { id: 1, testId: 1 }, + { id: 2, testId: 2 }, + { id: 3, }, + ]) { id test { id } } + }"#), + @r###"{"data":{"createManyChildAndReturn":[{"id":1,"test":{"id":1}},{"id":2,"test":{"id":2}},{"id":3,"test":null}]}}"### + ); + + Ok(()) + } + + #[connector_test(schema(schema_11_child))] + async fn create_many_11_non_inline_rel_read_fails(runner: Runner) -> TestResult<()> { + runner + .query_json(serde_json::json!({ + "modelName": "Test", + "action": "createManyAndReturn", + "query": { + "arguments": { "data": { "id": 1 } }, + "selection": { + "id": true, + "child": true + } + } + })) + .await? + .assert_failure(2009, Some("Field 'child' not found in enclosing type".to_string())); + + Ok(()) + } + + fn schema_1m_child() -> String { + let schema = indoc! { + r#"model Test { + #id(id, Int, @id) + str1 String? + str2 String? + str3 String? @default("SOME_DEFAULT") + + children Child[] + } + + model Child { + #id(id, Int, @id) + str1 String? + str2 String? + str3 String? @default("SOME_DEFAULT") + + testId Int? + test Test? @relation(fields: [testId], references: [id]) + + }"# + }; + + schema.to_owned() + } + + #[connector_test(schema(schema_1m_child))] + async fn create_many_1m_inline_rel_read_works(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { createManyTestAndReturn(data: [{ id: 1, str1: "1" }, { id: 2, str1: "2" }]) { id str1 str2 str3 } }"#), + @r###"{"data":{"createManyTestAndReturn":[{"id":1,"str1":"1","str2":null,"str3":"SOME_DEFAULT"},{"id":2,"str1":"2","str2":null,"str3":"SOME_DEFAULT"}]}}"### + ); + + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { + createManyChildAndReturn(data: [ + { id: 1, str1: "1", str2: "1", str3: "1", testId: 1 }, + { id: 2, str1: "2", str3: null, testId: 2 }, + { id: 3, str1: "1" }, + ]) { id str1 str2 str3 test { id str1 str2 str3 } } + }"#), + @r###"{"data":{"createManyChildAndReturn":[{"id":1,"str1":"1","str2":"1","str3":"1","test":{"id":1,"str1":"1","str2":null,"str3":"SOME_DEFAULT"}},{"id":2,"str1":"2","str2":null,"str3":null,"test":{"id":2,"str1":"2","str2":null,"str3":"SOME_DEFAULT"}},{"id":3,"str1":"1","str2":null,"str3":"SOME_DEFAULT","test":null}]}}"### + ); + + Ok(()) + } + + #[connector_test(schema(schema_1m_child))] + async fn create_many_1m_non_inline_rel_read_fails(runner: Runner) -> TestResult<()> { + runner + .query_json(serde_json::json!({ + "modelName": "Test", + "action": "createManyAndReturn", + "query": { + "arguments": { "data": { "id": 1 } }, + "selection": { + "id": true, + "children": true + } + } + })) + .await? + .assert_failure(2009, Some("Field 'children' not found in enclosing type".to_string())); + + Ok(()) + } + + fn schema_m2m_child() -> String { + let schema = indoc! { + r#"model Test { + #id(id, Int, @id) + str1 String? + + #m2m(children, Child[], id, Int) + } + + model Child { + #id(id, Int, @id) + + #m2m(tests, Test[], id, Int) + + }"# + }; + + schema.to_owned() + } + + #[connector_test(schema(schema_m2m_child))] + async fn create_many_m2m_rel_read_fails(runner: Runner) -> TestResult<()> { + runner + .query_json(serde_json::json!({ + "modelName": "Test", + "action": "createManyAndReturn", + "query": { + "arguments": { "data": { "id": 1 } }, + "selection": { + "id": true, + "children": true + } + } + })) + .await? + .assert_failure(2009, Some("Field 'children' not found in enclosing type".to_string())); + + runner + .query_json(serde_json::json!({ + "modelName": "Child", + "action": "createManyAndReturn", + "query": { + "arguments": { "data": { "id": 1 } }, + "selection": { + "id": true, + "tests": true + } + } + })) + .await? + .assert_failure(2009, Some("Field 'tests' not found in enclosing type".to_string())); + + Ok(()) + } + + fn schema_self_rel_child() -> String { + let schema = indoc! { + r#"model Child { + #id(id, Int, @id) + + teacherId Int? + teacher Child? @relation("TeacherStudents", fields: [teacherId], references: [id]) + students Child[] @relation("TeacherStudents") + }"# + }; + + schema.to_owned() + } + + #[connector_test(schema(schema_self_rel_child))] + async fn create_many_self_rel_read_fails(runner: Runner) -> TestResult<()> { + runner + .query_json(serde_json::json!({ + "modelName": "Child", + "action": "createManyAndReturn", + "query": { + "arguments": { "data": { "id": 1 } }, + "selection": { + "id": true, + "students": true + } + } + })) + .await? + .assert_failure(2009, Some("Field 'students' not found in enclosing type".to_string())); + + Ok(()) + } + + fn schema_7() -> String { + let schema = indoc! { + r#"model Test { + req Int @id + req_default Int @default(dbgenerated("1")) + req_default_static Int @default(1) + opt Int? + opt_default Int? @default(dbgenerated("1")) + opt_default_static Int? @default(1) + }"# + }; + + schema.to_owned() + } + + #[connector_test(schema(schema_7))] + async fn create_many_by_shape(runner: Runner) -> TestResult<()> { + // Generated queries for SQLite: + // INSERT INTO `main`.`Test` (`opt`, `req`) VALUES (null, ?), (?, ?) params=[1,2,2] + // INSERT INTO `main`.`Test` (`opt_default`, `opt`, `req`) VALUES (?, null, ?), (?, ?, ?) params=[3,3,6,6,6] + // INSERT INTO `main`.`Test` (`req_default`, `opt_default`, `req`, `opt`) VALUES (?, ?, ?, null), (?, ?, ?, ?) params=[5,5,5,7,7,7,7] + // INSERT INTO `main`.`Test` (`req`, `req_default`, `opt`) VALUES (?, ?, ?) params=[4,4,4] + + let res = run_query_json!( + &runner, + r#"mutation { + createManyTestAndReturn( + data: [ + { req: 1 } + { opt: 2, req: 2 } + { opt_default: 3, req: 3 } + { req_default: 4, opt: 4, req: 4 } + { req_default: 5, opt_default: 5, req: 5 } + { opt: 6, opt_default: 6, req: 6 } + { req_default: 7, opt: 7, opt_default: 7, req: 7 } + ] + ) { + req req_default req_default_static + opt opt_default opt_default_static + } + }"#, + &["data", "createManyTestAndReturn"] + ); + + let mut items = match res { + serde_json::Value::Array(items) => items, + _ => panic!("Expected an array"), + }; + + // Order is not deterministic on SQLite + items.sort_by_key(|x| x["req"].as_i64().unwrap()); + + insta::assert_snapshot!( + serde_json::Value::Array(items).to_string(), + @r###"[{"req":1,"req_default":1,"req_default_static":1,"opt":null,"opt_default":1,"opt_default_static":1},{"req":2,"req_default":1,"req_default_static":1,"opt":2,"opt_default":1,"opt_default_static":1},{"req":3,"req_default":1,"req_default_static":1,"opt":null,"opt_default":3,"opt_default_static":1},{"req":4,"req_default":4,"req_default_static":1,"opt":4,"opt_default":1,"opt_default_static":1},{"req":5,"req_default":5,"req_default_static":1,"opt":null,"opt_default":5,"opt_default_static":1},{"req":6,"req_default":1,"req_default_static":1,"opt":6,"opt_default":6,"opt_default_static":1},{"req":7,"req_default":7,"req_default_static":1,"opt":7,"opt_default":7,"opt_default_static":1}]"### + ); + + Ok(()) + } + + #[connector_test(schema(schema_7), only(Sqlite))] + async fn create_many_by_shape_combinations(runner: Runner) -> TestResult<()> { + use itertools::Itertools; + + let mut id = 1; + + // Generates a powerset of all combinations of these fields + // In an attempt to ensure that we never generate invalid insert statements + // because of the grouping logic. + for sets in vec!["req_default", "opt", "opt_default"] + .into_iter() + .powerset() + .map(|mut set| { + set.extend_from_slice(&["req"]); + set + }) + .powerset() + { + let data = sets + .into_iter() + .map(|set| { + let res = set.into_iter().map(|field| format!("{field}: {id}")).join(", "); + + id += 1; + + format!("{{ {res} }}") + }) + .join(", "); + + run_query!( + &runner, + format!(r#"mutation {{ createManyTestAndReturn(data: [{data}]) {{ req }} }}"#) + ); + } + + Ok(()) + } + + // LibSQL & co are ignored because they don't support metrics + #[connector_test(schema(schema_7), only(Sqlite("3")))] + async fn create_many_by_shape_counter_1(runner: Runner) -> TestResult<()> { + use query_engine_metrics::PRISMA_DATASOURCE_QUERIES_TOTAL; + + // Generated queries: + // INSERT INTO `main`.`Test` (`opt`, `req`) VALUES (null, ?), (?, ?) params=[1,2,2] + // INSERT INTO `main`.`Test` (`opt_default`, `opt`, `req`) VALUES (?, null, ?), (?, ?, ?) params=[3,3,6,6,6] + // INSERT INTO `main`.`Test` (`req_default`, `opt_default`, `req`, `opt`) VALUES (?, ?, ?, null), (?, ?, ?, ?) params=[5,5,5,7,7,7,7] + // INSERT INTO `main`.`Test` (`req`, `req_default`, `opt`) VALUES (?, ?, ?) params=[4,4,4] + run_query!( + &runner, + r#"mutation { + createManyTestAndReturn( + data: [ + { req: 1 } + { opt: 2, req: 2 } + { opt_default: 3, req: 3 } + { req_default: 4, opt: 4, req: 4 } + { req_default: 5, opt_default: 5, req: 5 } + { opt: 6, opt_default: 6, req: 6 } + { req_default: 7, opt: 7, opt_default: 7, req: 7 } + ] + ) { + req + } + }"# + ); + + let json = runner.get_metrics().to_json(Default::default()); + let counter = metrics::get_counter(&json, PRISMA_DATASOURCE_QUERIES_TOTAL); + + match runner.max_bind_values() { + Some(x) if x > 18 => assert_eq!(counter, 6), // 4 queries in total (BEGIN/COMMIT are counted) + // Some queries are being split because of `QUERY_BATCH_SIZE` being set to `10` in dev. + Some(_) => assert_eq!(counter, 7), // 5 queries in total (BEGIN/COMMIT are counted) + _ => panic!("Expected max bind values to be set"), + } + + Ok(()) + } + + // LibSQL & co are ignored because they don't support metrics + #[connector_test(schema(schema_7), only(Sqlite("3")))] + async fn create_many_by_shape_counter_2(runner: Runner) -> TestResult<()> { + use query_engine_metrics::PRISMA_DATASOURCE_QUERIES_TOTAL; + + // Generated queries: + // INSERT INTO `main`.`Test` ( `opt_default_static`, `req_default_static`, `opt`, `req` ) VALUES (?, ?, null, ?), (?, ?, null, ?), (?, ?, null, ?) params=[1,1,1,2,1,2,1,3,3] + // INSERT INTO `main`.`Test` ( `opt_default_static`, `req_default_static`, `opt`, `req` ) VALUES (?, ?, ?, ?), (?, ?, ?, ?) params=[1,1,8,4,1,1,null,5] + // Note: Two queries are generated because QUERY_BATCH_SIZE is set to 10. In production, a single query would be generated for this example. + run_query!( + &runner, + r#"mutation { + createManyTestAndReturn( + data: [ + { req: 1 } + { req: 2, opt_default_static: 2 }, + { req: 3, req_default_static: 3 }, + { req: 4, opt: 8 }, + { req: 5, opt: null }, + ] + ) { + req + } + }"# + ); + + let json = runner.get_metrics().to_json(Default::default()); + let counter = metrics::get_counter(&json, PRISMA_DATASOURCE_QUERIES_TOTAL); + + match runner.max_bind_values() { + Some(x) if x >= 18 => assert_eq!(counter, 3), // 1 createMany queries (BEGIN/COMMIT are counted) + // Some queries are being split because of `QUERY_BATCH_SIZE` being set to `10` in dev. + Some(_) => assert_eq!(counter, 4), // 2 createMany queries (BEGIN/COMMIT are counted) + _ => panic!("Expected max bind values to be set"), + } + + Ok(()) + } + + // LibSQL & co are ignored because they don't support metrics + #[connector_test(schema(schema_7), only(Sqlite("3")))] + async fn create_many_by_shape_counter_3(runner: Runner) -> TestResult<()> { + use query_engine_metrics::PRISMA_DATASOURCE_QUERIES_TOTAL; + + // Generated queries: + // INSERT INTO `main`.`Test` ( `req_default_static`, `req`, `opt_default`, `opt_default_static` ) VALUES (?, ?, ?, ?) params=[1,6,3,1] + // INSERT INTO `main`.`Test` ( `opt`, `req`, `req_default_static`, `opt_default_static` ) VALUES (null, ?, ?, ?), (null, ?, ?, ?), (null, ?, ?, ?) params=[1,1,1,2,1,2,3,3,1] + // INSERT INTO `main`.`Test` ( `opt`, `req`, `req_default_static`, `opt_default_static` ) VALUES (?, ?, ?, ?), (?, ?, ?, ?) params=[8,4,1,1,null,5,1,1] + // Note: The first two queries are split because QUERY_BATCH_SIZE is set to 10. In production, only two queries would be generated for this example. + run_query!( + &runner, + r#"mutation { + createManyTestAndReturn( + data: [ + { req: 1 } + { req: 2, opt_default_static: 2 }, + { req: 3, req_default_static: 3 }, + { req: 4, opt: 8 }, + { req: 5, opt: null }, + { req: 6, opt_default: 3 }, + ] + ) { + req + } + }"# + ); + + let json = runner.get_metrics().to_json(Default::default()); + let counter = metrics::get_counter(&json, PRISMA_DATASOURCE_QUERIES_TOTAL); + + match runner.max_bind_values() { + Some(x) if x > 21 => assert_eq!(counter, 4), // 3 createMany queries in total (BEGIN/COMMIT are counted) + // Some queries are being split because of `QUERY_BATCH_SIZE` being set to `10` in dev. + Some(_) => assert_eq!(counter, 5), // 3 createMany queries in total (BEGIN/COMMIT are counted) + _ => panic!("Expected max bind values to be set"), + } + + Ok(()) + } +} + +#[test_suite( + schema(json_opt), + exclude(MySql(5.6)), + capabilities(Json, AdvancedJsonNullability, CreateMany, InsertReturning) +)] +mod json_create_many { + use query_engine_tests::{assert_error, run_query}; + + #[connector_test] + async fn create_many_json_adv(runner: Runner) -> TestResult<()> { + insta::assert_snapshot!( + run_query!(&runner, r#"mutation { + createManyTestModelAndReturn(data: [ + { id: 1, json: "{}" }, + { id: 2, json: JsonNull }, + { id: 3, json: DbNull }, + { id: 4 }, + ]) { + id json + } + }"#), + @r###"{"data":{"createManyTestModelAndReturn":[{"id":1,"json":"{}"},{"id":2,"json":"null"},{"id":3,"json":null},{"id":4,"json":null}]}}"### + ); + + insta::assert_snapshot!( + run_query!(&runner, r#"{ + findManyTestModel { + id + json + } + }"#), + @r###"{"data":{"findManyTestModel":[{"id":1,"json":"{}"},{"id":2,"json":"null"},{"id":3,"json":null},{"id":4,"json":null}]}}"### + ); + + Ok(()) + } + + #[connector_test] + async fn create_many_json_errors(runner: Runner) -> TestResult<()> { + assert_error!( + &runner, + r#"mutation { + createManyTestModelAndReturn(data: [ + { id: 1, json: AnyNull }, + ]) { + id json + } + }"#, + 2009, + "`AnyNull` is not a valid `NullableJsonNullValueInput`" + ); + + Ok(()) + } +} diff --git a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/mod.rs b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/mod.rs index 8abc1043f697..a34936908cf1 100644 --- a/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/mod.rs +++ b/query-engine/connector-test-kit-rs/query-engine-tests/tests/writes/top_level_mutations/mod.rs @@ -1,6 +1,7 @@ mod create; mod create_list; mod create_many; +mod create_many_and_return; mod default_value; mod delete; mod delete_many; diff --git a/query-engine/connector-test-kit-rs/query-tests-setup/src/runner/mod.rs b/query-engine/connector-test-kit-rs/query-tests-setup/src/runner/mod.rs index a5b376e4fb68..a8db6206d070 100644 --- a/query-engine/connector-test-kit-rs/query-tests-setup/src/runner/mod.rs +++ b/query-engine/connector-test-kit-rs/query-tests-setup/src/runner/mod.rs @@ -22,6 +22,7 @@ use request_handlers::{ use serde_json::json; use std::{ env, + fmt::Display, sync::{atomic::AtomicUsize, Arc}, }; @@ -349,11 +350,8 @@ impl Runner { Ok(result) } - pub async fn query_json(&self, query: T) -> TestResult - where - T: Into, - { - let query = query.into(); + pub async fn query_json(&self, query: impl Display) -> TestResult { + let query = query.to_string(); tracing::debug!("Querying: {}", query.clone().green()); @@ -364,6 +362,7 @@ impl Runner { RunnerExecutor::Builtin(e) => e, RunnerExecutor::External(external) => { let response = external.query(query, self.current_tx_id.as_ref()).await?; + return Ok(response); } }; diff --git a/query-engine/connectors/sql-query-connector/src/database/operations/write.rs b/query-engine/connectors/sql-query-connector/src/database/operations/write.rs index edea91d5aef7..487cf17aad6e 100644 --- a/query-engine/connectors/sql-query-connector/src/database/operations/write.rs +++ b/query-engine/connectors/sql-query-connector/src/database/operations/write.rs @@ -270,11 +270,14 @@ pub(crate) async fn create_records_returning( let meta = column_metadata::create(&field_names, &idents); let mut records = ManyRecords::new(field_names.clone()); let inserts = generate_insert_statements(model, args, skip_duplicates, Some(&selected_fields.into()), ctx); + for insert in inserts { let result_set = conn.query(insert.into()).await?; + for result_row in result_set { let sql_row = result_row.to_sql_row(&meta)?; let record = Record::from(sql_row); + records.push(record); } } diff --git a/query-engine/core/src/interpreter/query_interpreters/read.rs b/query-engine/core/src/interpreter/query_interpreters/read.rs index 8b279bfad0ec..7e194993b75c 100644 --- a/query-engine/core/src/interpreter/query_interpreters/read.rs +++ b/query-engine/core/src/interpreter/query_interpreters/read.rs @@ -137,6 +137,7 @@ fn read_many_by_queries( record_not_found() } else { let nested: Vec = process_nested(tx, query.nested, Some(&records)).await?; + Ok(RecordSelection { name: query.name, fields: query.selection_order, @@ -268,7 +269,7 @@ async fn aggregate( })) } -fn process_nested<'conn>( +pub(crate) fn process_nested<'conn>( tx: &'conn mut dyn ConnectionLike, nested: Vec, parent_result: Option<&'conn ManyRecords>, diff --git a/query-engine/core/src/interpreter/query_interpreters/write.rs b/query-engine/core/src/interpreter/query_interpreters/write.rs index ad50bbbae0c0..f896bfa5cfc4 100644 --- a/query-engine/core/src/interpreter/query_interpreters/write.rs +++ b/query-engine/core/src/interpreter/query_interpreters/write.rs @@ -72,11 +72,13 @@ async fn create_many( .create_records_returning(&q.model, q.args, q.skip_duplicates, selected_fields.fields, trace_id) .await?; + let nested: Vec = super::read::process_nested(tx, selected_fields.nested, Some(&records)).await?; + let selection = RecordSelection { name: q.name, fields: selected_fields.order, records, - nested: vec![], + nested, model: q.model, virtual_fields: vec![], }; @@ -84,6 +86,7 @@ async fn create_many( Ok(QueryResult::RecordSelection(Some(Box::new(selection)))) } else { let affected_records = tx.create_records(&q.model, q.args, q.skip_duplicates, trace_id).await?; + Ok(QueryResult::Count(affected_records)) } } @@ -108,6 +111,7 @@ async fn create_many_split_by_shape( if let Some(selected_fields) = q.selected_fields { let mut result: Option = None; + for args in args_by_shape.into_values() { let current_batch = tx .create_records_returning( @@ -137,11 +141,14 @@ async fn create_many_split_by_shape( .await? }; + let nested: Vec = + super::read::process_nested(tx, selected_fields.nested.clone(), Some(&records)).await?; + let selection = RecordSelection { name: q.name, fields: selected_fields.order, records, - nested: vec![], + nested, model: q.model, virtual_fields: vec![], }; @@ -149,12 +156,14 @@ async fn create_many_split_by_shape( Ok(QueryResult::RecordSelection(Some(Box::new(selection)))) } else { let mut result = 0; + for args in args_by_shape.into_values() { let affected_records = tx .create_records(&q.model, args, q.skip_duplicates, trace_id.clone()) .await?; result += affected_records; } + Ok(QueryResult::Count(result)) } } diff --git a/query-engine/core/src/query_ast/write.rs b/query-engine/core/src/query_ast/write.rs index 975a2be877bf..940b36cc57cf 100644 --- a/query-engine/core/src/query_ast/write.rs +++ b/query-engine/core/src/query_ast/write.rs @@ -1,6 +1,6 @@ //! Write query AST use super::{FilteredNestedMutation, FilteredQuery}; -use crate::{RecordQuery, ToGraphviz}; +use crate::{ReadQuery, RecordQuery, ToGraphviz}; use connector::{DatasourceFieldName, NativeUpsert, RecordFilter, WriteArgs}; use query_structure::{prelude::*, Filter}; use std::collections::HashMap; @@ -286,6 +286,7 @@ pub struct CreateManyRecords { pub struct CreateManyRecordsFields { pub fields: FieldSelection, pub order: Vec, + pub nested: Vec, } #[derive(Debug, Clone)] diff --git a/query-engine/core/src/query_graph_builder/builder.rs b/query-engine/core/src/query_graph_builder/builder.rs index 9e8392610969..8ba2929caccd 100644 --- a/query-engine/core/src/query_graph_builder/builder.rs +++ b/query-engine/core/src/query_graph_builder/builder.rs @@ -113,7 +113,8 @@ impl<'a> QueryGraphBuilder<'a> { (QueryTag::Aggregate, Some(m)) => read::aggregate(parsed_field, m).map(Into::into), (QueryTag::GroupBy, Some(m)) => read::group_by(parsed_field, m).map(Into::into), (QueryTag::CreateOne, Some(m)) => QueryGraph::root(|g| write::create_record(g, query_schema, m, parsed_field)), - (QueryTag::CreateMany, Some(m)) => QueryGraph::root(|g| write::create_many_records(g, query_schema,m, parsed_field)), + (QueryTag::CreateMany, Some(m)) => QueryGraph::root(|g| write::create_many_records(g, query_schema, m, false, parsed_field)), + (QueryTag::CreateManyAndReturn, Some(m)) => QueryGraph::root(|g| write::create_many_records(g, query_schema, m, true, parsed_field)), (QueryTag::UpdateOne, Some(m)) => QueryGraph::root(|g| write::update_record(g, query_schema, m, parsed_field)), (QueryTag::UpdateMany, Some(m)) => QueryGraph::root(|g| write::update_many_records(g, query_schema, m, parsed_field)), (QueryTag::UpsertOne, Some(m)) => QueryGraph::root(|g| write::upsert_record(g, query_schema, m, parsed_field)), diff --git a/query-engine/core/src/query_graph_builder/mod.rs b/query-engine/core/src/query_graph_builder/mod.rs index 641acd9be776..f9076a1b3a17 100644 --- a/query-engine/core/src/query_graph_builder/mod.rs +++ b/query-engine/core/src/query_graph_builder/mod.rs @@ -3,8 +3,8 @@ mod builder; mod error; mod extractors; -mod read; +pub(crate) mod read; pub(crate) mod write; pub(crate) use extractors::*; diff --git a/query-engine/core/src/query_graph_builder/read/one.rs b/query-engine/core/src/query_graph_builder/read/one.rs index fe188320cc01..53ab1a01d15e 100644 --- a/query-engine/core/src/query_graph_builder/read/one.rs +++ b/query-engine/core/src/query_graph_builder/read/one.rs @@ -44,11 +44,8 @@ fn find_unique_with_options( let name = field.name; let alias = field.alias; - let nested_fields = field.nested_fields.unwrap().fields; - let selection_order = utils::collect_selection_order(&nested_fields); - let selected_fields = utils::collect_selected_fields(&nested_fields, None, &model, query_schema)?; - let nested = utils::collect_nested_queries(nested_fields, &model, query_schema)?; - let selected_fields = utils::merge_relation_selections(selected_fields, None, &nested); + let (selected_fields, selection_order, nested) = + utils::extract_selected_fields(field.nested_fields.unwrap().fields, &model, query_schema)?; let relation_load_strategy = get_relation_load_strategy(requested_rel_load_strategy, None, &nested, query_schema)?; diff --git a/query-engine/core/src/query_graph_builder/read/utils.rs b/query-engine/core/src/query_graph_builder/read/utils.rs index cb444a0b29e9..7ebb9c349692 100644 --- a/query-engine/core/src/query_graph_builder/read/utils.rs +++ b/query-engine/core/src/query_graph_builder/read/utils.rs @@ -306,3 +306,16 @@ fn query_can_be_resolved_with_joins(cursor: Option<&SelectionResult>, nested_que _ => false, }) } + +pub(crate) fn extract_selected_fields( + nested_fields: Vec>, + model: &Model, + query_schema: &QuerySchema, +) -> crate::QueryGraphBuilderResult<(FieldSelection, Vec, Vec)> { + let selection_order = utils::collect_selection_order(&nested_fields); + let selected_fields = utils::collect_selected_fields(&nested_fields, None, model, query_schema)?; + let nested = utils::collect_nested_queries(nested_fields, model, query_schema)?; + let selected_fields = utils::merge_relation_selections(selected_fields, None, &nested); + + Ok((selected_fields, selection_order, nested)) +} diff --git a/query-engine/core/src/query_graph_builder/write/create.rs b/query-engine/core/src/query_graph_builder/write/create.rs index fe0e49a29370..86360291ead5 100644 --- a/query-engine/core/src/query_graph_builder/write/create.rs +++ b/query-engine/core/src/query_graph_builder/write/create.rs @@ -68,6 +68,7 @@ pub(crate) fn create_many_records( graph: &mut QueryGraph, query_schema: &QuerySchema, model: Model, + with_field_selection: bool, mut field: ParsedField<'_>, ) -> QueryGraphBuilderResult<()> { graph.flag_transactional(); @@ -93,16 +94,30 @@ pub(crate) fn create_many_records( }) .collect::>>()?; + let selected_fields = if with_field_selection { + let (selected_fields, selection_order, nested_read) = + super::read::utils::extract_selected_fields(field.nested_fields.unwrap().fields, &model, query_schema)?; + + Some(CreateManyRecordsFields { + fields: selected_fields, + order: selection_order, + nested: nested_read, + }) + } else { + None + }; + let query = CreateManyRecords { name: field.name, model, args, skip_duplicates, - selected_fields: None, + selected_fields, split_by_shape: !query_schema.has_capability(ConnectorCapability::SupportsDefaultInInsert), }; graph.create_node(Query::Write(WriteQuery::CreateManyRecords(query))); + Ok(()) } diff --git a/query-engine/core/src/query_graph_builder/write/nested/create_nested.rs b/query-engine/core/src/query_graph_builder/write/nested/create_nested.rs index c3d6196b61e5..72a299c472f6 100644 --- a/query-engine/core/src/query_graph_builder/write/nested/create_nested.rs +++ b/query-engine/core/src/query_graph_builder/write/nested/create_nested.rs @@ -65,6 +65,7 @@ pub fn nested_create( Some(CreateManyRecordsFields { fields: selected_fields, order: selection_order, + nested: Vec::new(), }) } else { None diff --git a/query-engine/dmmf/src/tests/test-schemas/snapshots/odoo.snapshot.json.gz b/query-engine/dmmf/src/tests/test-schemas/snapshots/odoo.snapshot.json.gz index b7bf316dffa8..5e907c26c660 100644 Binary files a/query-engine/dmmf/src/tests/test-schemas/snapshots/odoo.snapshot.json.gz and b/query-engine/dmmf/src/tests/test-schemas/snapshots/odoo.snapshot.json.gz differ diff --git a/query-engine/schema/src/build/mutations/create_many.rs b/query-engine/schema/src/build/mutations/create_many.rs index 9ef94df26240..083defb1b659 100644 --- a/query-engine/schema/src/build/mutations/create_many.rs +++ b/query-engine/schema/src/build/mutations/create_many.rs @@ -2,7 +2,7 @@ use super::*; use crate::{Identifier, IdentifierType, InputField, InputType, OutputField, OutputType, QueryInfo, QueryTag}; use constants::*; use input_types::{fields::data_input_mapper::*, list_union_type}; -use output_types::objects; +use output_types::{field, objects}; use psl::datamodel_connector::ConnectorCapability; use query_structure::{Model, RelationFieldRef}; @@ -22,6 +22,50 @@ pub(crate) fn create_many(ctx: &'_ QuerySchema, model: Model) -> OutputField<'_> ) } +/// Builds a create many mutation field (e.g. createManyUsers) for given model. +pub(crate) fn create_many_and_return(ctx: &'_ QuerySchema, model: Model) -> OutputField<'_> { + let field_name = format!("createMany{}AndReturn", model.name()); + let model_id = model.id; + let object_type = create_many_and_return_output_type(ctx, model.clone()); + + field( + field_name, + move || create_many_arguments(ctx, model), + OutputType::list(InnerOutputType::Object(object_type)), + Some(QueryInfo { + model: Some(model_id), + tag: QueryTag::CreateManyAndReturn, + }), + ) +} + +pub(crate) fn create_many_and_return_output_type(ctx: &'_ QuerySchema, model: Model) -> ObjectType<'_> { + let model_id = model.id; + let mut obj = ObjectType::new( + Identifier::new_model(IdentifierType::CreateManyAndReturnOutput(model.clone())), + move || { + let mut fields: Vec<_> = model + .fields() + .scalar() + .map(|sf| field::map_output_field(ctx, sf.into())) + .collect(); + + // If the relation is inlined in the enclosing model, that means the foreign keys can be set at creation + // and thus it makes sense to enable querying this relation. + for rf in model.fields().relation() { + if rf.is_inlined_on_enclosing_model() { + fields.push(field::map_output_field(ctx, rf.into())); + } + } + + fields + }, + ); + + obj.model = Some(model_id); + obj +} + /// Builds "skip_duplicates" and "data" arguments intended for the create many field. pub(crate) fn create_many_arguments(ctx: &'_ QuerySchema, model: Model) -> Vec> { let create_many_type = InputType::object(create_many_object_type(ctx, model, None)); diff --git a/query-engine/schema/src/build/mutations/mod.rs b/query-engine/schema/src/build/mutations/mod.rs index 10f19bcaf627..2756a3d375ae 100644 --- a/query-engine/schema/src/build/mutations/mod.rs +++ b/query-engine/schema/src/build/mutations/mod.rs @@ -1,7 +1,7 @@ pub(crate) mod create_many; pub(crate) mod create_one; -pub(crate) use create_many::create_many; +pub(crate) use create_many::{create_many, create_many_and_return}; pub(crate) use create_one::create_one; use super::*; diff --git a/query-engine/schema/src/build/output_types/mutation_type.rs b/query-engine/schema/src/build/output_types/mutation_type.rs index b0202360acb3..1a7eeed5fe17 100644 --- a/query-engine/schema/src/build/output_types/mutation_type.rs +++ b/query-engine/schema/src/build/output_types/mutation_type.rs @@ -1,6 +1,6 @@ use super::*; use input_types::fields::arguments; -use mutations::{create_many, create_one}; +use mutations::{create_many, create_many_and_return, create_one}; use psl::datamodel_connector::ConnectorCapability; use query_structure::{DefaultKind, PrismaValue}; @@ -20,8 +20,13 @@ pub(crate) fn mutation_fields(ctx: &QuerySchema) -> Vec { field!(create_one, model); field!(upsert_item_field, model); + if ctx.has_capability(ConnectorCapability::CreateMany) { field!(create_many, model); + + if ctx.has_capability(ConnectorCapability::InsertReturning) { + field!(create_many_and_return, model); + } } } diff --git a/query-engine/schema/src/build/output_types/query_type.rs b/query-engine/schema/src/build/output_types/query_type.rs index 75067ab29fda..f928133dc619 100644 --- a/query-engine/schema/src/build/output_types/query_type.rs +++ b/query-engine/schema/src/build/output_types/query_type.rs @@ -15,7 +15,7 @@ pub(crate) fn query_fields(ctx: &QuerySchema) -> Vec { for model in ctx.internal_data_model.models() { field!(find_first_field, model); field!(find_first_or_throw_field, model); - field!(all_items_field, model); + field!(find_many_field, model); field!(plain_aggregation_field, model); field!(group_by_aggregation_field, model); field!(find_unique_field, model); @@ -113,7 +113,7 @@ fn find_first_or_throw_field(ctx: &QuerySchema, model: Model) -> OutputField<'_> } /// Builds a "multiple" query arity items field (e.g. "users", "posts", ...) for given model. -fn all_items_field(ctx: &QuerySchema, model: Model) -> OutputField<'_> { +fn find_many_field(ctx: &QuerySchema, model: Model) -> OutputField<'_> { let field_name = format!("findMany{}", model.name()); let object_type = objects::model::model_object_type(ctx, model.clone()); let model_id = model.id; diff --git a/query-engine/schema/src/identifier_type.rs b/query-engine/schema/src/identifier_type.rs index edc7e0849a64..d4cf309a299f 100644 --- a/query-engine/schema/src/identifier_type.rs +++ b/query-engine/schema/src/identifier_type.rs @@ -22,6 +22,7 @@ pub enum IdentifierType { CompositeUpdateManyInput(CompositeType), CompositeUpsertObjectInput(CompositeType), CreateManyInput(Model, Option), + CreateManyAndReturnOutput(Model), CreateOneScalarList(ScalarField), Enum(InternalEnum), FieldUpdateOperationsInput(bool, String), @@ -296,6 +297,9 @@ impl std::fmt::Display for IdentifierType { Some(ref rf) => write!(f, "{}CreateMany{}Input", model.name(), capitalize(rf.name())), _ => write!(f, "{}CreateManyInput", model.name()), }, + IdentifierType::CreateManyAndReturnOutput(model) => { + write!(f, "CreateMany{}AndReturnOutputType", model.name()) + } IdentifierType::UncheckedUpdateManyInput(model, related_field) => match related_field { Some(rf) => write!( f, diff --git a/query-engine/schema/src/query_schema.rs b/query-engine/schema/src/query_schema.rs index ff25c17159fa..8bf7a2b2e99a 100644 --- a/query-engine/schema/src/query_schema.rs +++ b/query-engine/schema/src/query_schema.rs @@ -232,6 +232,7 @@ pub enum QueryTag { FindMany, CreateOne, CreateMany, + CreateManyAndReturn, UpdateOne, UpdateMany, DeleteOne, @@ -257,6 +258,7 @@ impl fmt::Display for QueryTag { Self::FindMany => "findMany", Self::CreateOne => "createOne", Self::CreateMany => "createMany", + Self::CreateManyAndReturn => "createManyAndReturn", Self::UpdateOne => "updateOne", Self::UpdateMany => "updateMany", Self::DeleteOne => "deleteOne", @@ -285,6 +287,7 @@ impl From<&str> for QueryTag { "findMany" => Self::FindMany, "createOne" => Self::CreateOne, "createMany" => Self::CreateMany, + "createManyAndReturn" => Self::CreateManyAndReturn, "updateOne" => Self::UpdateOne, "updateMany" => Self::UpdateMany, "deleteOne" => Self::DeleteOne,