From b2c29a05d272907402783d087bb8cdeed0ebfebe Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 7 Nov 2023 11:38:07 +0100 Subject: [PATCH 01/11] Changes to ts-client to support json type. --- .../typescript/src/cli/migrations/migrate.ts | 42 +++++- clients/typescript/src/cli/util/index.ts | 1 + clients/typescript/src/cli/util/io.ts | 15 +++ .../src/client/conversions/datatypes/json.ts | 32 +++++ .../src/client/conversions/sqlite.ts | 12 ++ .../src/client/conversions/types.ts | 2 + clients/typescript/src/satellite/client.ts | 17 +-- .../test/client/conversions/input.test.ts | 3 +- .../test/client/conversions/sqlite.test.ts | 80 +++++++++++- .../client/generated/client/index-browser.js | 12 ++ .../test/client/generated/client/index.d.ts | 113 +++++++++++++++- .../test/client/generated/client/index.js | 14 +- .../client/generated/client/schema.prisma | 1 + .../typescript/test/client/generated/index.ts | 122 +++++++++++++++++- .../test/client/model/datatype.test.ts | 74 ++++++++++- .../test/client/prisma/schema.prisma | 1 + 16 files changed, 511 insertions(+), 30 deletions(-) create mode 100644 clients/typescript/src/cli/util/index.ts create mode 100644 clients/typescript/src/cli/util/io.ts create mode 100644 clients/typescript/src/client/conversions/datatypes/json.ts diff --git a/clients/typescript/src/cli/migrations/migrate.ts b/clients/typescript/src/cli/migrations/migrate.ts index c7ed1d3351..534ea86178 100644 --- a/clients/typescript/src/cli/migrations/migrate.ts +++ b/clients/typescript/src/cli/migrations/migrate.ts @@ -8,6 +8,7 @@ import decompress from 'decompress' import { buildMigrations, getMigrationNames } from './builder' import { exec } from 'child_process' import { dedent } from 'ts-dedent' +import { findAndReplaceInFile } from '../util' const appRoot = path.resolve() // path where the user ran `npx electric migrate` @@ -182,6 +183,12 @@ async function _generate(opts: Omit) { console.log('Generating Electric client...') await generateElectricClient(prismaSchema) const relativePath = path.relative(appRoot, opts.out) + // Modify the type of JSON input values in the generated Prisma client + // because we deviate from Prisma's typing for JSON values + const outDir = opts.out + await extendJsonType(outDir) + // Delete all files generated for the Prisma client, except the typings + await keepOnlyPrismaTypings(outDir) console.log(`Successfully generated Electric client at: ./${relativePath}`) // Build the migrations @@ -214,16 +221,17 @@ async function createPrismaSchema( ) const output = path.resolve(out) const schema = dedent` - generator client { - provider = "prisma-client-js" - } - generator electric { provider = "${provider}" output = "${output}" relationModel = "false" } + generator client { + provider = "prisma-client-js" + output = "${output}" + } + datasource db { provider = "postgresql" url = "${proxy}" @@ -561,3 +569,29 @@ function parseAttributes(attributes: string): Array { } }) } + +/* + * Modifies Prisma's `InputJsonValue` type to include `null` + */ +function extendJsonType(prismaDir: string): Promise { + const prismaTypings = path.join(prismaDir, 'index.d.ts') + const inputJsonValueRegex = /^\s*export\s*type\s*InputJsonValue\s*(=)\s*/gm + const replacement = 'export type InputJsonValue = null | ' + return findAndReplaceInFile(inputJsonValueRegex, replacement, prismaTypings) +} + +async function keepOnlyPrismaTypings(prismaDir: string): Promise { + const contents = await fs.readdir(prismaDir) + // Delete all files except the generated Electric client and the Prisma typings + const proms = contents.map(async (fileOrDir) => { + const filePath = path.join(prismaDir, fileOrDir) + if (fileOrDir === 'index.d.ts') { + // rename this file to `prismaClient.d.ts` + return fs.rename(filePath, path.join(prismaDir, 'prismaClient.d.ts')) + } else if (fileOrDir !== 'index.ts') { + // delete the file or folder + return fs.rm(filePath, { recursive: true }) + } + }) + await Promise.all(proms) +} diff --git a/clients/typescript/src/cli/util/index.ts b/clients/typescript/src/cli/util/index.ts new file mode 100644 index 0000000000..6fc6005874 --- /dev/null +++ b/clients/typescript/src/cli/util/index.ts @@ -0,0 +1 @@ +export * from './io' diff --git a/clients/typescript/src/cli/util/io.ts b/clients/typescript/src/cli/util/io.ts new file mode 100644 index 0000000000..31ef602f64 --- /dev/null +++ b/clients/typescript/src/cli/util/io.ts @@ -0,0 +1,15 @@ +import { readFile, writeFile } from 'fs/promises' + +/* + * Replaces the first occurence of `find` by `replace` in the file `file`. + * If `find` is a regular expression that sets the `g` flag, then it replaces all occurences. + */ +export async function findAndReplaceInFile( + find: string | RegExp, + replace: string, + file: string +) { + const content = await readFile(file, 'utf8') + const replacedContent = content.replace(find, replace) + await writeFile(file, replacedContent) +} diff --git a/clients/typescript/src/client/conversions/datatypes/json.ts b/clients/typescript/src/client/conversions/datatypes/json.ts new file mode 100644 index 0000000000..598bc1c6f0 --- /dev/null +++ b/clients/typescript/src/client/conversions/datatypes/json.ts @@ -0,0 +1,32 @@ +// not the most precise JSON type +// but good enough for serialising/deserialising +type JSON = string | number | boolean | Array | Record + +export function serialiseJSON(v: JSON): string { + if (isJsonNull(v)) { + // user provided the special Prisma.JsonNull value + // to indicate a JSON null value rather than a DB NULL + return JSON.stringify(null) + } + return JSON.stringify(v) +} + +export function deserialiseJSON(v: string): JSON { + if (v === JSON.stringify(null)) return { __is_electric_json_null__: true } + return JSON.parse(v) +} + +function isJsonNull(v: JSON): boolean { + return ( + typeof v === 'object' && + !Array.isArray(v) && + v !== null && + Object.hasOwn(v, '__is_electric_json_null__') && + v['__is_electric_json_null__'] + ) +} + +// TODO: do not use prisma's json null value +// but define our own +// and modify the generator to accept ours +// then we no longer have to pass it all the way through until here diff --git a/clients/typescript/src/client/conversions/sqlite.ts b/clients/typescript/src/client/conversions/sqlite.ts index 5591585198..3ef8bd1a3a 100644 --- a/clients/typescript/src/client/conversions/sqlite.ts +++ b/clients/typescript/src/client/conversions/sqlite.ts @@ -1,6 +1,7 @@ import { InvalidArgumentError } from '../validation/errors/invalidArgumentError' import { deserialiseBoolean, serialiseBoolean } from './datatypes/boolean' import { deserialiseDate, serialiseDate } from './datatypes/date' +import { deserialiseJSON, serialiseJSON } from './datatypes/json' import { PgBasicType, PgDateType, PgType } from './types' /** @@ -29,6 +30,11 @@ export function toSqlite(v: any, pgType: PgType): any { // and deserialise it back to `NaN` when reading from the DB. // cf. https://github.com/WiseLibs/better-sqlite3/issues/1088 return 'NaN' + } else if ( + pgType === PgBasicType.PG_JSON || + pgType === PgBasicType.PG_JSONB + ) { + return serialiseJSON(v) } else { return v } @@ -50,6 +56,12 @@ export function fromSqlite(v: any, pgType: PgType): any { ) { // it's a serialised NaN return NaN + } else if ( + pgType === PgBasicType.PG_JSON || + pgType === PgBasicType.PG_JSONB + ) { + // it's serialised JSON + return deserialiseJSON(v) } else { return v } diff --git a/clients/typescript/src/client/conversions/types.ts b/clients/typescript/src/client/conversions/types.ts index fe21577aee..ed448fc229 100644 --- a/clients/typescript/src/client/conversions/types.ts +++ b/clients/typescript/src/client/conversions/types.ts @@ -12,6 +12,8 @@ export enum PgBasicType { PG_VARCHAR = 'VARCHAR', PG_CHAR = 'CHAR', PG_UUID = 'UUID', + PG_JSON = 'JSON', + PG_JSONB = 'JSONB', } /** diff --git a/clients/typescript/src/satellite/client.ts b/clients/typescript/src/satellite/client.ts index f9c43ba6ad..e1fadc8133 100644 --- a/clients/typescript/src/satellite/client.ts +++ b/clients/typescript/src/satellite/client.ts @@ -1128,15 +1128,6 @@ function deserializeColumnData( columnType: PgType ): string | number { switch (columnType) { - case PgBasicType.PG_CHAR: - case PgDateType.PG_DATE: - case PgBasicType.PG_TEXT: - case PgDateType.PG_TIME: - case PgDateType.PG_TIMESTAMP: - case PgDateType.PG_TIMESTAMPTZ: - case PgBasicType.PG_UUID: - case PgBasicType.PG_VARCHAR: - return typeDecoder.text(column) case PgBasicType.PG_BOOL: return typeDecoder.bool(column) case PgBasicType.PG_INT: @@ -1152,17 +1143,13 @@ function deserializeColumnData( case PgDateType.PG_TIMETZ: return typeDecoder.timetz(column) default: - // should not occur - throw new SatelliteError( - SatelliteErrorCode.UNKNOWN_DATA_TYPE, - `can't deserialize ${columnType}` - ) + return typeDecoder.text(column) } } // All values serialized as textual representation function serializeColumnData( - columnValue: string | number, + columnValue: string | number | object, columnType: PgType ): Uint8Array { switch (columnType) { diff --git a/clients/typescript/test/client/conversions/input.test.ts b/clients/typescript/test/client/conversions/input.test.ts index 37fea48b72..18d6cd481b 100644 --- a/clients/typescript/test/client/conversions/input.test.ts +++ b/clients/typescript/test/client/conversions/input.test.ts @@ -31,7 +31,7 @@ await tbl.sync() function setupDB() { db.exec('DROP TABLE IF EXISTS DataTypes') db.exec( - "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'relatedId' int);" + "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'json' varchar, 'relatedId' int);" ) db.exec('DROP TABLE IF EXISTS Dummy') @@ -234,6 +234,7 @@ const dateNulls = { int4: null, float8: null, uuid: null, + json: null, } const nulls = { diff --git a/clients/typescript/test/client/conversions/sqlite.test.ts b/clients/typescript/test/client/conversions/sqlite.test.ts index 148fc9f538..b7a580f852 100644 --- a/clients/typescript/test/client/conversions/sqlite.test.ts +++ b/clients/typescript/test/client/conversions/sqlite.test.ts @@ -8,7 +8,7 @@ import { _NOT_UNIQUE_, _RECORD_NOT_FOUND_, } from '../../../src/client/validation/errors/messages' -import { schema } from '../generated' +import { schema, JsonNull } from '../generated' const db = new Database(':memory:') const electric = await electrify( @@ -30,7 +30,7 @@ await tbl.sync() function setupDB() { db.exec('DROP TABLE IF EXISTS DataTypes') db.exec( - "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'relatedId' int);" + "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'json' varchar, 'relatedId' int);" ) } @@ -211,3 +211,79 @@ test.serial('floats are converted correctly to SQLite', async (t) => { { id: 4, float8: -Infinity }, ]) }) + +test.serial('json is converted correctly to SQLite', async (t) => { + const json = { a: 1, b: true, c: { d: 'nested' }, e: [1, 2, 3], f: null } + await tbl.create({ + data: { + id: 1, + json, + }, + }) + + const rawRes = await electric.db.raw({ + sql: 'SELECT json FROM DataTypes WHERE id = ?', + args: [1], + }) + t.is(rawRes[0].json, JSON.stringify(json)) + + // Also test null values + // this null value is not a JSON null + // but a DB NULL that indicates absence of a value + await tbl.create({ + data: { + id: 2, + json: null, // TODO: fix this type error --> update the typings in the generator + }, + }) + + const rawRes2 = await electric.db.raw({ + sql: 'SELECT json FROM DataTypes WHERE id = ?', + args: [2], + }) + t.is(rawRes2[0].json, null) + + // Also test JSON null value + await tbl.create({ + data: { + id: 3, + json: JsonNull, + }, + }) + + const rawRes3 = await electric.db.raw({ + sql: 'SELECT json FROM DataTypes WHERE id = ?', + args: [3], + }) + t.is(rawRes3[0].json, JSON.stringify(null)) + + // also test regular values + await tbl.create({ + data: { + id: 4, + json: 'foo', + }, + }) + + const rawRes4 = await electric.db.raw({ + sql: 'SELECT json FROM DataTypes WHERE id = ?', + args: [4], + }) + + t.is(rawRes4[0].json, JSON.stringify('foo')) + + // also test arrays + await tbl.create({ + data: { + id: 5, + json: [1, 2, 3], + }, + }) + + const rawRes5 = await electric.db.raw({ + sql: 'SELECT json FROM DataTypes WHERE id = ?', + args: [5], + }) + + t.is(rawRes5[0].json, JSON.stringify([1, 2, 3])) +}) diff --git a/clients/typescript/test/client/generated/client/index-browser.js b/clients/typescript/test/client/generated/client/index-browser.js index 37ad89e8bf..b971edb889 100644 --- a/clients/typescript/test/client/generated/client/index-browser.js +++ b/clients/typescript/test/client/generated/client/index-browser.js @@ -98,6 +98,7 @@ exports.Prisma.DataTypesScalarFieldEnum = { int2: 'int2', int4: 'int4', float8: 'float8', + json: 'json', relatedId: 'relatedId' }; @@ -111,6 +112,17 @@ exports.Prisma.ItemsScalarFieldEnum = { nbr: 'nbr' }; +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + exports.Prisma.PostScalarFieldEnum = { id: 'id', title: 'title', diff --git a/clients/typescript/test/client/generated/client/index.d.ts b/clients/typescript/test/client/generated/client/index.d.ts index 1adde93497..5005a3e38a 100644 --- a/clients/typescript/test/client/generated/client/index.d.ts +++ b/clients/typescript/test/client/generated/client/index.d.ts @@ -80,6 +80,7 @@ export type DataTypes = { * @zod.custom.use(z.number().or(z.nan())) */ float8: number | null + json: Prisma.JsonValue | null relatedId: number | null } @@ -369,7 +370,7 @@ export namespace Prisma { * * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values */ - export type InputJsonValue = string | number | boolean | InputJsonObject | InputJsonArray + export type InputJsonValue = null | string | number | boolean | InputJsonObject | InputJsonArray /** * Types of the values used to represent different kinds of `null` values when working with JSON fields. @@ -4855,6 +4856,7 @@ export namespace Prisma { int2: number int4: number float8: number + json: number relatedId: number _all: number } @@ -4918,6 +4920,7 @@ export namespace Prisma { int2?: true int4?: true float8?: true + json?: true relatedId?: true _all?: true } @@ -5021,6 +5024,7 @@ export namespace Prisma { int2: number | null int4: number | null float8: number | null + json: JsonValue | null relatedId: number | null _count: DataTypesCountAggregateOutputType | null _avg: DataTypesAvgAggregateOutputType | null @@ -5055,6 +5059,7 @@ export namespace Prisma { int2?: boolean int4?: boolean float8?: boolean + json?: boolean relatedId?: boolean related?: boolean | DummyArgs } @@ -6803,6 +6808,7 @@ export namespace Prisma { int2: 'int2', int4: 'int4', float8: 'float8', + json: 'json', relatedId: 'relatedId' }; @@ -6825,6 +6831,23 @@ export namespace Prisma { export type ItemsScalarFieldEnum = (typeof ItemsScalarFieldEnum)[keyof typeof ItemsScalarFieldEnum] + export const JsonNullValueFilter: { + DbNull: typeof DbNull, + JsonNull: typeof JsonNull, + AnyNull: typeof AnyNull + }; + + export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter] + + + export const NullableJsonNullValueInput: { + DbNull: typeof DbNull, + JsonNull: typeof JsonNull + }; + + export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] + + export const PostScalarFieldEnum: { id: 'id', title: 'title', @@ -7065,6 +7088,7 @@ export namespace Prisma { int2?: IntNullableFilter | number | null int4?: IntNullableFilter | number | null float8?: FloatNullableFilter | number | null + json?: JsonNullableFilter relatedId?: IntNullableFilter | number | null related?: XOR | null } @@ -7081,6 +7105,7 @@ export namespace Prisma { int2?: SortOrder int4?: SortOrder float8?: SortOrder + json?: SortOrder relatedId?: SortOrder related?: DummyOrderByWithRelationInput } @@ -7102,6 +7127,7 @@ export namespace Prisma { int2?: SortOrder int4?: SortOrder float8?: SortOrder + json?: SortOrder relatedId?: SortOrder _count?: DataTypesCountOrderByAggregateInput _avg?: DataTypesAvgOrderByAggregateInput @@ -7125,6 +7151,7 @@ export namespace Prisma { int2?: IntNullableWithAggregatesFilter | number | null int4?: IntNullableWithAggregatesFilter | number | null float8?: FloatNullableWithAggregatesFilter | number | null + json?: JsonNullableWithAggregatesFilter relatedId?: IntNullableWithAggregatesFilter | number | null } @@ -7351,6 +7378,7 @@ export namespace Prisma { int2?: number | null int4?: number | null float8?: number | null + json?: NullableJsonNullValueInput | InputJsonValue related?: DummyCreateNestedOneWithoutDatatypeInput } @@ -7366,6 +7394,7 @@ export namespace Prisma { int2?: number | null int4?: number | null float8?: number | null + json?: NullableJsonNullValueInput | InputJsonValue relatedId?: number | null } @@ -7381,6 +7410,7 @@ export namespace Prisma { int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null + json?: NullableJsonNullValueInput | InputJsonValue related?: DummyUpdateOneWithoutDatatypeNestedInput } @@ -7396,6 +7426,7 @@ export namespace Prisma { int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null + json?: NullableJsonNullValueInput | InputJsonValue relatedId?: NullableIntFieldUpdateOperationsInput | number | null } @@ -7411,6 +7442,7 @@ export namespace Prisma { int2?: number | null int4?: number | null float8?: number | null + json?: NullableJsonNullValueInput | InputJsonValue relatedId?: number | null } @@ -7426,6 +7458,7 @@ export namespace Prisma { int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null + json?: NullableJsonNullValueInput | InputJsonValue } export type DataTypesUncheckedUpdateManyInput = { @@ -7440,6 +7473,7 @@ export namespace Prisma { int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null + json?: NullableJsonNullValueInput | InputJsonValue relatedId?: NullableIntFieldUpdateOperationsInput | number | null } @@ -7770,6 +7804,28 @@ export namespace Prisma { gte?: number not?: NestedFloatNullableFilter | number | null } + export type JsonNullableFilter = + | PatchUndefined< + Either, Exclude, 'path'>>, + Required + > + | OptionalFlat, 'path'>> + + export type JsonNullableFilterBase = { + equals?: InputJsonValue | JsonNullValueFilter + path?: string[] + string_contains?: string + string_starts_with?: string + string_ends_with?: string + array_contains?: InputJsonValue | null + array_starts_with?: InputJsonValue | null + array_ends_with?: InputJsonValue | null + lt?: InputJsonValue + lte?: InputJsonValue + gt?: InputJsonValue + gte?: InputJsonValue + not?: InputJsonValue | JsonNullValueFilter + } export type DummyRelationFilter = { is?: DummyWhereInput | null @@ -7788,6 +7844,7 @@ export namespace Prisma { int2?: SortOrder int4?: SortOrder float8?: SortOrder + json?: SortOrder relatedId?: SortOrder } @@ -7889,6 +7946,31 @@ export namespace Prisma { _min?: NestedFloatNullableFilter _max?: NestedFloatNullableFilter } + export type JsonNullableWithAggregatesFilter = + | PatchUndefined< + Either, Exclude, 'path'>>, + Required + > + | OptionalFlat, 'path'>> + + export type JsonNullableWithAggregatesFilterBase = { + equals?: InputJsonValue | JsonNullValueFilter + path?: string[] + string_contains?: string + string_starts_with?: string + string_ends_with?: string + array_contains?: InputJsonValue | null + array_starts_with?: InputJsonValue | null + array_ends_with?: InputJsonValue | null + lt?: InputJsonValue + lte?: InputJsonValue + gt?: InputJsonValue + gte?: InputJsonValue + not?: InputJsonValue | JsonNullValueFilter + _count?: NestedIntNullableFilter + _min?: NestedJsonNullableFilter + _max?: NestedJsonNullableFilter + } export type DataTypesListRelationFilter = { every?: DataTypesWhereInput @@ -8343,6 +8425,28 @@ export namespace Prisma { _min?: NestedFloatNullableFilter _max?: NestedFloatNullableFilter } + export type NestedJsonNullableFilter = + | PatchUndefined< + Either, Exclude, 'path'>>, + Required + > + | OptionalFlat, 'path'>> + + export type NestedJsonNullableFilterBase = { + equals?: InputJsonValue | JsonNullValueFilter + path?: string[] + string_contains?: string + string_starts_with?: string + string_ends_with?: string + array_contains?: InputJsonValue | null + array_starts_with?: InputJsonValue | null + array_ends_with?: InputJsonValue | null + lt?: InputJsonValue + lte?: InputJsonValue + gt?: InputJsonValue + gte?: InputJsonValue + not?: InputJsonValue | JsonNullValueFilter + } export type PostCreateWithoutAuthorInput = { id: number @@ -8535,6 +8639,7 @@ export namespace Prisma { int2?: number | null int4?: number | null float8?: number | null + json?: NullableJsonNullValueInput | InputJsonValue } export type DataTypesUncheckedCreateWithoutRelatedInput = { @@ -8549,6 +8654,7 @@ export namespace Prisma { int2?: number | null int4?: number | null float8?: number | null + json?: NullableJsonNullValueInput | InputJsonValue } export type DataTypesCreateOrConnectWithoutRelatedInput = { @@ -8592,6 +8698,7 @@ export namespace Prisma { int2?: IntNullableFilter | number | null int4?: IntNullableFilter | number | null float8?: FloatNullableFilter | number | null + json?: JsonNullableFilter relatedId?: IntNullableFilter | number | null } @@ -8635,6 +8742,7 @@ export namespace Prisma { int2?: number | null int4?: number | null float8?: number | null + json?: NullableJsonNullValueInput | InputJsonValue } export type DataTypesUpdateWithoutRelatedInput = { @@ -8649,6 +8757,7 @@ export namespace Prisma { int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null + json?: NullableJsonNullValueInput | InputJsonValue } export type DataTypesUncheckedUpdateWithoutRelatedInput = { @@ -8663,6 +8772,7 @@ export namespace Prisma { int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null + json?: NullableJsonNullValueInput | InputJsonValue } export type DataTypesUncheckedUpdateManyWithoutDatatypeInput = { @@ -8677,6 +8787,7 @@ export namespace Prisma { int2?: NullableIntFieldUpdateOperationsInput | number | null int4?: NullableIntFieldUpdateOperationsInput | number | null float8?: NullableFloatFieldUpdateOperationsInput | number | null + json?: NullableJsonNullValueInput | InputJsonValue } diff --git a/clients/typescript/test/client/generated/client/index.js b/clients/typescript/test/client/generated/client/index.js index 5cc7d184e0..5e71db5f71 100644 --- a/clients/typescript/test/client/generated/client/index.js +++ b/clients/typescript/test/client/generated/client/index.js @@ -87,6 +87,7 @@ exports.Prisma.DataTypesScalarFieldEnum = { int2: 'int2', int4: 'int4', float8: 'float8', + json: 'json', relatedId: 'relatedId' }; @@ -100,6 +101,17 @@ exports.Prisma.ItemsScalarFieldEnum = { nbr: 'nbr' }; +exports.Prisma.JsonNullValueFilter = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull, + AnyNull: Prisma.AnyNull +}; + +exports.Prisma.NullableJsonNullValueInput = { + DbNull: Prisma.DbNull, + JsonNull: Prisma.JsonNull +}; + exports.Prisma.PostScalarFieldEnum = { id: 'id', title: 'title', @@ -194,7 +206,7 @@ if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) { config.isBundled = true } -config.runtimeDataModel = JSON.parse("{\"models\":{\"Items\":{\"dbName\":null,\"fields\":[{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nbr\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"posts\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Post\",\"relationName\":\"PostToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"profile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Profile\",\"relationName\":\"ProfileToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Post\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"contents\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nbr\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"authorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"author\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"PostToUser\",\"relationFromFields\":[\"authorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Profile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bio\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"ProfileToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"DataTypes\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"date\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"time\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timetz\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamptz\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bool\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uuid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.string.uuid()\"},{\"name\":\"int2\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.number.int().gte(-32768).lte(32767)\"},{\"name\":\"int4\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.number.int().gte(-2147483648).lte(2147483647)\"},{\"name\":\"float8\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Float\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.custom.use(z.number().or(z.nan()))\"},{\"name\":\"relatedId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"related\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Dummy\",\"relationName\":\"DataTypesToDummy\",\"relationFromFields\":[\"relatedId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Dummy\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"datatype\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DataTypes\",\"relationName\":\"DataTypesToDummy\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"Items\":{\"dbName\":null,\"fields\":[{\"name\":\"value\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nbr\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"User\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"name\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"posts\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Post\",\"relationName\":\"PostToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"profile\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Profile\",\"relationName\":\"ProfileToUser\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Post\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"title\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"contents\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"nbr\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"authorId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"author\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"PostToUser\",\"relationFromFields\":[\"authorId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Profile\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bio\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"userId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":true,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"User\",\"relationName\":\"ProfileToUser\",\"relationFromFields\":[\"userId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"DataTypes\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"date\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"time\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timetz\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":true,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamptz\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"bool\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Boolean\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"uuid\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.string.uuid()\"},{\"name\":\"int2\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.number.int().gte(-32768).lte(32767)\"},{\"name\":\"int4\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.number.int().gte(-2147483648).lte(2147483647)\"},{\"name\":\"float8\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Float\",\"isGenerated\":false,\"isUpdatedAt\":false,\"documentation\":\"@zod.custom.use(z.number().or(z.nan()))\"},{\"name\":\"json\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Json\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"relatedId\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":true,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"related\",\"kind\":\"object\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Dummy\",\"relationName\":\"DataTypesToDummy\",\"relationFromFields\":[\"relatedId\"],\"relationToFields\":[\"id\"],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"Dummy\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"Int\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"timestamp\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DateTime\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"datatype\",\"kind\":\"object\",\"isList\":true,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"DataTypes\",\"relationName\":\"DataTypesToDummy\",\"relationFromFields\":[],\"relationToFields\":[],\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}") defineDmmfProperty(exports.Prisma, config.runtimeDataModel) diff --git a/clients/typescript/test/client/generated/client/schema.prisma b/clients/typescript/test/client/generated/client/schema.prisma index 89de6330c0..9ade8cd1bc 100644 --- a/clients/typescript/test/client/generated/client/schema.prisma +++ b/clients/typescript/test/client/generated/client/schema.prisma @@ -55,6 +55,7 @@ model DataTypes { int2 Int? @db.SmallInt /// @zod.number.int().gte(-32768).lte(32767) int4 Int? /// @zod.number.int().gte(-2147483648).lte(2147483647) float8 Float? @db.DoublePrecision /// @zod.custom.use(z.number().or(z.nan())) + json Json? relatedId Int? related Dummy? @relation(fields: [relatedId], references: [id]) } diff --git a/clients/typescript/test/client/generated/index.ts b/clients/typescript/test/client/generated/index.ts index 71a8df2eb4..4bfaf9a3f6 100644 --- a/clients/typescript/test/client/generated/index.ts +++ b/clients/typescript/test/client/generated/index.ts @@ -12,17 +12,54 @@ import { // HELPER FUNCTIONS ///////////////////////////////////////// +// JSON +//------------------------------------------------------ + +export type NullableJsonInput = Prisma.JsonValue | null | Prisma.NullTypes.JsonNull; + + +export const JsonValue: z.ZodType = z.union([ + z.null(), + z.string(), + z.number(), + z.boolean(), + z.lazy(() => z.array(JsonValue)), + z.lazy(() => z.record(JsonValue)), +]); + +export type JsonValueType = z.infer; + +export const NullableJsonValue = JsonValue + .nullable(); + +export type NullableJsonValueType = z.infer; + +export const InputJsonValue: z.ZodType = z.union([ + z.null(), + z.string(), + z.number(), + z.boolean(), + z.lazy(() => z.array(InputJsonValue.nullable())), + z.lazy(() => z.record(InputJsonValue.nullable())), +]); + +export type InputJsonValueType = z.infer; + ///////////////////////////////////////// // ENUMS ///////////////////////////////////////// -export const DataTypesScalarFieldEnumSchema = z.enum(['id','date','time','timetz','timestamp','timestamptz','bool','uuid','int2','int4','float8','relatedId']); +export const DataTypesScalarFieldEnumSchema = z.enum(['id','date','time','timetz','timestamp','timestamptz','bool','uuid','int2','int4','float8','json','relatedId']); export const DummyScalarFieldEnumSchema = z.enum(['id','timestamp']); export const ItemsScalarFieldEnumSchema = z.enum(['value','nbr']); +export const JsonNullValueFilterSchema = z.enum(['DbNull','JsonNull','AnyNull',]); + +export const NullableJsonNullValueInputSchema = z.enum(['DbNull','JsonNull',]) + export const PostScalarFieldEnumSchema = z.enum(['id','title','contents','nbr','authorId']); export const ProfileScalarFieldEnumSchema = z.enum(['id','bio','userId']); @@ -102,6 +139,7 @@ export const DataTypesSchema = z.object({ int2: z.number().int().gte(-32768).lte(32767).nullish(), int4: z.number().int().gte(-2147483648).lte(2147483647).nullish(), float8: z.number().or(z.nan()).nullish(), + json: NullableJsonValue.optional(), relatedId: z.number().int().nullish(), }) @@ -224,6 +262,7 @@ export const DataTypesSelectSchema: z.ZodType = z.object int2: z.boolean().optional(), int4: z.boolean().optional(), float8: z.boolean().optional(), + json: z.boolean().optional(), relatedId: z.boolean().optional(), related: z.union([z.boolean(),z.lazy(() => DummyArgsSchema)]).optional(), }).strict() @@ -442,6 +481,7 @@ export const DataTypesWhereInputSchema: z.ZodType = int2: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), int4: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), float8: z.union([ z.lazy(() => FloatNullableFilterSchema),z.number() ]).optional().nullable(), + json: z.lazy(() => JsonNullableFilterSchema).optional(), relatedId: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), related: z.union([ z.lazy(() => DummyRelationFilterSchema),z.lazy(() => DummyWhereInputSchema) ]).optional().nullable(), }).strict(); @@ -458,6 +498,7 @@ export const DataTypesOrderByWithRelationInputSchema: z.ZodType SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), + json: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional(), related: z.lazy(() => DummyOrderByWithRelationInputSchema).optional() }).strict(); @@ -479,6 +520,7 @@ export const DataTypesOrderByWithAggregationInputSchema: z.ZodType SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), + json: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional(), _count: z.lazy(() => DataTypesCountOrderByAggregateInputSchema).optional(), _avg: z.lazy(() => DataTypesAvgOrderByAggregateInputSchema).optional(), @@ -502,6 +544,7 @@ export const DataTypesScalarWhereWithAggregatesInputSchema: z.ZodType IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), int4: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), float8: z.union([ z.lazy(() => FloatNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), + json: z.lazy(() => JsonNullableWithAggregatesFilterSchema).optional(), relatedId: z.union([ z.lazy(() => IntNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), }).strict(); @@ -728,6 +771,7 @@ export const DataTypesCreateInputSchema: z.ZodType int2: z.number().int().gte(-32768).lte(32767).optional().nullable(), int4: z.number().int().gte(-2147483648).lte(2147483647).optional().nullable(), float8: z.number().or(z.nan()).optional().nullable(), + json: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), related: z.lazy(() => DummyCreateNestedOneWithoutDatatypeInputSchema).optional() }).strict(); @@ -743,6 +787,7 @@ export const DataTypesUncheckedCreateInputSchema: z.ZodType NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), relatedId: z.number().int().optional().nullable() }).strict(); @@ -758,6 +803,7 @@ export const DataTypesUpdateInputSchema: z.ZodType int2: z.union([ z.number().int().gte(-32768).lte(32767),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), + json: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), related: z.lazy(() => DummyUpdateOneWithoutDatatypeNestedInputSchema).optional() }).strict(); @@ -773,6 +819,7 @@ export const DataTypesUncheckedUpdateInputSchema: z.ZodType NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), + json: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), relatedId: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); @@ -788,6 +835,7 @@ export const DataTypesCreateManyInputSchema: z.ZodType NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), relatedId: z.number().int().optional().nullable() }).strict(); @@ -803,6 +851,7 @@ export const DataTypesUpdateManyMutationInputSchema: z.ZodType NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), + json: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), }).strict(); export const DataTypesUncheckedUpdateManyInputSchema: z.ZodType = z.object({ @@ -817,6 +866,7 @@ export const DataTypesUncheckedUpdateManyInputSchema: z.ZodType NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), + json: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), relatedId: z.union([ z.number().int(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); @@ -1148,6 +1198,22 @@ export const FloatNullableFilterSchema: z.ZodType = not: z.union([ z.number(),z.lazy(() => NestedFloatNullableFilterSchema) ]).optional().nullable(), }).strict(); +export const JsonNullableFilterSchema: z.ZodType = z.object({ + equals: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValue.optional().nullable(), + array_starts_with: InputJsonValue.optional().nullable(), + array_ends_with: InputJsonValue.optional().nullable(), + lt: InputJsonValue.optional(), + lte: InputJsonValue.optional(), + gt: InputJsonValue.optional(), + gte: InputJsonValue.optional(), + not: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), +}).strict(); + export const DummyRelationFilterSchema: z.ZodType = z.object({ is: z.lazy(() => DummyWhereInputSchema).optional().nullable(), isNot: z.lazy(() => DummyWhereInputSchema).optional().nullable() @@ -1165,6 +1231,7 @@ export const DataTypesCountOrderByAggregateInputSchema: z.ZodType SortOrderSchema).optional(), int4: z.lazy(() => SortOrderSchema).optional(), float8: z.lazy(() => SortOrderSchema).optional(), + json: z.lazy(() => SortOrderSchema).optional(), relatedId: z.lazy(() => SortOrderSchema).optional() }).strict(); @@ -1267,6 +1334,25 @@ export const FloatNullableWithAggregatesFilterSchema: z.ZodType NestedFloatNullableFilterSchema).optional() }).strict(); +export const JsonNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValue.optional().nullable(), + array_starts_with: InputJsonValue.optional().nullable(), + array_ends_with: InputJsonValue.optional().nullable(), + lt: InputJsonValue.optional(), + lte: InputJsonValue.optional(), + gt: InputJsonValue.optional(), + gte: InputJsonValue.optional(), + not: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedJsonNullableFilterSchema).optional(), + _max: z.lazy(() => NestedJsonNullableFilterSchema).optional() +}).strict(); + export const DataTypesListRelationFilterSchema: z.ZodType = z.object({ every: z.lazy(() => DataTypesWhereInputSchema).optional(), some: z.lazy(() => DataTypesWhereInputSchema).optional(), @@ -1721,6 +1807,22 @@ export const NestedFloatNullableWithAggregatesFilterSchema: z.ZodType NestedFloatNullableFilterSchema).optional() }).strict(); +export const NestedJsonNullableFilterSchema: z.ZodType = z.object({ + equals: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValue.optional().nullable(), + array_starts_with: InputJsonValue.optional().nullable(), + array_ends_with: InputJsonValue.optional().nullable(), + lt: InputJsonValue.optional(), + lte: InputJsonValue.optional(), + gt: InputJsonValue.optional(), + gte: InputJsonValue.optional(), + not: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), +}).strict(); + export const PostCreateWithoutAuthorInputSchema: z.ZodType = z.object({ id: z.number(), title: z.string(), @@ -1911,7 +2013,8 @@ export const DataTypesCreateWithoutRelatedInputSchema: z.ZodType NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), }).strict(); export const DataTypesUncheckedCreateWithoutRelatedInputSchema: z.ZodType = z.object({ @@ -1925,7 +2028,8 @@ export const DataTypesUncheckedCreateWithoutRelatedInputSchema: z.ZodType NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), }).strict(); export const DataTypesCreateOrConnectWithoutRelatedInputSchema: z.ZodType = z.object({ @@ -1969,6 +2073,7 @@ export const DataTypesScalarWhereInputSchema: z.ZodType IntNullableFilterSchema),z.number() ]).optional().nullable(), int4: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), float8: z.union([ z.lazy(() => FloatNullableFilterSchema),z.number() ]).optional().nullable(), + json: z.lazy(() => JsonNullableFilterSchema).optional(), relatedId: z.union([ z.lazy(() => IntNullableFilterSchema),z.number() ]).optional().nullable(), }).strict(); @@ -2011,7 +2116,8 @@ export const DataTypesCreateManyRelatedInputSchema: z.ZodType NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), }).strict(); export const DataTypesUpdateWithoutRelatedInputSchema: z.ZodType = z.object({ @@ -2026,6 +2132,7 @@ export const DataTypesUpdateWithoutRelatedInputSchema: z.ZodType NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number(),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), + json: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), }).strict(); export const DataTypesUncheckedUpdateWithoutRelatedInputSchema: z.ZodType = z.object({ @@ -2040,6 +2147,7 @@ export const DataTypesUncheckedUpdateWithoutRelatedInputSchema: z.ZodType NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number(),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number(),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), + json: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), }).strict(); export const DataTypesUncheckedUpdateManyWithoutDatatypeInputSchema: z.ZodType = z.object({ @@ -2054,6 +2162,7 @@ export const DataTypesUncheckedUpdateManyWithoutDatatypeInputSchema: z.ZodType

NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), int4: z.union([ z.number().int().gte(-2147483648).lte(2147483647),z.lazy(() => NullableIntFieldUpdateOperationsInputSchema) ]).optional().nullable(), float8: z.union([ z.number().or(z.nan()),z.lazy(() => NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), + json: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), }).strict(); ///////////////////////////////////////// @@ -2932,6 +3041,10 @@ export const tableSchemas = { "float8", "FLOAT8" ], + [ + "json", + "JSON" + ], [ "relatedId", "INT4" @@ -3006,3 +3119,4 @@ export const tableSchemas = { export const schema = new DbSchema(tableSchemas, []) export type Electric = ElectricClient +export const JsonNull = { __is_electric_json_null__: true } diff --git a/clients/typescript/test/client/model/datatype.test.ts b/clients/typescript/test/client/model/datatype.test.ts index 0148055318..733442774d 100644 --- a/clients/typescript/test/client/model/datatype.test.ts +++ b/clients/typescript/test/client/model/datatype.test.ts @@ -8,7 +8,7 @@ import { _NOT_UNIQUE_, _RECORD_NOT_FOUND_, } from '../../../src/client/validation/errors/messages' -import { schema } from '../generated' +import { schema, JsonNull } from '../generated' import { ZodError } from 'zod' const db = new Database(':memory:') @@ -31,7 +31,7 @@ await tbl.sync() function setupDB() { db.exec('DROP TABLE IF EXISTS DataTypes') db.exec( - "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'relatedId' int);" + "CREATE TABLE DataTypes('id' int PRIMARY KEY, 'date' varchar, 'time' varchar, 'timetz' varchar, 'timestamp' varchar, 'timestamptz' varchar, 'bool' int, 'uuid' varchar, 'int2' int2, 'int4' int4, 'float8' real, 'json' varchar, 'relatedId' int);" ) } @@ -644,3 +644,73 @@ test.serial('support null values for float8 type', async (t) => { t.deepEqual(fetchRes, expectedRes) }) + +test.serial('support JSON type', async (t) => { + const json = { a: 1, b: true, c: { d: 'nested' }, e: [1, 2, 3], f: null } + const res = await tbl.create({ + data: { + id: 1, + json, + }, + }) + + t.deepEqual(res.json, json) + + const fetchRes = await tbl.findUnique({ + where: { + id: 1, + }, + }) + + t.deepEqual(fetchRes?.json, json) + + // Also test that we can write the special JsonNull value + const res2 = await tbl.create({ + data: { + id: 2, + json: JsonNull, + }, + }) + + t.deepEqual(res2.json, JsonNull) + + const fetchRes2 = await tbl.findUnique({ + where: { + id: 2, + }, + }) + + t.deepEqual(fetchRes2?.json, JsonNull) +}) + +test.serial('support null values for JSON type', async (t) => { + const expectedRes = { + id: 1, + json: null, + } + + const res = await tbl.create({ + data: { + id: 1, + json: null, + }, + select: { + id: true, + json: true, + }, + }) + + t.deepEqual(res, expectedRes) + + const fetchRes = await tbl.findUnique({ + where: { + id: 1, + }, + select: { + id: true, + json: true, + }, + }) + + t.deepEqual(fetchRes, expectedRes) +}) diff --git a/clients/typescript/test/client/prisma/schema.prisma b/clients/typescript/test/client/prisma/schema.prisma index 89de6330c0..9ade8cd1bc 100644 --- a/clients/typescript/test/client/prisma/schema.prisma +++ b/clients/typescript/test/client/prisma/schema.prisma @@ -55,6 +55,7 @@ model DataTypes { int2 Int? @db.SmallInt /// @zod.number.int().gte(-32768).lte(32767) int4 Int? /// @zod.number.int().gte(-2147483648).lte(2147483647) float8 Float? @db.DoublePrecision /// @zod.custom.use(z.number().or(z.nan())) + json Json? relatedId Int? related Dummy? @relation(fields: [relatedId], references: [id]) } From c2f7557cfb3e4172a4e2da633c51224b1f976536 Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 7 Nov 2023 11:56:06 +0100 Subject: [PATCH 02/11] Changes to the generated JSON schemas. --- .../contentWriters/writeInputJsonValue.ts | 1 + .../contentWriters/writeJsonValue.ts | 1 + .../contentWriters/writeNullableJsonValue.ts | 10 ++-------- .../contentWriters/writePrismaEnum.ts | 16 ++------------- .../contentWriters/writeTransformJsonNull.ts | 20 +------------------ .../writeTableSchemas.ts | 6 +++++- .../functions/writeMultiFileInputTypeFiles.ts | 1 - .../writeSingleFileImportStatements.ts | 11 +--------- 8 files changed, 13 insertions(+), 53 deletions(-) diff --git a/generator/src/functions/contentWriters/writeInputJsonValue.ts b/generator/src/functions/contentWriters/writeInputJsonValue.ts index e7cecb55d9..9e0382b741 100644 --- a/generator/src/functions/contentWriters/writeInputJsonValue.ts +++ b/generator/src/functions/contentWriters/writeInputJsonValue.ts @@ -19,6 +19,7 @@ export const writeInputJsonValue = ({ ) .withIndentationLevel(1, () => { writer + .writeLine(`z.null(),`) .writeLine(`z.string(),`) .writeLine(`z.number(),`) .writeLine(`z.boolean(),`) diff --git a/generator/src/functions/contentWriters/writeJsonValue.ts b/generator/src/functions/contentWriters/writeJsonValue.ts index b677b730ae..17ac51b7ef 100644 --- a/generator/src/functions/contentWriters/writeJsonValue.ts +++ b/generator/src/functions/contentWriters/writeJsonValue.ts @@ -19,6 +19,7 @@ export const writeJsonValue = ({ ) .withIndentationLevel(1, () => { writer + .writeLine(`z.null(),`) .writeLine(`z.string(),`) .writeLine(`z.number(),`) .writeLine(`z.boolean(),`) diff --git a/generator/src/functions/contentWriters/writeNullableJsonValue.ts b/generator/src/functions/contentWriters/writeNullableJsonValue.ts index e6d232c656..30a68c6f6d 100644 --- a/generator/src/functions/contentWriters/writeNullableJsonValue.ts +++ b/generator/src/functions/contentWriters/writeNullableJsonValue.ts @@ -9,20 +9,14 @@ export const writeNullableJsonValue = ({ if (useMultipleFiles && !getSingleFileContent) { writeImport('{ z }', 'zod') - writeImport('transformJsonNull', './transformJsonNull') writeImport('JsonValue', './JsonValue') } writer .blankLine() - .writeLine(`export const NullableJsonValue = z`) + .writeLine(`export const NullableJsonValue = JsonValue`) .withIndentationLevel(1, () => { - writer - .writeLine( - `.union([JsonValue, z.literal('DbNull'), z.literal('JsonNull')])` - ) - .writeLine('.nullable()') - .writeLine(`.transform((v) => transformJsonNull(v));`) + writer.writeLine('.nullable();') }) .blankLine() .writeLine( diff --git a/generator/src/functions/contentWriters/writePrismaEnum.ts b/generator/src/functions/contentWriters/writePrismaEnum.ts index 05062252d7..c5cc35392c 100644 --- a/generator/src/functions/contentWriters/writePrismaEnum.ts +++ b/generator/src/functions/contentWriters/writePrismaEnum.ts @@ -24,23 +24,11 @@ export const writePrismaEnum = ( }) writer.write(`]);`) } else { - writer - .conditionalWrite( - useMultipleFiles && name.includes('NullableJson'), - `import transformJsonNull from './transformJsonNull'` - ) - .blankLine() - .write(`export const ${name}Schema = z.enum([`) + writer.blankLine().write(`export const ${name}Schema = z.enum([`) values.forEach((value) => { writer.write(`'${value}',`) }) - writer - .write(`])`) - .conditionalWrite(!name.includes('Nullable'), `;`) - .conditionalWrite( - name.includes('Nullable'), - `.transform((v) => transformJsonNull(v));` - ) + writer.write(`])`).conditionalWrite(!name.includes('Nullable'), `;`) } if (useMultipleFiles && !getSingleFileContent) { diff --git a/generator/src/functions/contentWriters/writeTransformJsonNull.ts b/generator/src/functions/contentWriters/writeTransformJsonNull.ts index 4c23a67a33..d53517e37a 100644 --- a/generator/src/functions/contentWriters/writeTransformJsonNull.ts +++ b/generator/src/functions/contentWriters/writeTransformJsonNull.ts @@ -17,24 +17,6 @@ export const writeTransformJsonNull = ({ .newLine() .write(`export type NullableJsonInput = `) .write(`Prisma.JsonValue | `) - .write(`null | `) - .write(`'JsonNull' | `) - .write(`'DbNull' | `) - .write(`Prisma.NullTypes.DbNull | `) - .write(`Prisma.NullTypes.JsonNull;`) + .write(`null;`) .blankLine() - - writer - .write(`export const transformJsonNull = (v?: NullableJsonInput) => `) - .inlineBlock(() => { - writer - .writeLine(`if (!v || v === 'DbNull') return Prisma.DbNull;`) - .writeLine(`if (v === 'JsonNull') return Prisma.JsonNull;`) - .writeLine(`return v;`) - }) - .write(`;`) - - if (useMultipleFiles && !getSingleFileContent) { - writer.blankLine().writeLine(`export default transformJsonNull;`) - } } diff --git a/generator/src/functions/tableDescriptionWriters/writeTableSchemas.ts b/generator/src/functions/tableDescriptionWriters/writeTableSchemas.ts index b122ca175b..9bd25d58f7 100644 --- a/generator/src/functions/tableDescriptionWriters/writeTableSchemas.ts +++ b/generator/src/functions/tableDescriptionWriters/writeTableSchemas.ts @@ -79,6 +79,10 @@ export function writeTableSchemas( writer .writeLine('export const schema = new DbSchema(tableSchemas, migrations)') .writeLine('export type Electric = ElectricClient') + .conditionalWriteLine( + dmmf.schema.hasJsonTypes, + 'export const JsonNull = { __is_electric_json_null__: true }' + ) } export function writeFieldsMap( @@ -120,7 +124,7 @@ function pgType(field: ExtendedDMMFField, modelName: string): string { return 'DECIMAL' case 'Float': return 'FLOAT8' - case 'JSON': + case 'Json': return 'JSON' default: return 'UNRECOGNIZED PRISMA TYPE' diff --git a/generator/src/functions/writeMultiFileInputTypeFiles.ts b/generator/src/functions/writeMultiFileInputTypeFiles.ts index e142235035..f5d1c03240 100644 --- a/generator/src/functions/writeMultiFileInputTypeFiles.ts +++ b/generator/src/functions/writeMultiFileInputTypeFiles.ts @@ -48,7 +48,6 @@ export const writeInputTypeFiles: CreateFiles = ({ }) if (dmmf.schema.hasJsonTypes) { - writeExport(`{ transformJsonNull }`, `./transformJsonNull`) writeExport(`{ NullableJsonValue }`, `./NullableJsonValue`) writeExport(`{ InputJsonValue }`, `./InputJsonValue`) writeExport(`{ JsonValue }`, `./JsonValue`) diff --git a/generator/src/functions/writeSingleFileImportStatements.ts b/generator/src/functions/writeSingleFileImportStatements.ts index 87bdde0225..fb054681ac 100644 --- a/generator/src/functions/writeSingleFileImportStatements.ts +++ b/generator/src/functions/writeSingleFileImportStatements.ts @@ -8,18 +8,9 @@ export const writeSingleFileImportStatements: WriteStatements = ( dmmf, { writer, writeImport } ) => { - const { prismaClientPath } = dmmf.generatorConfig writeImport('{ z }', 'zod') - // Prisma should primarily be imported as a type, but if there are json fields, - // we need to import the whole namespace because the null transformation - // relies on the Prisma.JsonNull and Prisma.DbNull objects - - if (dmmf.schema.hasJsonTypes) { - writeImport(`{ Prisma }`, `${prismaClientPath}`) - } else { - writeImport(`type { Prisma }`, `${prismaClientPath}`) - } + writeImport(`type { Prisma }`, `./prismaClient`) if (dmmf.customImports) { dmmf.customImports.forEach((statement) => { From 84c8e339c940e521dae243a7753476ece8906898 Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 7 Nov 2023 11:57:36 +0100 Subject: [PATCH 03/11] Changeset --- .changeset/nine-bulldogs-learn.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/nine-bulldogs-learn.md diff --git a/.changeset/nine-bulldogs-learn.md b/.changeset/nine-bulldogs-learn.md new file mode 100644 index 0000000000..6fcf2ec1b2 --- /dev/null +++ b/.changeset/nine-bulldogs-learn.md @@ -0,0 +1,6 @@ +--- +"electric-sql": patch +"@electric-sql/prisma-generator": patch +--- + +Adds client-side support for JSON type. From 5028c094da072fd8003cb01811194765b5006759 Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 7 Nov 2023 15:53:43 +0100 Subject: [PATCH 04/11] Support equals filter in where clauses because it is required for JSON. --- clients/typescript/src/client/model/builder.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/clients/typescript/src/client/model/builder.ts b/clients/typescript/src/client/model/builder.ts index 9e1d5a7f57..e9e4b07df8 100644 --- a/clients/typescript/src/client/model/builder.ts +++ b/clients/typescript/src/client/model/builder.ts @@ -280,6 +280,7 @@ function makeFilter( // an object containing filters is provided // e.g. users.findMany({ where: { id: { in: [1, 2, 3] } } }) const fs = { + equals: z.any(), in: z.any().array().optional(), not: z.any().optional(), notIn: z.any().optional(), @@ -293,6 +294,7 @@ function makeFilter( } const fsHandlers = { + equals: makeEqualsFilter.bind(null), in: makeInFilter.bind(null), not: makeNotFilter.bind(null), notIn: makeNotInFilter.bind(null), @@ -380,6 +382,13 @@ function makeBooleanFilter( } } +function makeEqualsFilter( + fieldName: string, + value: unknown | undefined +): { sql: string; args?: unknown[] } { + return { sql: `${fieldName} = ?`, args: [value] } +} + function makeInFilter( fieldName: string, values: unknown[] | undefined From db02111ae7cea03159da126fcade09021d9a3e70 Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 7 Nov 2023 15:55:26 +0100 Subject: [PATCH 05/11] Unit test for filtering on JSON value in where clause. --- .../test/client/conversions/input.test.ts | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/clients/typescript/test/client/conversions/input.test.ts b/clients/typescript/test/client/conversions/input.test.ts index 18d6cd481b..6b2ad2e6a6 100644 --- a/clients/typescript/test/client/conversions/input.test.ts +++ b/clients/typescript/test/client/conversions/input.test.ts @@ -8,7 +8,7 @@ import { _NOT_UNIQUE_, _RECORD_NOT_FOUND_, } from '../../../src/client/validation/errors/messages' -import { schema } from '../generated' +import { JsonNull, schema } from '../generated' import { DataTypes, Dummy } from '../generated/client' const db = new Database(':memory:') @@ -91,6 +91,26 @@ test.serial('findFirst transforms booleans to integer in SQLite', async (t) => { t.is(res?.bool, true) }) +test.serial( + 'findFirst transforms json values to strings in SQLite', + async (t) => { + await electric.adapter.run({ + sql: `INSERT INTO DataTypes('id', 'json') VALUES (1, NULL), (2, '{ "a": 5 }'), (3, 'null')`, + }) + + const res = await tbl.findFirst({ + where: { + json: { + equals: JsonNull, + }, + }, + }) + + t.is(res?.id, 3) + t.deepEqual(res?.json, JsonNull) + } +) + test.serial( 'findFirst transforms JS objects in equals filter to SQLite', async (t) => { From b734a3e668bb0eef8c773df34eb5780e6331c507 Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Mon, 13 Nov 2023 12:25:09 +0100 Subject: [PATCH 06/11] e2e test for jsonb values --- e2e/satellite_client/src/client.ts | 65 +- .../src/generated/client/index.ts | 365 +- .../src/generated/client/prismaClient.d.ts | 10605 ++++++++++++++++ e2e/satellite_client/src/prisma/schema.prisma | 18 +- .../03.19_node_satellite_can_sync_json.lux | 102 + e2e/tests/_satellite_macros.luxinc | 36 + 6 files changed, 11173 insertions(+), 18 deletions(-) create mode 100644 e2e/satellite_client/src/generated/client/prismaClient.d.ts create mode 100644 e2e/tests/03.19_node_satellite_can_sync_json.lux diff --git a/e2e/satellite_client/src/client.ts b/e2e/satellite_client/src/client.ts index 360614c84f..88e03e929e 100644 --- a/e2e/satellite_client/src/client.ts +++ b/e2e/satellite_client/src/client.ts @@ -6,6 +6,7 @@ import { setLogLevel } from 'electric-sql/debug' import { electrify } from 'electric-sql/node' import { v4 as uuidv4 } from 'uuid' import { schema, Electric } from './generated/client' +export { JsonNull } from './generated/client' import { globalRegistry } from 'electric-sql/satellite' setLogLevel('DEBUG') @@ -96,7 +97,7 @@ export const write_datetime = (electric: Electric, datetime: Datetime) => { }) } -export const get_timestamp = (electric: Electric, id: string): Promise => { +export const get_timestamp = (electric: Electric, id: string) => { return electric.db.timestamps.findUnique({ where: { id: id @@ -104,7 +105,7 @@ export const get_timestamp = (electric: Electric, id: string): Promise => { +export const get_datetime = async (electric: Electric, id: string) => { const datetime = await electric.db.datetimes.findUnique({ where: { id: id @@ -124,13 +125,13 @@ export const assert_datetime = async (electric: Electric, id: string, expectedDa return check_datetime(datetime, expectedDate, expectedTime) } -export const check_timestamp = (timestamp: Timestamp | undefined, expectedCreatedAt: string, expectedUpdatedAt: string) => { +export const check_timestamp = (timestamp: Timestamp | null, expectedCreatedAt: string, expectedUpdatedAt: string) => { return (timestamp ?? false) && timestamp!.created_at.getTime() === new Date(expectedCreatedAt).getTime() && timestamp!.updated_at.getTime() === new Date(expectedUpdatedAt).getTime() } -export const check_datetime = (datetime: Datetime | undefined, expectedDate: string, expectedTime: string) => { +export const check_datetime = (datetime: Datetime | null, expectedDate: string, expectedTime: string) => { return (datetime ?? false) && datetime!.d.getTime() === new Date(expectedDate).getTime() && datetime!.t.getTime() === new Date(expectedTime).getTime() @@ -145,13 +146,13 @@ export const write_bool = (electric: Electric, id: string, b: boolean) => { }) } -export const get_bool = async (electric: Electric, id: string): Promise => { +export const get_bool = async (electric: Electric, id: string) => { const row = await electric.db.bools.findUnique({ where: { id: id }, }) - return row.b + return row?.b } export const get_datetimes = (electric: Electric) => { @@ -225,6 +226,58 @@ export const write_float = (electric: Electric, id: string, f8: number) => { }) } +export const get_json_raw = async (electric: Electric, id: string) => { + const res = await electric.db.raw({ + sql: `SELECT js FROM jsons WHERE id = ?;`, + args: [id] + }) as unknown as Array<{ js: string }> + return res[0]?.js +} + +export const get_jsonb_raw = async (electric: Electric, id: string) => { + const res = await electric.db.raw({ + sql: `SELECT jsb FROM jsons WHERE id = ?;`, + args: [id] + }) as unknown as Array<{ jsb: string }> + return res[0]?.jsb +} + +export const get_json = async (electric: Electric, id: string) => { + const res = await electric.db.jsons.findUnique({ + where: { + id: id + }, + select: { + id: true, + js: true, + } + }) + return res +} + +export const get_jsonb = async (electric: Electric, id: string) => { + const res = await electric.db.jsons.findUnique({ + where: { + id: id + }, + select: { + id: true, + jsb: true, + } + }) + return res +} + +export const write_json = async (electric: Electric, id: string, js: any, jsb: any) => { + return electric.db.jsons.create({ + data: { + id, + //js, + jsb, + } + }) +} + export const get_item_columns = (electric: Electric, table: string, column: string) => { return electric.db.raw({ sql: `SELECT ${column} FROM ${table};` }) } diff --git a/e2e/satellite_client/src/generated/client/index.ts b/e2e/satellite_client/src/generated/client/index.ts index 574b058a42..fcab943894 100644 --- a/e2e/satellite_client/src/generated/client/index.ts +++ b/e2e/satellite_client/src/generated/client/index.ts @@ -1,5 +1,5 @@ import { z } from 'zod'; -import type { Prisma } from '@prisma/client'; +import type { Prisma } from './prismaClient'; import { TableSchema, DbSchema, Relation, ElectricClient, HKT } from 'electric-sql/client/model'; import migrations from './migrations'; @@ -7,6 +7,39 @@ import migrations from './migrations'; // HELPER FUNCTIONS ///////////////////////////////////////// +// JSON +//------------------------------------------------------ + +export type NullableJsonInput = Prisma.JsonValue | null; + + +export const JsonValue: z.ZodType = z.union([ + z.null(), + z.string(), + z.number(), + z.boolean(), + z.lazy(() => z.array(JsonValue)), + z.lazy(() => z.record(JsonValue)), +]); + +export type JsonValueType = z.infer; + +export const NullableJsonValue = JsonValue + .nullable(); + +export type NullableJsonValueType = z.infer; + +export const InputJsonValue: z.ZodType = z.union([ + z.null(), + z.string(), + z.number(), + z.boolean(), + z.lazy(() => z.array(InputJsonValue.nullable())), + z.lazy(() => z.record(InputJsonValue.nullable())), +]); + +export type InputJsonValueType = z.infer; + ///////////////////////////////////////// // ENUMS @@ -22,6 +55,12 @@ export const IntsScalarFieldEnumSchema = z.enum(['id','i2','i4']); export const ItemsScalarFieldEnumSchema = z.enum(['id','content','content_text_null','content_text_null_default','intvalue_null','intvalue_null_default']); +export const JsonNullValueFilterSchema = z.enum(['DbNull','JsonNull','AnyNull',]); + +export const JsonsScalarFieldEnumSchema = z.enum(['id','js','jsb']); + +export const NullableJsonNullValueInputSchema = z.enum(['DbNull','JsonNull',]) + export const OtherItemsScalarFieldEnumSchema = z.enum(['id','content','item_id']); export const QueryModeSchema = z.enum(['default','insensitive']); @@ -44,10 +83,10 @@ export const UuidsScalarFieldEnumSchema = z.enum(['id']); export const ItemsSchema = z.object({ id: z.string(), content: z.string(), - content_text_null: z.string().nullish(), - content_text_null_default: z.string().nullish(), - intvalue_null: z.number().int().nullish(), - intvalue_null_default: z.number().int().nullish(), + content_text_null: z.string().nullable(), + content_text_null_default: z.string().nullable(), + intvalue_null: z.number().int().nullable(), + intvalue_null_default: z.number().int().nullable(), }) export type Items = z.infer @@ -59,7 +98,7 @@ export type Items = z.infer export const OtherItemsSchema = z.object({ id: z.string(), content: z.string(), - item_id: z.string().nullish(), + item_id: z.string().nullable(), }) export type OtherItems = z.infer @@ -94,7 +133,7 @@ export type Datetimes = z.infer export const BoolsSchema = z.object({ id: z.string(), - b: z.boolean().nullish(), + b: z.boolean().nullable(), }) export type Bools = z.infer @@ -115,8 +154,8 @@ export type Uuids = z.infer export const IntsSchema = z.object({ id: z.string(), - i2: z.number().int().gte(-32768).lte(32767).nullish(), - i4: z.number().int().gte(-2147483648).lte(2147483647).nullish(), + i2: z.number().int().gte(-32768).lte(32767).nullable(), + i4: z.number().int().gte(-2147483648).lte(2147483647).nullable(), }) export type Ints = z.infer @@ -127,11 +166,23 @@ export type Ints = z.infer export const FloatsSchema = z.object({ id: z.string(), - f8: z.number().or(z.nan()).nullish(), + f8: z.number().or(z.nan()).nullable(), }) export type Floats = z.infer +///////////////////////////////////////// +// JSONS SCHEMA +///////////////////////////////////////// + +export const JsonsSchema = z.object({ + id: z.string(), + js: NullableJsonValue.optional(), + jsb: NullableJsonValue.optional(), +}) + +export type Jsons = z.infer + ///////////////////////////////////////// // SELECT & INCLUDE ///////////////////////////////////////// @@ -227,6 +278,15 @@ export const FloatsSelectSchema: z.ZodType = z.object({ f8: z.boolean().optional(), }).strict() +// JSONS +//------------------------------------------------------ + +export const JsonsSelectSchema: z.ZodType = z.object({ + id: z.boolean().optional(), + js: z.boolean().optional(), + jsb: z.boolean().optional(), +}).strict() + ///////////////////////////////////////// // INPUT TYPES @@ -535,6 +595,43 @@ export const FloatsScalarWhereWithAggregatesInputSchema: z.ZodType FloatNullableWithAggregatesFilterSchema),z.number() ]).optional().nullable(), }).strict(); +export const JsonsWhereInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => JsonsWhereInputSchema),z.lazy(() => JsonsWhereInputSchema).array() ]).optional(), + OR: z.lazy(() => JsonsWhereInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => JsonsWhereInputSchema),z.lazy(() => JsonsWhereInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringFilterSchema),z.string() ]).optional(), + js: z.lazy(() => JsonNullableFilterSchema).optional(), + jsb: z.lazy(() => JsonNullableFilterSchema).optional() +}).strict(); + +export const JsonsOrderByWithRelationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + js: z.lazy(() => SortOrderSchema).optional(), + jsb: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const JsonsWhereUniqueInputSchema: z.ZodType = z.object({ + id: z.string().optional() +}).strict(); + +export const JsonsOrderByWithAggregationInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + js: z.lazy(() => SortOrderSchema).optional(), + jsb: z.lazy(() => SortOrderSchema).optional(), + _count: z.lazy(() => JsonsCountOrderByAggregateInputSchema).optional(), + _max: z.lazy(() => JsonsMaxOrderByAggregateInputSchema).optional(), + _min: z.lazy(() => JsonsMinOrderByAggregateInputSchema).optional() +}).strict(); + +export const JsonsScalarWhereWithAggregatesInputSchema: z.ZodType = z.object({ + AND: z.union([ z.lazy(() => JsonsScalarWhereWithAggregatesInputSchema),z.lazy(() => JsonsScalarWhereWithAggregatesInputSchema).array() ]).optional(), + OR: z.lazy(() => JsonsScalarWhereWithAggregatesInputSchema).array().optional(), + NOT: z.union([ z.lazy(() => JsonsScalarWhereWithAggregatesInputSchema),z.lazy(() => JsonsScalarWhereWithAggregatesInputSchema).array() ]).optional(), + id: z.union([ z.lazy(() => StringWithAggregatesFilterSchema),z.string() ]).optional(), + js: z.lazy(() => JsonNullableWithAggregatesFilterSchema).optional(), + jsb: z.lazy(() => JsonNullableWithAggregatesFilterSchema).optional() +}).strict(); + export const ItemsCreateInputSchema: z.ZodType = z.object({ id: z.string(), content: z.string(), @@ -867,6 +964,48 @@ export const FloatsUncheckedUpdateManyInputSchema: z.ZodType NullableFloatFieldUpdateOperationsInputSchema) ]).optional().nullable(), }).strict(); +export const JsonsCreateInputSchema: z.ZodType = z.object({ + id: z.string(), + js: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), + jsb: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), +}).strict(); + +export const JsonsUncheckedCreateInputSchema: z.ZodType = z.object({ + id: z.string(), + js: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), + jsb: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), +}).strict(); + +export const JsonsUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + js: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), + jsb: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), +}).strict(); + +export const JsonsUncheckedUpdateInputSchema: z.ZodType = z.object({ + id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + js: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), + jsb: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), +}).strict(); + +export const JsonsCreateManyInputSchema: z.ZodType = z.object({ + id: z.string(), + js: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), + jsb: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), +}).strict(); + +export const JsonsUpdateManyMutationInputSchema: z.ZodType = z.object({ + id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + js: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), + jsb: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), +}).strict(); + +export const JsonsUncheckedUpdateManyInputSchema: z.ZodType = z.object({ + id: z.union([ z.string(),z.lazy(() => StringFieldUpdateOperationsInputSchema) ]).optional(), + js: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), + jsb: z.union([ z.lazy(() => NullableJsonNullValueInputSchema),InputJsonValue ]).optional(), +}).strict(); + export const StringFilterSchema: z.ZodType = z.object({ equals: z.string().optional(), in: z.union([ z.string().array(),z.string() ]).optional(), @@ -1231,6 +1370,55 @@ export const FloatNullableWithAggregatesFilterSchema: z.ZodType NestedFloatNullableFilterSchema).optional() }).strict(); +export const JsonNullableFilterSchema: z.ZodType = z.object({ + equals: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValue.optional().nullable(), + array_starts_with: InputJsonValue.optional().nullable(), + array_ends_with: InputJsonValue.optional().nullable(), + lt: InputJsonValue.optional(), + lte: InputJsonValue.optional(), + gt: InputJsonValue.optional(), + gte: InputJsonValue.optional(), + not: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), +}).strict(); + +export const JsonsCountOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional(), + js: z.lazy(() => SortOrderSchema).optional(), + jsb: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const JsonsMaxOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const JsonsMinOrderByAggregateInputSchema: z.ZodType = z.object({ + id: z.lazy(() => SortOrderSchema).optional() +}).strict(); + +export const JsonNullableWithAggregatesFilterSchema: z.ZodType = z.object({ + equals: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValue.optional().nullable(), + array_starts_with: InputJsonValue.optional().nullable(), + array_ends_with: InputJsonValue.optional().nullable(), + lt: InputJsonValue.optional(), + lte: InputJsonValue.optional(), + gt: InputJsonValue.optional(), + gte: InputJsonValue.optional(), + not: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), + _count: z.lazy(() => NestedIntNullableFilterSchema).optional(), + _min: z.lazy(() => NestedJsonNullableFilterSchema).optional(), + _max: z.lazy(() => NestedJsonNullableFilterSchema).optional() +}).strict(); + export const OtherItemsCreateNestedOneWithoutItemsInputSchema: z.ZodType = z.object({ create: z.union([ z.lazy(() => OtherItemsCreateWithoutItemsInputSchema),z.lazy(() => OtherItemsUncheckedCreateWithoutItemsInputSchema) ]).optional(), connectOrCreate: z.lazy(() => OtherItemsCreateOrConnectWithoutItemsInputSchema).optional(), @@ -1501,6 +1689,22 @@ export const NestedFloatNullableWithAggregatesFilterSchema: z.ZodType NestedFloatNullableFilterSchema).optional() }).strict(); +export const NestedJsonNullableFilterSchema: z.ZodType = z.object({ + equals: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), + path: z.string().array().optional(), + string_contains: z.string().optional(), + string_starts_with: z.string().optional(), + string_ends_with: z.string().optional(), + array_contains: InputJsonValue.optional().nullable(), + array_starts_with: InputJsonValue.optional().nullable(), + array_ends_with: InputJsonValue.optional().nullable(), + lt: InputJsonValue.optional(), + lte: InputJsonValue.optional(), + gt: InputJsonValue.optional(), + gte: InputJsonValue.optional(), + not: z.union([ InputJsonValue,z.lazy(() => JsonNullValueFilterSchema) ]).optional(), +}).strict(); + export const OtherItemsCreateWithoutItemsInputSchema: z.ZodType = z.object({ id: z.string(), content: z.string() @@ -2047,6 +2251,63 @@ export const FloatsFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + where: JsonsWhereInputSchema.optional(), + orderBy: z.union([ JsonsOrderByWithRelationInputSchema.array(),JsonsOrderByWithRelationInputSchema ]).optional(), + cursor: JsonsWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: JsonsScalarFieldEnumSchema.array().optional(), +}).strict() + +export const JsonsFindFirstOrThrowArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + where: JsonsWhereInputSchema.optional(), + orderBy: z.union([ JsonsOrderByWithRelationInputSchema.array(),JsonsOrderByWithRelationInputSchema ]).optional(), + cursor: JsonsWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: JsonsScalarFieldEnumSchema.array().optional(), +}).strict() + +export const JsonsFindManyArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + where: JsonsWhereInputSchema.optional(), + orderBy: z.union([ JsonsOrderByWithRelationInputSchema.array(),JsonsOrderByWithRelationInputSchema ]).optional(), + cursor: JsonsWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), + distinct: JsonsScalarFieldEnumSchema.array().optional(), +}).strict() + +export const JsonsAggregateArgsSchema: z.ZodType = z.object({ + where: JsonsWhereInputSchema.optional(), + orderBy: z.union([ JsonsOrderByWithRelationInputSchema.array(),JsonsOrderByWithRelationInputSchema ]).optional(), + cursor: JsonsWhereUniqueInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() + +export const JsonsGroupByArgsSchema: z.ZodType = z.object({ + where: JsonsWhereInputSchema.optional(), + orderBy: z.union([ JsonsOrderByWithAggregationInputSchema.array(),JsonsOrderByWithAggregationInputSchema ]).optional(), + by: JsonsScalarFieldEnumSchema.array(), + having: JsonsScalarWhereWithAggregatesInputSchema.optional(), + take: z.number().optional(), + skip: z.number().optional(), +}).strict() + +export const JsonsFindUniqueArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + where: JsonsWhereUniqueInputSchema, +}).strict() + +export const JsonsFindUniqueOrThrowArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + where: JsonsWhereUniqueInputSchema, +}).strict() + export const ItemsCreateArgsSchema: z.ZodType = z.object({ select: ItemsSelectSchema.optional(), include: ItemsIncludeSchema.optional(), @@ -2351,6 +2612,43 @@ export const FloatsDeleteManyArgsSchema: z.ZodType where: FloatsWhereInputSchema.optional(), }).strict() +export const JsonsCreateArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + data: z.union([ JsonsCreateInputSchema,JsonsUncheckedCreateInputSchema ]), +}).strict() + +export const JsonsUpsertArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + where: JsonsWhereUniqueInputSchema, + create: z.union([ JsonsCreateInputSchema,JsonsUncheckedCreateInputSchema ]), + update: z.union([ JsonsUpdateInputSchema,JsonsUncheckedUpdateInputSchema ]), +}).strict() + +export const JsonsCreateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ JsonsCreateManyInputSchema,JsonsCreateManyInputSchema.array() ]), + skipDuplicates: z.boolean().optional(), +}).strict() + +export const JsonsDeleteArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + where: JsonsWhereUniqueInputSchema, +}).strict() + +export const JsonsUpdateArgsSchema: z.ZodType = z.object({ + select: JsonsSelectSchema.optional(), + data: z.union([ JsonsUpdateInputSchema,JsonsUncheckedUpdateInputSchema ]), + where: JsonsWhereUniqueInputSchema, +}).strict() + +export const JsonsUpdateManyArgsSchema: z.ZodType = z.object({ + data: z.union([ JsonsUpdateManyMutationInputSchema,JsonsUncheckedUpdateManyInputSchema ]), + where: JsonsWhereInputSchema.optional(), +}).strict() + +export const JsonsDeleteManyArgsSchema: z.ZodType = z.object({ + where: JsonsWhereInputSchema.optional(), +}).strict() + interface ItemsGetPayload extends HKT { readonly _A?: boolean | null | undefined | Prisma.ItemsArgs readonly type: Prisma.ItemsGetPayload @@ -2391,6 +2689,11 @@ interface FloatsGetPayload extends HKT { readonly type: Prisma.FloatsGetPayload } +interface JsonsGetPayload extends HKT { + readonly _A?: boolean | null | undefined | Prisma.JsonsArgs + readonly type: Prisma.JsonsGetPayload +} + export const tableSchemas = { items: { fields: new Map([ @@ -2718,7 +3021,49 @@ export const tableSchemas = { Prisma.FloatsScalarFieldEnum, FloatsGetPayload >, + jsons: { + fields: new Map([ + [ + "id", + "TEXT" + ], + /*[ + "js", + "JSON" + ],*/ + [ + "jsb", + "JSON" + ] + ]), + relations: [ + ], + modelSchema: (JsonsCreateInputSchema as any) + .partial() + .or((JsonsUncheckedCreateInputSchema as any).partial()), + createSchema: JsonsCreateArgsSchema, + createManySchema: JsonsCreateManyArgsSchema, + findUniqueSchema: JsonsFindUniqueArgsSchema, + findSchema: JsonsFindFirstArgsSchema, + updateSchema: JsonsUpdateArgsSchema, + updateManySchema: JsonsUpdateManyArgsSchema, + upsertSchema: JsonsUpsertArgsSchema, + deleteSchema: JsonsDeleteArgsSchema, + deleteManySchema: JsonsDeleteManyArgsSchema + } as TableSchema< + z.infer, + Prisma.JsonsCreateArgs['data'], + Prisma.JsonsUpdateArgs['data'], + Prisma.JsonsFindFirstArgs['select'], + Prisma.JsonsFindFirstArgs['where'], + Prisma.JsonsFindUniqueArgs['where'], + never, + Prisma.JsonsFindFirstArgs['orderBy'], + Prisma.JsonsScalarFieldEnum, + JsonsGetPayload + >, } export const schema = new DbSchema(tableSchemas, migrations) export type Electric = ElectricClient +export const JsonNull = { __is_electric_json_null__: true } diff --git a/e2e/satellite_client/src/generated/client/prismaClient.d.ts b/e2e/satellite_client/src/generated/client/prismaClient.d.ts new file mode 100644 index 0000000000..dcfa6b337a --- /dev/null +++ b/e2e/satellite_client/src/generated/client/prismaClient.d.ts @@ -0,0 +1,10605 @@ + +/** + * Client +**/ + +import * as runtime from './runtime/library'; +type UnwrapPromise

= P extends Promise ? R : P +type UnwrapTuple = { + [K in keyof Tuple]: K extends `${number}` ? Tuple[K] extends Prisma.PrismaPromise ? X : UnwrapPromise : UnwrapPromise +}; + +export type PrismaPromise = runtime.Types.Public.PrismaPromise + + +/** + * Model Items + * + */ +export type Items = { + id: string + content: string + content_text_null: string | null + content_text_null_default: string | null + intvalue_null: number | null + intvalue_null_default: number | null +} + +/** + * Model OtherItems + * + */ +export type OtherItems = { + id: string + content: string + item_id: string | null +} + +/** + * Model Timestamps + * + */ +export type Timestamps = { + id: string + created_at: Date + updated_at: Date +} + +/** + * Model Datetimes + * + */ +export type Datetimes = { + id: string + d: Date + t: Date +} + +/** + * Model Bools + * + */ +export type Bools = { + id: string + b: boolean | null +} + +/** + * Model Uuids + * + */ +export type Uuids = { + /** + * @zod.string.uuid() + */ + id: string +} + +/** + * Model Ints + * + */ +export type Ints = { + id: string + /** + * @zod.number.int().gte(-32768).lte(32767) + */ + i2: number | null + /** + * @zod.number.int().gte(-2147483648).lte(2147483647) + */ + i4: number | null +} + +/** + * Model Floats + * + */ +export type Floats = { + id: string + /** + * @zod.custom.use(z.number().or(z.nan())) + */ + f8: number | null +} + +/** + * Model Jsons + * + */ +export type Jsons = { + id: string + js: Prisma.JsonValue | null + jsb: Prisma.JsonValue | null +} + + +/** + * ## Prisma Client ʲˢ + * + * Type-safe database client for TypeScript & Node.js + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Items + * const items = await prisma.items.findMany() + * ``` + * + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export class PrismaClient< + T extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + U = 'log' extends keyof T ? T['log'] extends Array ? Prisma.GetEvents : never : never, + GlobalReject extends Prisma.RejectOnNotFound | Prisma.RejectPerOperation | false | undefined = 'rejectOnNotFound' extends keyof T + ? T['rejectOnNotFound'] + : false + > { + /** + * ## Prisma Client ʲˢ + * + * Type-safe database client for TypeScript & Node.js + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Items + * const items = await prisma.items.findMany() + * ``` + * + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + + constructor(optionsArg ?: Prisma.Subset); + $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : V extends 'beforeExit' ? () => Promise : Prisma.LogEvent) => void): void; + + /** + * Connect with the database + */ + $connect(): Promise; + + /** + * Disconnect from the database + */ + $disconnect(): Promise; + + /** + * Add a middleware + */ + $use(cb: Prisma.Middleware): void + +/** + * Executes a prepared raw query and returns the number of affected rows. + * @example + * ``` + * const result = await prisma.$executeRaw`UPDATE User SET cool = ${true} WHERE email = ${'user@email.com'};` + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $executeRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; + + /** + * Executes a raw query and returns the number of affected rows. + * Susceptible to SQL injections, see documentation. + * @example + * ``` + * const result = await prisma.$executeRawUnsafe('UPDATE User SET cool = $1 WHERE email = $2 ;', true, 'user@email.com') + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $executeRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; + + /** + * Performs a prepared raw query and returns the `SELECT` data. + * @example + * ``` + * const result = await prisma.$queryRaw`SELECT * FROM User WHERE id = ${1} OR email = ${'user@email.com'};` + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $queryRaw(query: TemplateStringsArray | Prisma.Sql, ...values: any[]): Prisma.PrismaPromise; + + /** + * Performs a raw query and returns the `SELECT` data. + * Susceptible to SQL injections, see documentation. + * @example + * ``` + * const result = await prisma.$queryRawUnsafe('SELECT * FROM User WHERE id = $1 OR email = $2;', 1, 'user@email.com') + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/raw-database-access). + */ + $queryRawUnsafe(query: string, ...values: any[]): Prisma.PrismaPromise; + + /** + * Allows the running of a sequence of read/write operations that are guaranteed to either succeed or fail as a whole. + * @example + * ``` + * const [george, bob, alice] = await prisma.$transaction([ + * prisma.user.create({ data: { name: 'George' } }), + * prisma.user.create({ data: { name: 'Bob' } }), + * prisma.user.create({ data: { name: 'Alice' } }), + * ]) + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/concepts/components/prisma-client/transactions). + */ + $transaction

[]>(arg: [...P], options?: { isolationLevel?: Prisma.TransactionIsolationLevel }): Promise> + + $transaction(fn: (prisma: Omit) => Promise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): Promise + + /** + * `prisma.items`: Exposes CRUD operations for the **Items** model. + * Example usage: + * ```ts + * // Fetch zero or more Items + * const items = await prisma.items.findMany() + * ``` + */ + get items(): Prisma.ItemsDelegate; + + /** + * `prisma.otherItems`: Exposes CRUD operations for the **OtherItems** model. + * Example usage: + * ```ts + * // Fetch zero or more OtherItems + * const otherItems = await prisma.otherItems.findMany() + * ``` + */ + get otherItems(): Prisma.OtherItemsDelegate; + + /** + * `prisma.timestamps`: Exposes CRUD operations for the **Timestamps** model. + * Example usage: + * ```ts + * // Fetch zero or more Timestamps + * const timestamps = await prisma.timestamps.findMany() + * ``` + */ + get timestamps(): Prisma.TimestampsDelegate; + + /** + * `prisma.datetimes`: Exposes CRUD operations for the **Datetimes** model. + * Example usage: + * ```ts + * // Fetch zero or more Datetimes + * const datetimes = await prisma.datetimes.findMany() + * ``` + */ + get datetimes(): Prisma.DatetimesDelegate; + + /** + * `prisma.bools`: Exposes CRUD operations for the **Bools** model. + * Example usage: + * ```ts + * // Fetch zero or more Bools + * const bools = await prisma.bools.findMany() + * ``` + */ + get bools(): Prisma.BoolsDelegate; + + /** + * `prisma.uuids`: Exposes CRUD operations for the **Uuids** model. + * Example usage: + * ```ts + * // Fetch zero or more Uuids + * const uuids = await prisma.uuids.findMany() + * ``` + */ + get uuids(): Prisma.UuidsDelegate; + + /** + * `prisma.ints`: Exposes CRUD operations for the **Ints** model. + * Example usage: + * ```ts + * // Fetch zero or more Ints + * const ints = await prisma.ints.findMany() + * ``` + */ + get ints(): Prisma.IntsDelegate; + + /** + * `prisma.floats`: Exposes CRUD operations for the **Floats** model. + * Example usage: + * ```ts + * // Fetch zero or more Floats + * const floats = await prisma.floats.findMany() + * ``` + */ + get floats(): Prisma.FloatsDelegate; + + /** + * `prisma.jsons`: Exposes CRUD operations for the **Jsons** model. + * Example usage: + * ```ts + * // Fetch zero or more Jsons + * const jsons = await prisma.jsons.findMany() + * ``` + */ + get jsons(): Prisma.JsonsDelegate; +} + +export namespace Prisma { + export import DMMF = runtime.DMMF + + export type PrismaPromise = runtime.Types.Public.PrismaPromise + + /** + * Prisma Errors + */ + export import PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + export import PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + export import PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + export import PrismaClientInitializationError = runtime.PrismaClientInitializationError + export import PrismaClientValidationError = runtime.PrismaClientValidationError + export import NotFoundError = runtime.NotFoundError + + /** + * Re-export of sql-template-tag + */ + export import sql = runtime.sqltag + export import empty = runtime.empty + export import join = runtime.join + export import raw = runtime.raw + export import Sql = runtime.Sql + + /** + * Decimal.js + */ + export import Decimal = runtime.Decimal + + export type DecimalJsLike = runtime.DecimalJsLike + + /** + * Metrics + */ + export type Metrics = runtime.Metrics + export type Metric = runtime.Metric + export type MetricHistogram = runtime.MetricHistogram + export type MetricHistogramBucket = runtime.MetricHistogramBucket + + + /** + * Prisma Client JS version: 4.15.0 + * Query Engine version: 8fbc245156db7124f997f4cecdd8d1219e360944 + */ + export type PrismaVersion = { + client: string + } + + export const prismaVersion: PrismaVersion + + /** + * Utility Types + */ + + /** + * From https://github.com/sindresorhus/type-fest/ + * Matches a JSON object. + * This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. + */ + export type JsonObject = {[Key in string]?: JsonValue} + + /** + * From https://github.com/sindresorhus/type-fest/ + * Matches a JSON array. + */ + export interface JsonArray extends Array {} + + /** + * From https://github.com/sindresorhus/type-fest/ + * Matches any valid JSON value. + */ + export type JsonValue = string | number | boolean | JsonObject | JsonArray | null + + /** + * Matches a JSON object. + * Unlike `JsonObject`, this type allows undefined and read-only properties. + */ + export type InputJsonObject = {readonly [Key in string]?: InputJsonValue | null} + + /** + * Matches a JSON array. + * Unlike `JsonArray`, readonly arrays are assignable to this type. + */ + export interface InputJsonArray extends ReadonlyArray {} + + /** + * Matches any valid value that can be used as an input for operations like + * create and update as the value of a JSON field. Unlike `JsonValue`, this + * type allows read-only arrays and read-only object properties and disallows + * `null` at the top level. + * + * `null` cannot be used as the value of a JSON field because its meaning + * would be ambiguous. Use `Prisma.JsonNull` to store the JSON null value or + * `Prisma.DbNull` to clear the JSON value and set the field to the database + * NULL value instead. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-by-null-values + */ + export type InputJsonValue = null | string | number | boolean | InputJsonObject | InputJsonArray + + /** + * Types of the values used to represent different kinds of `null` values when working with JSON fields. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + namespace NullTypes { + /** + * Type of `Prisma.DbNull`. + * + * You cannot use other instances of this class. Please use the `Prisma.DbNull` value. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + class DbNull { + private DbNull: never + private constructor() + } + + /** + * Type of `Prisma.JsonNull`. + * + * You cannot use other instances of this class. Please use the `Prisma.JsonNull` value. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + class JsonNull { + private JsonNull: never + private constructor() + } + + /** + * Type of `Prisma.AnyNull`. + * + * You cannot use other instances of this class. Please use the `Prisma.AnyNull` value. + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + class AnyNull { + private AnyNull: never + private constructor() + } + } + + /** + * Helper for filtering JSON entries that have `null` on the database (empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const DbNull: NullTypes.DbNull + + /** + * Helper for filtering JSON entries that have JSON `null` values (not empty on the db) + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const JsonNull: NullTypes.JsonNull + + /** + * Helper for filtering JSON entries that are `Prisma.DbNull` or `Prisma.JsonNull` + * + * @see https://www.prisma.io/docs/concepts/components/prisma-client/working-with-fields/working-with-json-fields#filtering-on-a-json-field + */ + export const AnyNull: NullTypes.AnyNull + + type SelectAndInclude = { + select: any + include: any + } + type HasSelect = { + select: any + } + type HasInclude = { + include: any + } + type CheckSelect = T extends SelectAndInclude + ? 'Please either choose `select` or `include`' + : T extends HasSelect + ? U + : T extends HasInclude + ? U + : S + + /** + * Get the type of the value, that the Promise holds. + */ + export type PromiseType> = T extends PromiseLike ? U : T; + + /** + * Get the return type of a function which returns a Promise. + */ + export type PromiseReturnType Promise> = PromiseType> + + /** + * From T, pick a set of properties whose keys are in the union K + */ + type Prisma__Pick = { + [P in K]: T[P]; + }; + + + export type Enumerable = T | Array; + + export type RequiredKeys = { + [K in keyof T]-?: {} extends Prisma__Pick ? never : K + }[keyof T] + + export type TruthyKeys = keyof { + [K in keyof T as T[K] extends false | undefined | null ? never : K]: K + } + + export type TrueKeys = TruthyKeys>> + + /** + * Subset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection + */ + export type Subset = { + [key in keyof T]: key extends keyof U ? T[key] : never; + }; + + /** + * SelectSubset + * @desc From `T` pick properties that exist in `U`. Simple version of Intersection. + * Additionally, it validates, if both select and include are present. If the case, it errors. + */ + export type SelectSubset = { + [key in keyof T]: key extends keyof U ? T[key] : never + } & + (T extends SelectAndInclude + ? 'Please either choose `select` or `include`.' + : {}) + + /** + * Subset + Intersection + * @desc From `T` pick properties that exist in `U` and intersect `K` + */ + export type SubsetIntersection = { + [key in keyof T]: key extends keyof U ? T[key] : never + } & + K + + type Without = { [P in Exclude]?: never }; + + /** + * XOR is needed to have a real mutually exclusive union type + * https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types + */ + type XOR = + T extends object ? + U extends object ? + (Without & U) | (Without & T) + : U : T + + + /** + * Is T a Record? + */ + type IsObject = T extends Array + ? False + : T extends Date + ? False + : T extends Uint8Array + ? False + : T extends BigInt + ? False + : T extends object + ? True + : False + + + /** + * If it's T[], return T + */ + export type UnEnumerate = T extends Array ? U : T + + /** + * From ts-toolbelt + */ + + type __Either = Omit & + { + // Merge all but K + [P in K]: Prisma__Pick // With K possibilities + }[K] + + type EitherStrict = Strict<__Either> + + type EitherLoose = ComputeRaw<__Either> + + type _Either< + O extends object, + K extends Key, + strict extends Boolean + > = { + 1: EitherStrict + 0: EitherLoose + }[strict] + + type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 + > = O extends unknown ? _Either : never + + export type Union = any + + type PatchUndefined = { + [K in keyof O]: O[K] extends undefined ? At : O[K] + } & {} + + /** Helper Types for "Merge" **/ + export type IntersectOf = ( + U extends unknown ? (k: U) => void : never + ) extends (k: infer I) => void + ? I + : never + + export type Overwrite = { + [K in keyof O]: K extends keyof O1 ? O1[K] : O[K]; + } & {}; + + type _Merge = IntersectOf; + }>>; + + type Key = string | number | symbol; + type AtBasic = K extends keyof O ? O[K] : never; + type AtStrict = O[K & keyof O]; + type AtLoose = O extends unknown ? AtStrict : never; + export type At = { + 1: AtStrict; + 0: AtLoose; + }[strict]; + + export type ComputeRaw = A extends Function ? A : { + [K in keyof A]: A[K]; + } & {}; + + export type OptionalFlat = { + [K in keyof O]?: O[K]; + } & {}; + + type _Record = { + [P in K]: T; + }; + + // cause typescript not to expand types and preserve names + type NoExpand = T extends unknown ? T : never; + + // this type assumes the passed object is entirely optional + type AtLeast = NoExpand< + O extends unknown + ? | (K extends keyof O ? { [P in K]: O[P] } & O : O) + | {[P in keyof O as P extends K ? K : never]-?: O[P]} & O + : never>; + + type _Strict = U extends unknown ? U & OptionalFlat<_Record, keyof U>, never>> : never; + + export type Strict = ComputeRaw<_Strict>; + /** End Helper Types for "Merge" **/ + + export type Merge = ComputeRaw<_Merge>>; + + /** + A [[Boolean]] + */ + export type Boolean = True | False + + // /** + // 1 + // */ + export type True = 1 + + /** + 0 + */ + export type False = 0 + + export type Not = { + 0: 1 + 1: 0 + }[B] + + export type Extends = [A1] extends [never] + ? 0 // anything `never` is false + : A1 extends A2 + ? 1 + : 0 + + export type Has = Not< + Extends, U1> + > + + export type Or = { + 0: { + 0: 0 + 1: 1 + } + 1: { + 0: 1 + 1: 1 + } + }[B1][B2] + + export type Keys = U extends unknown ? keyof U : never + + type Cast = A extends B ? A : B; + + export const type: unique symbol; + + export function validator(): (select: runtime.Types.Utils.LegacyExact) => S; + + /** + * Used by group by + */ + + export type GetScalarType = O extends object ? { + [P in keyof T]: P extends keyof O + ? O[P] + : never + } : never + + type FieldPaths< + T, + U = Omit + > = IsObject extends True ? U : T + + type GetHavingFields = { + [K in keyof T]: Or< + Or, Extends<'AND', K>>, + Extends<'NOT', K> + > extends True + ? // infer is only needed to not hit TS limit + // based on the brilliant idea of Pierre-Antoine Mills + // https://github.com/microsoft/TypeScript/issues/30188#issuecomment-478938437 + T[K] extends infer TK + ? GetHavingFields extends object ? Merge> : never> + : never + : {} extends FieldPaths + ? never + : K + }[keyof T] + + /** + * Convert tuple to union + */ + type _TupleToUnion = T extends (infer E)[] ? E : never + type TupleToUnion = _TupleToUnion + type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + + /** + * Like `Pick`, but with an array + */ + type PickArray> = Prisma__Pick> + + /** + * Exclude all keys with underscores + */ + type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + + export type FieldRef = runtime.FieldRef + + type FieldRefInputType = Model extends never ? never : FieldRef + + + export const ModelName: { + Items: 'Items', + OtherItems: 'OtherItems', + Timestamps: 'Timestamps', + Datetimes: 'Datetimes', + Bools: 'Bools', + Uuids: 'Uuids', + Ints: 'Ints', + Floats: 'Floats', + Jsons: 'Jsons' + }; + + export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + export type Datasources = { + db?: Datasource + } + + export type DefaultPrismaClient = PrismaClient + export type RejectOnNotFound = boolean | ((error: Error) => Error) + export type RejectPerModel = { [P in ModelName]?: RejectOnNotFound } + export type RejectPerOperation = { [P in "findUnique" | "findFirst"]?: RejectPerModel | RejectOnNotFound } + type IsReject = T extends true ? True : T extends (err: Error) => Error ? True : False + export type HasReject< + GlobalRejectSettings extends Prisma.PrismaClientOptions['rejectOnNotFound'], + LocalRejectSettings, + Action extends PrismaAction, + Model extends ModelName + > = LocalRejectSettings extends RejectOnNotFound + ? IsReject + : GlobalRejectSettings extends RejectPerOperation + ? Action extends keyof GlobalRejectSettings + ? GlobalRejectSettings[Action] extends RejectOnNotFound + ? IsReject + : GlobalRejectSettings[Action] extends RejectPerModel + ? Model extends keyof GlobalRejectSettings[Action] + ? IsReject + : False + : False + : False + : IsReject + export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' + + export interface PrismaClientOptions { + /** + * Configure findUnique/findFirst to throw an error if the query returns null. + * @deprecated since 4.0.0. Use `findUniqueOrThrow`/`findFirstOrThrow` methods instead. + * @example + * ``` + * // Reject on both findUnique/findFirst + * rejectOnNotFound: true + * // Reject only on findFirst with a custom error + * rejectOnNotFound: { findFirst: (err) => new Error("Custom Error")} + * // Reject on user.findUnique with a custom error + * rejectOnNotFound: { findUnique: {User: (err) => new Error("User not found")}} + * ``` + */ + rejectOnNotFound?: RejectOnNotFound | RejectPerOperation + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources + + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + + /** + * @example + * ``` + * // Defaults to stdout + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events + * log: [ + * { emit: 'stdout', level: 'query' }, + * { emit: 'stdout', level: 'info' }, + * { emit: 'stdout', level: 'warn' } + * { emit: 'stdout', level: 'error' } + * ] + * ``` + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client/logging#the-log-option). + */ + log?: Array + } + + /* Types for Logging */ + export type LogLevel = 'info' | 'query' | 'warn' | 'error' + export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' + } + + export type GetLogType = T extends LogDefinition ? T['emit'] extends 'event' ? T['level'] : never : never + export type GetEvents = T extends Array ? + GetLogType | GetLogType | GetLogType | GetLogType + : never + + export type QueryEvent = { + timestamp: Date + query: string + params: string + duration: number + target: string + } + + export type LogEvent = { + timestamp: Date + message: string + target: string + } + /* End Types for Logging */ + + + export type PrismaAction = + | 'findUnique' + | 'findMany' + | 'findFirst' + | 'create' + | 'createMany' + | 'update' + | 'updateMany' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + + /** + * These options are being passed into the middleware as "params" + */ + export type MiddlewareParams = { + model?: ModelName + action: PrismaAction + args: any + dataPath: string[] + runInTransaction: boolean + } + + /** + * The `T` type makes sure, that the `return proceed` is not forgotten in the middleware implementation + */ + export type Middleware = ( + params: MiddlewareParams, + next: (params: MiddlewareParams) => Promise, + ) => Promise + + // tested in getLogLevel.test.ts + export function getLogLevel(log: Array): LogLevel | undefined; + + /** + * `PrismaClient` proxy available in interactive transactions. + */ + export type TransactionClient = Omit + + export type Datasource = { + url?: string + } + + /** + * Count Types + */ + + + + /** + * Models + */ + + /** + * Model Items + */ + + + export type AggregateItems = { + _count: ItemsCountAggregateOutputType | null + _avg: ItemsAvgAggregateOutputType | null + _sum: ItemsSumAggregateOutputType | null + _min: ItemsMinAggregateOutputType | null + _max: ItemsMaxAggregateOutputType | null + } + + export type ItemsAvgAggregateOutputType = { + intvalue_null: number | null + intvalue_null_default: number | null + } + + export type ItemsSumAggregateOutputType = { + intvalue_null: number | null + intvalue_null_default: number | null + } + + export type ItemsMinAggregateOutputType = { + id: string | null + content: string | null + content_text_null: string | null + content_text_null_default: string | null + intvalue_null: number | null + intvalue_null_default: number | null + } + + export type ItemsMaxAggregateOutputType = { + id: string | null + content: string | null + content_text_null: string | null + content_text_null_default: string | null + intvalue_null: number | null + intvalue_null_default: number | null + } + + export type ItemsCountAggregateOutputType = { + id: number + content: number + content_text_null: number + content_text_null_default: number + intvalue_null: number + intvalue_null_default: number + _all: number + } + + + export type ItemsAvgAggregateInputType = { + intvalue_null?: true + intvalue_null_default?: true + } + + export type ItemsSumAggregateInputType = { + intvalue_null?: true + intvalue_null_default?: true + } + + export type ItemsMinAggregateInputType = { + id?: true + content?: true + content_text_null?: true + content_text_null_default?: true + intvalue_null?: true + intvalue_null_default?: true + } + + export type ItemsMaxAggregateInputType = { + id?: true + content?: true + content_text_null?: true + content_text_null_default?: true + intvalue_null?: true + intvalue_null_default?: true + } + + export type ItemsCountAggregateInputType = { + id?: true + content?: true + content_text_null?: true + content_text_null_default?: true + intvalue_null?: true + intvalue_null_default?: true + _all?: true + } + + export type ItemsAggregateArgs = { + /** + * Filter which Items to aggregate. + */ + where?: ItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Items to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: ItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Items from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Items. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Items + **/ + _count?: true | ItemsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: ItemsAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: ItemsSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: ItemsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: ItemsMaxAggregateInputType + } + + export type GetItemsAggregateType = { + [P in keyof T & keyof AggregateItems]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type ItemsGroupByArgs = { + where?: ItemsWhereInput + orderBy?: Enumerable + by: ItemsScalarFieldEnum[] + having?: ItemsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: ItemsCountAggregateInputType | true + _avg?: ItemsAvgAggregateInputType + _sum?: ItemsSumAggregateInputType + _min?: ItemsMinAggregateInputType + _max?: ItemsMaxAggregateInputType + } + + + export type ItemsGroupByOutputType = { + id: string + content: string + content_text_null: string | null + content_text_null_default: string | null + intvalue_null: number | null + intvalue_null_default: number | null + _count: ItemsCountAggregateOutputType | null + _avg: ItemsAvgAggregateOutputType | null + _sum: ItemsSumAggregateOutputType | null + _min: ItemsMinAggregateOutputType | null + _max: ItemsMaxAggregateOutputType | null + } + + type GetItemsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof ItemsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type ItemsSelect = { + id?: boolean + content?: boolean + content_text_null?: boolean + content_text_null_default?: boolean + intvalue_null?: boolean + intvalue_null_default?: boolean + other_items?: boolean | OtherItemsArgs + } + + + export type ItemsInclude = { + other_items?: boolean | OtherItemsArgs + } + + export type ItemsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Items : + S extends undefined ? never : + S extends { include: any } & (ItemsArgs | ItemsFindManyArgs) + ? Items & { + [P in TruthyKeys]: + P extends 'other_items' ? OtherItemsGetPayload | null : never + } + : S extends { select: any } & (ItemsArgs | ItemsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends 'other_items' ? OtherItemsGetPayload | null : P extends keyof Items ? Items[P] : never + } + : Items + + + type ItemsCountArgs = + Omit & { + select?: ItemsCountAggregateInputType | true + } + + export interface ItemsDelegate { + + /** + * Find zero or one Items that matches the filter. + * @param {ItemsFindUniqueArgs} args - Arguments to find a Items + * @example + * // Get one Items + * const items = await prisma.items.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__ItemsClient> : Prisma__ItemsClient | null, null> + + /** + * Find one Items that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {ItemsFindUniqueOrThrowArgs} args - Arguments to find a Items + * @example + * // Get one Items + * const items = await prisma.items.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__ItemsClient> + + /** + * Find the first Items that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsFindFirstArgs} args - Arguments to find a Items + * @example + * // Get one Items + * const items = await prisma.items.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__ItemsClient> : Prisma__ItemsClient | null, null> + + /** + * Find the first Items that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsFindFirstOrThrowArgs} args - Arguments to find a Items + * @example + * // Get one Items + * const items = await prisma.items.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__ItemsClient> + + /** + * Find zero or more Items that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Items + * const items = await prisma.items.findMany() + * + * // Get first 10 Items + * const items = await prisma.items.findMany({ take: 10 }) + * + * // Only select the `id` + * const itemsWithIdOnly = await prisma.items.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Items. + * @param {ItemsCreateArgs} args - Arguments to create a Items. + * @example + * // Create one Items + * const Items = await prisma.items.create({ + * data: { + * // ... data to create a Items + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__ItemsClient> + + /** + * Create many Items. + * @param {ItemsCreateManyArgs} args - Arguments to create many Items. + * @example + * // Create many Items + * const items = await prisma.items.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Items. + * @param {ItemsDeleteArgs} args - Arguments to delete one Items. + * @example + * // Delete one Items + * const Items = await prisma.items.delete({ + * where: { + * // ... filter to delete one Items + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__ItemsClient> + + /** + * Update one Items. + * @param {ItemsUpdateArgs} args - Arguments to update one Items. + * @example + * // Update one Items + * const items = await prisma.items.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__ItemsClient> + + /** + * Delete zero or more Items. + * @param {ItemsDeleteManyArgs} args - Arguments to filter Items to delete. + * @example + * // Delete a few Items + * const { count } = await prisma.items.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Items. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Items + * const items = await prisma.items.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Items. + * @param {ItemsUpsertArgs} args - Arguments to update or create a Items. + * @example + * // Update or create a Items + * const items = await prisma.items.upsert({ + * create: { + * // ... data to create a Items + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Items we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__ItemsClient> + + /** + * Count the number of Items. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsCountArgs} args - Arguments to filter Items to count. + * @example + * // Count the number of Items + * const count = await prisma.items.count({ + * where: { + * // ... the filter for the Items we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Items. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Items. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {ItemsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends ItemsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: ItemsGroupByArgs['orderBy'] } + : { orderBy?: ItemsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetItemsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Items. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__ItemsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + other_items(args?: Subset): Prisma__OtherItemsClient | Null>; + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * Items base type for findUnique actions + */ + export type ItemsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where: ItemsWhereUniqueInput + } + + /** + * Items findUnique + */ + export interface ItemsFindUniqueArgs extends ItemsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Items findUniqueOrThrow + */ + export type ItemsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where: ItemsWhereUniqueInput + } + + + /** + * Items base type for findFirst actions + */ + export type ItemsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where?: ItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Items to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Items. + */ + cursor?: ItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Items from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Items. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Items. + */ + distinct?: Enumerable + } + + /** + * Items findFirst + */ + export interface ItemsFindFirstArgs extends ItemsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Items findFirstOrThrow + */ + export type ItemsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where?: ItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Items to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Items. + */ + cursor?: ItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Items from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Items. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Items. + */ + distinct?: Enumerable + } + + + /** + * Items findMany + */ + export type ItemsFindManyArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter, which Items to fetch. + */ + where?: ItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Items to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Items. + */ + cursor?: ItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Items from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Items. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Items create + */ + export type ItemsCreateArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * The data needed to create a Items. + */ + data: XOR + } + + + /** + * Items createMany + */ + export type ItemsCreateManyArgs = { + /** + * The data used to create many Items. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Items update + */ + export type ItemsUpdateArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * The data needed to update a Items. + */ + data: XOR + /** + * Choose, which Items to update. + */ + where: ItemsWhereUniqueInput + } + + + /** + * Items updateMany + */ + export type ItemsUpdateManyArgs = { + /** + * The data used to update Items. + */ + data: XOR + /** + * Filter which Items to update + */ + where?: ItemsWhereInput + } + + + /** + * Items upsert + */ + export type ItemsUpsertArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * The filter to search for the Items to update in case it exists. + */ + where: ItemsWhereUniqueInput + /** + * In case the Items found by the `where` argument doesn't exist, create a new Items with this data. + */ + create: XOR + /** + * In case the Items was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Items delete + */ + export type ItemsDeleteArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + /** + * Filter which Items to delete. + */ + where: ItemsWhereUniqueInput + } + + + /** + * Items deleteMany + */ + export type ItemsDeleteManyArgs = { + /** + * Filter which Items to delete + */ + where?: ItemsWhereInput + } + + + /** + * Items without action + */ + export type ItemsArgs = { + /** + * Select specific fields to fetch from the Items + */ + select?: ItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: ItemsInclude | null + } + + + + /** + * Model OtherItems + */ + + + export type AggregateOtherItems = { + _count: OtherItemsCountAggregateOutputType | null + _min: OtherItemsMinAggregateOutputType | null + _max: OtherItemsMaxAggregateOutputType | null + } + + export type OtherItemsMinAggregateOutputType = { + id: string | null + content: string | null + item_id: string | null + } + + export type OtherItemsMaxAggregateOutputType = { + id: string | null + content: string | null + item_id: string | null + } + + export type OtherItemsCountAggregateOutputType = { + id: number + content: number + item_id: number + _all: number + } + + + export type OtherItemsMinAggregateInputType = { + id?: true + content?: true + item_id?: true + } + + export type OtherItemsMaxAggregateInputType = { + id?: true + content?: true + item_id?: true + } + + export type OtherItemsCountAggregateInputType = { + id?: true + content?: true + item_id?: true + _all?: true + } + + export type OtherItemsAggregateArgs = { + /** + * Filter which OtherItems to aggregate. + */ + where?: OtherItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OtherItems to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: OtherItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OtherItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` OtherItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned OtherItems + **/ + _count?: true | OtherItemsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: OtherItemsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: OtherItemsMaxAggregateInputType + } + + export type GetOtherItemsAggregateType = { + [P in keyof T & keyof AggregateOtherItems]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type OtherItemsGroupByArgs = { + where?: OtherItemsWhereInput + orderBy?: Enumerable + by: OtherItemsScalarFieldEnum[] + having?: OtherItemsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: OtherItemsCountAggregateInputType | true + _min?: OtherItemsMinAggregateInputType + _max?: OtherItemsMaxAggregateInputType + } + + + export type OtherItemsGroupByOutputType = { + id: string + content: string + item_id: string | null + _count: OtherItemsCountAggregateOutputType | null + _min: OtherItemsMinAggregateOutputType | null + _max: OtherItemsMaxAggregateOutputType | null + } + + type GetOtherItemsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof OtherItemsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type OtherItemsSelect = { + id?: boolean + content?: boolean + item_id?: boolean + items?: boolean | ItemsArgs + } + + + export type OtherItemsInclude = { + items?: boolean | ItemsArgs + } + + export type OtherItemsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? OtherItems : + S extends undefined ? never : + S extends { include: any } & (OtherItemsArgs | OtherItemsFindManyArgs) + ? OtherItems & { + [P in TruthyKeys]: + P extends 'items' ? ItemsGetPayload | null : never + } + : S extends { select: any } & (OtherItemsArgs | OtherItemsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends 'items' ? ItemsGetPayload | null : P extends keyof OtherItems ? OtherItems[P] : never + } + : OtherItems + + + type OtherItemsCountArgs = + Omit & { + select?: OtherItemsCountAggregateInputType | true + } + + export interface OtherItemsDelegate { + + /** + * Find zero or one OtherItems that matches the filter. + * @param {OtherItemsFindUniqueArgs} args - Arguments to find a OtherItems + * @example + * // Get one OtherItems + * const otherItems = await prisma.otherItems.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__OtherItemsClient> : Prisma__OtherItemsClient | null, null> + + /** + * Find one OtherItems that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {OtherItemsFindUniqueOrThrowArgs} args - Arguments to find a OtherItems + * @example + * // Get one OtherItems + * const otherItems = await prisma.otherItems.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Find the first OtherItems that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsFindFirstArgs} args - Arguments to find a OtherItems + * @example + * // Get one OtherItems + * const otherItems = await prisma.otherItems.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__OtherItemsClient> : Prisma__OtherItemsClient | null, null> + + /** + * Find the first OtherItems that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsFindFirstOrThrowArgs} args - Arguments to find a OtherItems + * @example + * // Get one OtherItems + * const otherItems = await prisma.otherItems.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Find zero or more OtherItems that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all OtherItems + * const otherItems = await prisma.otherItems.findMany() + * + * // Get first 10 OtherItems + * const otherItems = await prisma.otherItems.findMany({ take: 10 }) + * + * // Only select the `id` + * const otherItemsWithIdOnly = await prisma.otherItems.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a OtherItems. + * @param {OtherItemsCreateArgs} args - Arguments to create a OtherItems. + * @example + * // Create one OtherItems + * const OtherItems = await prisma.otherItems.create({ + * data: { + * // ... data to create a OtherItems + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Create many OtherItems. + * @param {OtherItemsCreateManyArgs} args - Arguments to create many OtherItems. + * @example + * // Create many OtherItems + * const otherItems = await prisma.otherItems.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a OtherItems. + * @param {OtherItemsDeleteArgs} args - Arguments to delete one OtherItems. + * @example + * // Delete one OtherItems + * const OtherItems = await prisma.otherItems.delete({ + * where: { + * // ... filter to delete one OtherItems + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Update one OtherItems. + * @param {OtherItemsUpdateArgs} args - Arguments to update one OtherItems. + * @example + * // Update one OtherItems + * const otherItems = await prisma.otherItems.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Delete zero or more OtherItems. + * @param {OtherItemsDeleteManyArgs} args - Arguments to filter OtherItems to delete. + * @example + * // Delete a few OtherItems + * const { count } = await prisma.otherItems.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more OtherItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many OtherItems + * const otherItems = await prisma.otherItems.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one OtherItems. + * @param {OtherItemsUpsertArgs} args - Arguments to update or create a OtherItems. + * @example + * // Update or create a OtherItems + * const otherItems = await prisma.otherItems.upsert({ + * create: { + * // ... data to create a OtherItems + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the OtherItems we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__OtherItemsClient> + + /** + * Count the number of OtherItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsCountArgs} args - Arguments to filter OtherItems to count. + * @example + * // Count the number of OtherItems + * const count = await prisma.otherItems.count({ + * where: { + * // ... the filter for the OtherItems we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a OtherItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by OtherItems. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {OtherItemsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends OtherItemsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: OtherItemsGroupByArgs['orderBy'] } + : { orderBy?: OtherItemsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetOtherItemsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for OtherItems. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__OtherItemsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + items(args?: Subset): Prisma__ItemsClient | Null>; + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * OtherItems base type for findUnique actions + */ + export type OtherItemsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where: OtherItemsWhereUniqueInput + } + + /** + * OtherItems findUnique + */ + export interface OtherItemsFindUniqueArgs extends OtherItemsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * OtherItems findUniqueOrThrow + */ + export type OtherItemsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where: OtherItemsWhereUniqueInput + } + + + /** + * OtherItems base type for findFirst actions + */ + export type OtherItemsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where?: OtherItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OtherItems to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for OtherItems. + */ + cursor?: OtherItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OtherItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` OtherItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OtherItems. + */ + distinct?: Enumerable + } + + /** + * OtherItems findFirst + */ + export interface OtherItemsFindFirstArgs extends OtherItemsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * OtherItems findFirstOrThrow + */ + export type OtherItemsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where?: OtherItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OtherItems to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for OtherItems. + */ + cursor?: OtherItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OtherItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` OtherItems. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of OtherItems. + */ + distinct?: Enumerable + } + + + /** + * OtherItems findMany + */ + export type OtherItemsFindManyArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter, which OtherItems to fetch. + */ + where?: OtherItemsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of OtherItems to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing OtherItems. + */ + cursor?: OtherItemsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` OtherItems from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` OtherItems. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * OtherItems create + */ + export type OtherItemsCreateArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * The data needed to create a OtherItems. + */ + data: XOR + } + + + /** + * OtherItems createMany + */ + export type OtherItemsCreateManyArgs = { + /** + * The data used to create many OtherItems. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * OtherItems update + */ + export type OtherItemsUpdateArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * The data needed to update a OtherItems. + */ + data: XOR + /** + * Choose, which OtherItems to update. + */ + where: OtherItemsWhereUniqueInput + } + + + /** + * OtherItems updateMany + */ + export type OtherItemsUpdateManyArgs = { + /** + * The data used to update OtherItems. + */ + data: XOR + /** + * Filter which OtherItems to update + */ + where?: OtherItemsWhereInput + } + + + /** + * OtherItems upsert + */ + export type OtherItemsUpsertArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * The filter to search for the OtherItems to update in case it exists. + */ + where: OtherItemsWhereUniqueInput + /** + * In case the OtherItems found by the `where` argument doesn't exist, create a new OtherItems with this data. + */ + create: XOR + /** + * In case the OtherItems was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * OtherItems delete + */ + export type OtherItemsDeleteArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + /** + * Filter which OtherItems to delete. + */ + where: OtherItemsWhereUniqueInput + } + + + /** + * OtherItems deleteMany + */ + export type OtherItemsDeleteManyArgs = { + /** + * Filter which OtherItems to delete + */ + where?: OtherItemsWhereInput + } + + + /** + * OtherItems without action + */ + export type OtherItemsArgs = { + /** + * Select specific fields to fetch from the OtherItems + */ + select?: OtherItemsSelect | null + /** + * Choose, which related nodes to fetch as well. + */ + include?: OtherItemsInclude | null + } + + + + /** + * Model Timestamps + */ + + + export type AggregateTimestamps = { + _count: TimestampsCountAggregateOutputType | null + _min: TimestampsMinAggregateOutputType | null + _max: TimestampsMaxAggregateOutputType | null + } + + export type TimestampsMinAggregateOutputType = { + id: string | null + created_at: Date | null + updated_at: Date | null + } + + export type TimestampsMaxAggregateOutputType = { + id: string | null + created_at: Date | null + updated_at: Date | null + } + + export type TimestampsCountAggregateOutputType = { + id: number + created_at: number + updated_at: number + _all: number + } + + + export type TimestampsMinAggregateInputType = { + id?: true + created_at?: true + updated_at?: true + } + + export type TimestampsMaxAggregateInputType = { + id?: true + created_at?: true + updated_at?: true + } + + export type TimestampsCountAggregateInputType = { + id?: true + created_at?: true + updated_at?: true + _all?: true + } + + export type TimestampsAggregateArgs = { + /** + * Filter which Timestamps to aggregate. + */ + where?: TimestampsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Timestamps to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: TimestampsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Timestamps from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Timestamps. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Timestamps + **/ + _count?: true | TimestampsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TimestampsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TimestampsMaxAggregateInputType + } + + export type GetTimestampsAggregateType = { + [P in keyof T & keyof AggregateTimestamps]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type TimestampsGroupByArgs = { + where?: TimestampsWhereInput + orderBy?: Enumerable + by: TimestampsScalarFieldEnum[] + having?: TimestampsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TimestampsCountAggregateInputType | true + _min?: TimestampsMinAggregateInputType + _max?: TimestampsMaxAggregateInputType + } + + + export type TimestampsGroupByOutputType = { + id: string + created_at: Date + updated_at: Date + _count: TimestampsCountAggregateOutputType | null + _min: TimestampsMinAggregateOutputType | null + _max: TimestampsMaxAggregateOutputType | null + } + + type GetTimestampsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof TimestampsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type TimestampsSelect = { + id?: boolean + created_at?: boolean + updated_at?: boolean + } + + + export type TimestampsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Timestamps : + S extends undefined ? never : + S extends { include: any } & (TimestampsArgs | TimestampsFindManyArgs) + ? Timestamps + : S extends { select: any } & (TimestampsArgs | TimestampsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Timestamps ? Timestamps[P] : never + } + : Timestamps + + + type TimestampsCountArgs = + Omit & { + select?: TimestampsCountAggregateInputType | true + } + + export interface TimestampsDelegate { + + /** + * Find zero or one Timestamps that matches the filter. + * @param {TimestampsFindUniqueArgs} args - Arguments to find a Timestamps + * @example + * // Get one Timestamps + * const timestamps = await prisma.timestamps.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__TimestampsClient> : Prisma__TimestampsClient | null, null> + + /** + * Find one Timestamps that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {TimestampsFindUniqueOrThrowArgs} args - Arguments to find a Timestamps + * @example + * // Get one Timestamps + * const timestamps = await prisma.timestamps.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Find the first Timestamps that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsFindFirstArgs} args - Arguments to find a Timestamps + * @example + * // Get one Timestamps + * const timestamps = await prisma.timestamps.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__TimestampsClient> : Prisma__TimestampsClient | null, null> + + /** + * Find the first Timestamps that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsFindFirstOrThrowArgs} args - Arguments to find a Timestamps + * @example + * // Get one Timestamps + * const timestamps = await prisma.timestamps.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Find zero or more Timestamps that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Timestamps + * const timestamps = await prisma.timestamps.findMany() + * + * // Get first 10 Timestamps + * const timestamps = await prisma.timestamps.findMany({ take: 10 }) + * + * // Only select the `id` + * const timestampsWithIdOnly = await prisma.timestamps.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Timestamps. + * @param {TimestampsCreateArgs} args - Arguments to create a Timestamps. + * @example + * // Create one Timestamps + * const Timestamps = await prisma.timestamps.create({ + * data: { + * // ... data to create a Timestamps + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Create many Timestamps. + * @param {TimestampsCreateManyArgs} args - Arguments to create many Timestamps. + * @example + * // Create many Timestamps + * const timestamps = await prisma.timestamps.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Timestamps. + * @param {TimestampsDeleteArgs} args - Arguments to delete one Timestamps. + * @example + * // Delete one Timestamps + * const Timestamps = await prisma.timestamps.delete({ + * where: { + * // ... filter to delete one Timestamps + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Update one Timestamps. + * @param {TimestampsUpdateArgs} args - Arguments to update one Timestamps. + * @example + * // Update one Timestamps + * const timestamps = await prisma.timestamps.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Delete zero or more Timestamps. + * @param {TimestampsDeleteManyArgs} args - Arguments to filter Timestamps to delete. + * @example + * // Delete a few Timestamps + * const { count } = await prisma.timestamps.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Timestamps. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Timestamps + * const timestamps = await prisma.timestamps.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Timestamps. + * @param {TimestampsUpsertArgs} args - Arguments to update or create a Timestamps. + * @example + * // Update or create a Timestamps + * const timestamps = await prisma.timestamps.upsert({ + * create: { + * // ... data to create a Timestamps + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Timestamps we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__TimestampsClient> + + /** + * Count the number of Timestamps. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsCountArgs} args - Arguments to filter Timestamps to count. + * @example + * // Count the number of Timestamps + * const count = await prisma.timestamps.count({ + * where: { + * // ... the filter for the Timestamps we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Timestamps. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Timestamps. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TimestampsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends TimestampsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: TimestampsGroupByArgs['orderBy'] } + : { orderBy?: TimestampsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetTimestampsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Timestamps. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__TimestampsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * Timestamps base type for findUnique actions + */ + export type TimestampsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where: TimestampsWhereUniqueInput + } + + /** + * Timestamps findUnique + */ + export interface TimestampsFindUniqueArgs extends TimestampsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Timestamps findUniqueOrThrow + */ + export type TimestampsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where: TimestampsWhereUniqueInput + } + + + /** + * Timestamps base type for findFirst actions + */ + export type TimestampsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where?: TimestampsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Timestamps to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Timestamps. + */ + cursor?: TimestampsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Timestamps from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Timestamps. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Timestamps. + */ + distinct?: Enumerable + } + + /** + * Timestamps findFirst + */ + export interface TimestampsFindFirstArgs extends TimestampsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Timestamps findFirstOrThrow + */ + export type TimestampsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where?: TimestampsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Timestamps to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Timestamps. + */ + cursor?: TimestampsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Timestamps from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Timestamps. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Timestamps. + */ + distinct?: Enumerable + } + + + /** + * Timestamps findMany + */ + export type TimestampsFindManyArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter, which Timestamps to fetch. + */ + where?: TimestampsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Timestamps to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Timestamps. + */ + cursor?: TimestampsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Timestamps from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Timestamps. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Timestamps create + */ + export type TimestampsCreateArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * The data needed to create a Timestamps. + */ + data: XOR + } + + + /** + * Timestamps createMany + */ + export type TimestampsCreateManyArgs = { + /** + * The data used to create many Timestamps. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Timestamps update + */ + export type TimestampsUpdateArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * The data needed to update a Timestamps. + */ + data: XOR + /** + * Choose, which Timestamps to update. + */ + where: TimestampsWhereUniqueInput + } + + + /** + * Timestamps updateMany + */ + export type TimestampsUpdateManyArgs = { + /** + * The data used to update Timestamps. + */ + data: XOR + /** + * Filter which Timestamps to update + */ + where?: TimestampsWhereInput + } + + + /** + * Timestamps upsert + */ + export type TimestampsUpsertArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * The filter to search for the Timestamps to update in case it exists. + */ + where: TimestampsWhereUniqueInput + /** + * In case the Timestamps found by the `where` argument doesn't exist, create a new Timestamps with this data. + */ + create: XOR + /** + * In case the Timestamps was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Timestamps delete + */ + export type TimestampsDeleteArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + /** + * Filter which Timestamps to delete. + */ + where: TimestampsWhereUniqueInput + } + + + /** + * Timestamps deleteMany + */ + export type TimestampsDeleteManyArgs = { + /** + * Filter which Timestamps to delete + */ + where?: TimestampsWhereInput + } + + + /** + * Timestamps without action + */ + export type TimestampsArgs = { + /** + * Select specific fields to fetch from the Timestamps + */ + select?: TimestampsSelect | null + } + + + + /** + * Model Datetimes + */ + + + export type AggregateDatetimes = { + _count: DatetimesCountAggregateOutputType | null + _min: DatetimesMinAggregateOutputType | null + _max: DatetimesMaxAggregateOutputType | null + } + + export type DatetimesMinAggregateOutputType = { + id: string | null + d: Date | null + t: Date | null + } + + export type DatetimesMaxAggregateOutputType = { + id: string | null + d: Date | null + t: Date | null + } + + export type DatetimesCountAggregateOutputType = { + id: number + d: number + t: number + _all: number + } + + + export type DatetimesMinAggregateInputType = { + id?: true + d?: true + t?: true + } + + export type DatetimesMaxAggregateInputType = { + id?: true + d?: true + t?: true + } + + export type DatetimesCountAggregateInputType = { + id?: true + d?: true + t?: true + _all?: true + } + + export type DatetimesAggregateArgs = { + /** + * Filter which Datetimes to aggregate. + */ + where?: DatetimesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Datetimes to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: DatetimesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Datetimes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Datetimes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Datetimes + **/ + _count?: true | DatetimesCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: DatetimesMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: DatetimesMaxAggregateInputType + } + + export type GetDatetimesAggregateType = { + [P in keyof T & keyof AggregateDatetimes]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type DatetimesGroupByArgs = { + where?: DatetimesWhereInput + orderBy?: Enumerable + by: DatetimesScalarFieldEnum[] + having?: DatetimesScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: DatetimesCountAggregateInputType | true + _min?: DatetimesMinAggregateInputType + _max?: DatetimesMaxAggregateInputType + } + + + export type DatetimesGroupByOutputType = { + id: string + d: Date + t: Date + _count: DatetimesCountAggregateOutputType | null + _min: DatetimesMinAggregateOutputType | null + _max: DatetimesMaxAggregateOutputType | null + } + + type GetDatetimesGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof DatetimesGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type DatetimesSelect = { + id?: boolean + d?: boolean + t?: boolean + } + + + export type DatetimesGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Datetimes : + S extends undefined ? never : + S extends { include: any } & (DatetimesArgs | DatetimesFindManyArgs) + ? Datetimes + : S extends { select: any } & (DatetimesArgs | DatetimesFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Datetimes ? Datetimes[P] : never + } + : Datetimes + + + type DatetimesCountArgs = + Omit & { + select?: DatetimesCountAggregateInputType | true + } + + export interface DatetimesDelegate { + + /** + * Find zero or one Datetimes that matches the filter. + * @param {DatetimesFindUniqueArgs} args - Arguments to find a Datetimes + * @example + * // Get one Datetimes + * const datetimes = await prisma.datetimes.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__DatetimesClient> : Prisma__DatetimesClient | null, null> + + /** + * Find one Datetimes that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {DatetimesFindUniqueOrThrowArgs} args - Arguments to find a Datetimes + * @example + * // Get one Datetimes + * const datetimes = await prisma.datetimes.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Find the first Datetimes that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesFindFirstArgs} args - Arguments to find a Datetimes + * @example + * // Get one Datetimes + * const datetimes = await prisma.datetimes.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__DatetimesClient> : Prisma__DatetimesClient | null, null> + + /** + * Find the first Datetimes that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesFindFirstOrThrowArgs} args - Arguments to find a Datetimes + * @example + * // Get one Datetimes + * const datetimes = await prisma.datetimes.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Find zero or more Datetimes that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Datetimes + * const datetimes = await prisma.datetimes.findMany() + * + * // Get first 10 Datetimes + * const datetimes = await prisma.datetimes.findMany({ take: 10 }) + * + * // Only select the `id` + * const datetimesWithIdOnly = await prisma.datetimes.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Datetimes. + * @param {DatetimesCreateArgs} args - Arguments to create a Datetimes. + * @example + * // Create one Datetimes + * const Datetimes = await prisma.datetimes.create({ + * data: { + * // ... data to create a Datetimes + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Create many Datetimes. + * @param {DatetimesCreateManyArgs} args - Arguments to create many Datetimes. + * @example + * // Create many Datetimes + * const datetimes = await prisma.datetimes.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Datetimes. + * @param {DatetimesDeleteArgs} args - Arguments to delete one Datetimes. + * @example + * // Delete one Datetimes + * const Datetimes = await prisma.datetimes.delete({ + * where: { + * // ... filter to delete one Datetimes + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Update one Datetimes. + * @param {DatetimesUpdateArgs} args - Arguments to update one Datetimes. + * @example + * // Update one Datetimes + * const datetimes = await prisma.datetimes.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Delete zero or more Datetimes. + * @param {DatetimesDeleteManyArgs} args - Arguments to filter Datetimes to delete. + * @example + * // Delete a few Datetimes + * const { count } = await prisma.datetimes.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Datetimes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Datetimes + * const datetimes = await prisma.datetimes.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Datetimes. + * @param {DatetimesUpsertArgs} args - Arguments to update or create a Datetimes. + * @example + * // Update or create a Datetimes + * const datetimes = await prisma.datetimes.upsert({ + * create: { + * // ... data to create a Datetimes + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Datetimes we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__DatetimesClient> + + /** + * Count the number of Datetimes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesCountArgs} args - Arguments to filter Datetimes to count. + * @example + * // Count the number of Datetimes + * const count = await prisma.datetimes.count({ + * where: { + * // ... the filter for the Datetimes we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Datetimes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Datetimes. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {DatetimesGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends DatetimesGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: DatetimesGroupByArgs['orderBy'] } + : { orderBy?: DatetimesGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetDatetimesGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Datetimes. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__DatetimesClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * Datetimes base type for findUnique actions + */ + export type DatetimesFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where: DatetimesWhereUniqueInput + } + + /** + * Datetimes findUnique + */ + export interface DatetimesFindUniqueArgs extends DatetimesFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Datetimes findUniqueOrThrow + */ + export type DatetimesFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where: DatetimesWhereUniqueInput + } + + + /** + * Datetimes base type for findFirst actions + */ + export type DatetimesFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where?: DatetimesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Datetimes to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Datetimes. + */ + cursor?: DatetimesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Datetimes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Datetimes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Datetimes. + */ + distinct?: Enumerable + } + + /** + * Datetimes findFirst + */ + export interface DatetimesFindFirstArgs extends DatetimesFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Datetimes findFirstOrThrow + */ + export type DatetimesFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where?: DatetimesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Datetimes to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Datetimes. + */ + cursor?: DatetimesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Datetimes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Datetimes. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Datetimes. + */ + distinct?: Enumerable + } + + + /** + * Datetimes findMany + */ + export type DatetimesFindManyArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter, which Datetimes to fetch. + */ + where?: DatetimesWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Datetimes to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Datetimes. + */ + cursor?: DatetimesWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Datetimes from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Datetimes. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Datetimes create + */ + export type DatetimesCreateArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * The data needed to create a Datetimes. + */ + data: XOR + } + + + /** + * Datetimes createMany + */ + export type DatetimesCreateManyArgs = { + /** + * The data used to create many Datetimes. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Datetimes update + */ + export type DatetimesUpdateArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * The data needed to update a Datetimes. + */ + data: XOR + /** + * Choose, which Datetimes to update. + */ + where: DatetimesWhereUniqueInput + } + + + /** + * Datetimes updateMany + */ + export type DatetimesUpdateManyArgs = { + /** + * The data used to update Datetimes. + */ + data: XOR + /** + * Filter which Datetimes to update + */ + where?: DatetimesWhereInput + } + + + /** + * Datetimes upsert + */ + export type DatetimesUpsertArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * The filter to search for the Datetimes to update in case it exists. + */ + where: DatetimesWhereUniqueInput + /** + * In case the Datetimes found by the `where` argument doesn't exist, create a new Datetimes with this data. + */ + create: XOR + /** + * In case the Datetimes was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Datetimes delete + */ + export type DatetimesDeleteArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + /** + * Filter which Datetimes to delete. + */ + where: DatetimesWhereUniqueInput + } + + + /** + * Datetimes deleteMany + */ + export type DatetimesDeleteManyArgs = { + /** + * Filter which Datetimes to delete + */ + where?: DatetimesWhereInput + } + + + /** + * Datetimes without action + */ + export type DatetimesArgs = { + /** + * Select specific fields to fetch from the Datetimes + */ + select?: DatetimesSelect | null + } + + + + /** + * Model Bools + */ + + + export type AggregateBools = { + _count: BoolsCountAggregateOutputType | null + _min: BoolsMinAggregateOutputType | null + _max: BoolsMaxAggregateOutputType | null + } + + export type BoolsMinAggregateOutputType = { + id: string | null + b: boolean | null + } + + export type BoolsMaxAggregateOutputType = { + id: string | null + b: boolean | null + } + + export type BoolsCountAggregateOutputType = { + id: number + b: number + _all: number + } + + + export type BoolsMinAggregateInputType = { + id?: true + b?: true + } + + export type BoolsMaxAggregateInputType = { + id?: true + b?: true + } + + export type BoolsCountAggregateInputType = { + id?: true + b?: true + _all?: true + } + + export type BoolsAggregateArgs = { + /** + * Filter which Bools to aggregate. + */ + where?: BoolsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Bools to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: BoolsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Bools from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Bools. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Bools + **/ + _count?: true | BoolsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: BoolsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: BoolsMaxAggregateInputType + } + + export type GetBoolsAggregateType = { + [P in keyof T & keyof AggregateBools]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type BoolsGroupByArgs = { + where?: BoolsWhereInput + orderBy?: Enumerable + by: BoolsScalarFieldEnum[] + having?: BoolsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: BoolsCountAggregateInputType | true + _min?: BoolsMinAggregateInputType + _max?: BoolsMaxAggregateInputType + } + + + export type BoolsGroupByOutputType = { + id: string + b: boolean | null + _count: BoolsCountAggregateOutputType | null + _min: BoolsMinAggregateOutputType | null + _max: BoolsMaxAggregateOutputType | null + } + + type GetBoolsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof BoolsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type BoolsSelect = { + id?: boolean + b?: boolean + } + + + export type BoolsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Bools : + S extends undefined ? never : + S extends { include: any } & (BoolsArgs | BoolsFindManyArgs) + ? Bools + : S extends { select: any } & (BoolsArgs | BoolsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Bools ? Bools[P] : never + } + : Bools + + + type BoolsCountArgs = + Omit & { + select?: BoolsCountAggregateInputType | true + } + + export interface BoolsDelegate { + + /** + * Find zero or one Bools that matches the filter. + * @param {BoolsFindUniqueArgs} args - Arguments to find a Bools + * @example + * // Get one Bools + * const bools = await prisma.bools.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__BoolsClient> : Prisma__BoolsClient | null, null> + + /** + * Find one Bools that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {BoolsFindUniqueOrThrowArgs} args - Arguments to find a Bools + * @example + * // Get one Bools + * const bools = await prisma.bools.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__BoolsClient> + + /** + * Find the first Bools that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsFindFirstArgs} args - Arguments to find a Bools + * @example + * // Get one Bools + * const bools = await prisma.bools.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__BoolsClient> : Prisma__BoolsClient | null, null> + + /** + * Find the first Bools that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsFindFirstOrThrowArgs} args - Arguments to find a Bools + * @example + * // Get one Bools + * const bools = await prisma.bools.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__BoolsClient> + + /** + * Find zero or more Bools that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Bools + * const bools = await prisma.bools.findMany() + * + * // Get first 10 Bools + * const bools = await prisma.bools.findMany({ take: 10 }) + * + * // Only select the `id` + * const boolsWithIdOnly = await prisma.bools.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Bools. + * @param {BoolsCreateArgs} args - Arguments to create a Bools. + * @example + * // Create one Bools + * const Bools = await prisma.bools.create({ + * data: { + * // ... data to create a Bools + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__BoolsClient> + + /** + * Create many Bools. + * @param {BoolsCreateManyArgs} args - Arguments to create many Bools. + * @example + * // Create many Bools + * const bools = await prisma.bools.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Bools. + * @param {BoolsDeleteArgs} args - Arguments to delete one Bools. + * @example + * // Delete one Bools + * const Bools = await prisma.bools.delete({ + * where: { + * // ... filter to delete one Bools + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__BoolsClient> + + /** + * Update one Bools. + * @param {BoolsUpdateArgs} args - Arguments to update one Bools. + * @example + * // Update one Bools + * const bools = await prisma.bools.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__BoolsClient> + + /** + * Delete zero or more Bools. + * @param {BoolsDeleteManyArgs} args - Arguments to filter Bools to delete. + * @example + * // Delete a few Bools + * const { count } = await prisma.bools.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Bools. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Bools + * const bools = await prisma.bools.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Bools. + * @param {BoolsUpsertArgs} args - Arguments to update or create a Bools. + * @example + * // Update or create a Bools + * const bools = await prisma.bools.upsert({ + * create: { + * // ... data to create a Bools + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Bools we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__BoolsClient> + + /** + * Count the number of Bools. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsCountArgs} args - Arguments to filter Bools to count. + * @example + * // Count the number of Bools + * const count = await prisma.bools.count({ + * where: { + * // ... the filter for the Bools we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Bools. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Bools. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {BoolsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends BoolsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: BoolsGroupByArgs['orderBy'] } + : { orderBy?: BoolsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetBoolsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Bools. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__BoolsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * Bools base type for findUnique actions + */ + export type BoolsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where: BoolsWhereUniqueInput + } + + /** + * Bools findUnique + */ + export interface BoolsFindUniqueArgs extends BoolsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Bools findUniqueOrThrow + */ + export type BoolsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where: BoolsWhereUniqueInput + } + + + /** + * Bools base type for findFirst actions + */ + export type BoolsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where?: BoolsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Bools to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Bools. + */ + cursor?: BoolsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Bools from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Bools. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Bools. + */ + distinct?: Enumerable + } + + /** + * Bools findFirst + */ + export interface BoolsFindFirstArgs extends BoolsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Bools findFirstOrThrow + */ + export type BoolsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where?: BoolsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Bools to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Bools. + */ + cursor?: BoolsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Bools from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Bools. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Bools. + */ + distinct?: Enumerable + } + + + /** + * Bools findMany + */ + export type BoolsFindManyArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter, which Bools to fetch. + */ + where?: BoolsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Bools to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Bools. + */ + cursor?: BoolsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Bools from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Bools. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Bools create + */ + export type BoolsCreateArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * The data needed to create a Bools. + */ + data: XOR + } + + + /** + * Bools createMany + */ + export type BoolsCreateManyArgs = { + /** + * The data used to create many Bools. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Bools update + */ + export type BoolsUpdateArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * The data needed to update a Bools. + */ + data: XOR + /** + * Choose, which Bools to update. + */ + where: BoolsWhereUniqueInput + } + + + /** + * Bools updateMany + */ + export type BoolsUpdateManyArgs = { + /** + * The data used to update Bools. + */ + data: XOR + /** + * Filter which Bools to update + */ + where?: BoolsWhereInput + } + + + /** + * Bools upsert + */ + export type BoolsUpsertArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * The filter to search for the Bools to update in case it exists. + */ + where: BoolsWhereUniqueInput + /** + * In case the Bools found by the `where` argument doesn't exist, create a new Bools with this data. + */ + create: XOR + /** + * In case the Bools was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Bools delete + */ + export type BoolsDeleteArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + /** + * Filter which Bools to delete. + */ + where: BoolsWhereUniqueInput + } + + + /** + * Bools deleteMany + */ + export type BoolsDeleteManyArgs = { + /** + * Filter which Bools to delete + */ + where?: BoolsWhereInput + } + + + /** + * Bools without action + */ + export type BoolsArgs = { + /** + * Select specific fields to fetch from the Bools + */ + select?: BoolsSelect | null + } + + + + /** + * Model Uuids + */ + + + export type AggregateUuids = { + _count: UuidsCountAggregateOutputType | null + _min: UuidsMinAggregateOutputType | null + _max: UuidsMaxAggregateOutputType | null + } + + export type UuidsMinAggregateOutputType = { + id: string | null + } + + export type UuidsMaxAggregateOutputType = { + id: string | null + } + + export type UuidsCountAggregateOutputType = { + id: number + _all: number + } + + + export type UuidsMinAggregateInputType = { + id?: true + } + + export type UuidsMaxAggregateInputType = { + id?: true + } + + export type UuidsCountAggregateInputType = { + id?: true + _all?: true + } + + export type UuidsAggregateArgs = { + /** + * Filter which Uuids to aggregate. + */ + where?: UuidsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Uuids to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: UuidsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Uuids from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Uuids. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Uuids + **/ + _count?: true | UuidsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UuidsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UuidsMaxAggregateInputType + } + + export type GetUuidsAggregateType = { + [P in keyof T & keyof AggregateUuids]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type UuidsGroupByArgs = { + where?: UuidsWhereInput + orderBy?: Enumerable + by: UuidsScalarFieldEnum[] + having?: UuidsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UuidsCountAggregateInputType | true + _min?: UuidsMinAggregateInputType + _max?: UuidsMaxAggregateInputType + } + + + export type UuidsGroupByOutputType = { + id: string + _count: UuidsCountAggregateOutputType | null + _min: UuidsMinAggregateOutputType | null + _max: UuidsMaxAggregateOutputType | null + } + + type GetUuidsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof UuidsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type UuidsSelect = { + id?: boolean + } + + + export type UuidsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Uuids : + S extends undefined ? never : + S extends { include: any } & (UuidsArgs | UuidsFindManyArgs) + ? Uuids + : S extends { select: any } & (UuidsArgs | UuidsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Uuids ? Uuids[P] : never + } + : Uuids + + + type UuidsCountArgs = + Omit & { + select?: UuidsCountAggregateInputType | true + } + + export interface UuidsDelegate { + + /** + * Find zero or one Uuids that matches the filter. + * @param {UuidsFindUniqueArgs} args - Arguments to find a Uuids + * @example + * // Get one Uuids + * const uuids = await prisma.uuids.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__UuidsClient> : Prisma__UuidsClient | null, null> + + /** + * Find one Uuids that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UuidsFindUniqueOrThrowArgs} args - Arguments to find a Uuids + * @example + * // Get one Uuids + * const uuids = await prisma.uuids.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__UuidsClient> + + /** + * Find the first Uuids that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsFindFirstArgs} args - Arguments to find a Uuids + * @example + * // Get one Uuids + * const uuids = await prisma.uuids.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__UuidsClient> : Prisma__UuidsClient | null, null> + + /** + * Find the first Uuids that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsFindFirstOrThrowArgs} args - Arguments to find a Uuids + * @example + * // Get one Uuids + * const uuids = await prisma.uuids.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__UuidsClient> + + /** + * Find zero or more Uuids that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Uuids + * const uuids = await prisma.uuids.findMany() + * + * // Get first 10 Uuids + * const uuids = await prisma.uuids.findMany({ take: 10 }) + * + * // Only select the `id` + * const uuidsWithIdOnly = await prisma.uuids.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Uuids. + * @param {UuidsCreateArgs} args - Arguments to create a Uuids. + * @example + * // Create one Uuids + * const Uuids = await prisma.uuids.create({ + * data: { + * // ... data to create a Uuids + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__UuidsClient> + + /** + * Create many Uuids. + * @param {UuidsCreateManyArgs} args - Arguments to create many Uuids. + * @example + * // Create many Uuids + * const uuids = await prisma.uuids.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Uuids. + * @param {UuidsDeleteArgs} args - Arguments to delete one Uuids. + * @example + * // Delete one Uuids + * const Uuids = await prisma.uuids.delete({ + * where: { + * // ... filter to delete one Uuids + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__UuidsClient> + + /** + * Update one Uuids. + * @param {UuidsUpdateArgs} args - Arguments to update one Uuids. + * @example + * // Update one Uuids + * const uuids = await prisma.uuids.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__UuidsClient> + + /** + * Delete zero or more Uuids. + * @param {UuidsDeleteManyArgs} args - Arguments to filter Uuids to delete. + * @example + * // Delete a few Uuids + * const { count } = await prisma.uuids.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Uuids. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Uuids + * const uuids = await prisma.uuids.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Uuids. + * @param {UuidsUpsertArgs} args - Arguments to update or create a Uuids. + * @example + * // Update or create a Uuids + * const uuids = await prisma.uuids.upsert({ + * create: { + * // ... data to create a Uuids + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Uuids we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__UuidsClient> + + /** + * Count the number of Uuids. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsCountArgs} args - Arguments to filter Uuids to count. + * @example + * // Count the number of Uuids + * const count = await prisma.uuids.count({ + * where: { + * // ... the filter for the Uuids we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Uuids. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Uuids. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UuidsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends UuidsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: UuidsGroupByArgs['orderBy'] } + : { orderBy?: UuidsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetUuidsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Uuids. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__UuidsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * Uuids base type for findUnique actions + */ + export type UuidsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where: UuidsWhereUniqueInput + } + + /** + * Uuids findUnique + */ + export interface UuidsFindUniqueArgs extends UuidsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Uuids findUniqueOrThrow + */ + export type UuidsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where: UuidsWhereUniqueInput + } + + + /** + * Uuids base type for findFirst actions + */ + export type UuidsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where?: UuidsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Uuids to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Uuids. + */ + cursor?: UuidsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Uuids from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Uuids. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Uuids. + */ + distinct?: Enumerable + } + + /** + * Uuids findFirst + */ + export interface UuidsFindFirstArgs extends UuidsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Uuids findFirstOrThrow + */ + export type UuidsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where?: UuidsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Uuids to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Uuids. + */ + cursor?: UuidsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Uuids from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Uuids. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Uuids. + */ + distinct?: Enumerable + } + + + /** + * Uuids findMany + */ + export type UuidsFindManyArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter, which Uuids to fetch. + */ + where?: UuidsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Uuids to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Uuids. + */ + cursor?: UuidsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Uuids from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Uuids. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Uuids create + */ + export type UuidsCreateArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * The data needed to create a Uuids. + */ + data: XOR + } + + + /** + * Uuids createMany + */ + export type UuidsCreateManyArgs = { + /** + * The data used to create many Uuids. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Uuids update + */ + export type UuidsUpdateArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * The data needed to update a Uuids. + */ + data: XOR + /** + * Choose, which Uuids to update. + */ + where: UuidsWhereUniqueInput + } + + + /** + * Uuids updateMany + */ + export type UuidsUpdateManyArgs = { + /** + * The data used to update Uuids. + */ + data: XOR + /** + * Filter which Uuids to update + */ + where?: UuidsWhereInput + } + + + /** + * Uuids upsert + */ + export type UuidsUpsertArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * The filter to search for the Uuids to update in case it exists. + */ + where: UuidsWhereUniqueInput + /** + * In case the Uuids found by the `where` argument doesn't exist, create a new Uuids with this data. + */ + create: XOR + /** + * In case the Uuids was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Uuids delete + */ + export type UuidsDeleteArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + /** + * Filter which Uuids to delete. + */ + where: UuidsWhereUniqueInput + } + + + /** + * Uuids deleteMany + */ + export type UuidsDeleteManyArgs = { + /** + * Filter which Uuids to delete + */ + where?: UuidsWhereInput + } + + + /** + * Uuids without action + */ + export type UuidsArgs = { + /** + * Select specific fields to fetch from the Uuids + */ + select?: UuidsSelect | null + } + + + + /** + * Model Ints + */ + + + export type AggregateInts = { + _count: IntsCountAggregateOutputType | null + _avg: IntsAvgAggregateOutputType | null + _sum: IntsSumAggregateOutputType | null + _min: IntsMinAggregateOutputType | null + _max: IntsMaxAggregateOutputType | null + } + + export type IntsAvgAggregateOutputType = { + i2: number | null + i4: number | null + } + + export type IntsSumAggregateOutputType = { + i2: number | null + i4: number | null + } + + export type IntsMinAggregateOutputType = { + id: string | null + i2: number | null + i4: number | null + } + + export type IntsMaxAggregateOutputType = { + id: string | null + i2: number | null + i4: number | null + } + + export type IntsCountAggregateOutputType = { + id: number + i2: number + i4: number + _all: number + } + + + export type IntsAvgAggregateInputType = { + i2?: true + i4?: true + } + + export type IntsSumAggregateInputType = { + i2?: true + i4?: true + } + + export type IntsMinAggregateInputType = { + id?: true + i2?: true + i4?: true + } + + export type IntsMaxAggregateInputType = { + id?: true + i2?: true + i4?: true + } + + export type IntsCountAggregateInputType = { + id?: true + i2?: true + i4?: true + _all?: true + } + + export type IntsAggregateArgs = { + /** + * Filter which Ints to aggregate. + */ + where?: IntsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Ints to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: IntsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Ints from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Ints. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Ints + **/ + _count?: true | IntsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: IntsAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: IntsSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: IntsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: IntsMaxAggregateInputType + } + + export type GetIntsAggregateType = { + [P in keyof T & keyof AggregateInts]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type IntsGroupByArgs = { + where?: IntsWhereInput + orderBy?: Enumerable + by: IntsScalarFieldEnum[] + having?: IntsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: IntsCountAggregateInputType | true + _avg?: IntsAvgAggregateInputType + _sum?: IntsSumAggregateInputType + _min?: IntsMinAggregateInputType + _max?: IntsMaxAggregateInputType + } + + + export type IntsGroupByOutputType = { + id: string + i2: number | null + i4: number | null + _count: IntsCountAggregateOutputType | null + _avg: IntsAvgAggregateOutputType | null + _sum: IntsSumAggregateOutputType | null + _min: IntsMinAggregateOutputType | null + _max: IntsMaxAggregateOutputType | null + } + + type GetIntsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof IntsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type IntsSelect = { + id?: boolean + i2?: boolean + i4?: boolean + } + + + export type IntsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Ints : + S extends undefined ? never : + S extends { include: any } & (IntsArgs | IntsFindManyArgs) + ? Ints + : S extends { select: any } & (IntsArgs | IntsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Ints ? Ints[P] : never + } + : Ints + + + type IntsCountArgs = + Omit & { + select?: IntsCountAggregateInputType | true + } + + export interface IntsDelegate { + + /** + * Find zero or one Ints that matches the filter. + * @param {IntsFindUniqueArgs} args - Arguments to find a Ints + * @example + * // Get one Ints + * const ints = await prisma.ints.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__IntsClient> : Prisma__IntsClient | null, null> + + /** + * Find one Ints that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {IntsFindUniqueOrThrowArgs} args - Arguments to find a Ints + * @example + * // Get one Ints + * const ints = await prisma.ints.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__IntsClient> + + /** + * Find the first Ints that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsFindFirstArgs} args - Arguments to find a Ints + * @example + * // Get one Ints + * const ints = await prisma.ints.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__IntsClient> : Prisma__IntsClient | null, null> + + /** + * Find the first Ints that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsFindFirstOrThrowArgs} args - Arguments to find a Ints + * @example + * // Get one Ints + * const ints = await prisma.ints.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__IntsClient> + + /** + * Find zero or more Ints that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Ints + * const ints = await prisma.ints.findMany() + * + * // Get first 10 Ints + * const ints = await prisma.ints.findMany({ take: 10 }) + * + * // Only select the `id` + * const intsWithIdOnly = await prisma.ints.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Ints. + * @param {IntsCreateArgs} args - Arguments to create a Ints. + * @example + * // Create one Ints + * const Ints = await prisma.ints.create({ + * data: { + * // ... data to create a Ints + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__IntsClient> + + /** + * Create many Ints. + * @param {IntsCreateManyArgs} args - Arguments to create many Ints. + * @example + * // Create many Ints + * const ints = await prisma.ints.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Ints. + * @param {IntsDeleteArgs} args - Arguments to delete one Ints. + * @example + * // Delete one Ints + * const Ints = await prisma.ints.delete({ + * where: { + * // ... filter to delete one Ints + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__IntsClient> + + /** + * Update one Ints. + * @param {IntsUpdateArgs} args - Arguments to update one Ints. + * @example + * // Update one Ints + * const ints = await prisma.ints.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__IntsClient> + + /** + * Delete zero or more Ints. + * @param {IntsDeleteManyArgs} args - Arguments to filter Ints to delete. + * @example + * // Delete a few Ints + * const { count } = await prisma.ints.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Ints. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Ints + * const ints = await prisma.ints.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Ints. + * @param {IntsUpsertArgs} args - Arguments to update or create a Ints. + * @example + * // Update or create a Ints + * const ints = await prisma.ints.upsert({ + * create: { + * // ... data to create a Ints + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Ints we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__IntsClient> + + /** + * Count the number of Ints. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsCountArgs} args - Arguments to filter Ints to count. + * @example + * // Count the number of Ints + * const count = await prisma.ints.count({ + * where: { + * // ... the filter for the Ints we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Ints. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Ints. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {IntsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends IntsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: IntsGroupByArgs['orderBy'] } + : { orderBy?: IntsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetIntsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Ints. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__IntsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * Ints base type for findUnique actions + */ + export type IntsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where: IntsWhereUniqueInput + } + + /** + * Ints findUnique + */ + export interface IntsFindUniqueArgs extends IntsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Ints findUniqueOrThrow + */ + export type IntsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where: IntsWhereUniqueInput + } + + + /** + * Ints base type for findFirst actions + */ + export type IntsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where?: IntsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Ints to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Ints. + */ + cursor?: IntsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Ints from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Ints. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Ints. + */ + distinct?: Enumerable + } + + /** + * Ints findFirst + */ + export interface IntsFindFirstArgs extends IntsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Ints findFirstOrThrow + */ + export type IntsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where?: IntsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Ints to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Ints. + */ + cursor?: IntsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Ints from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Ints. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Ints. + */ + distinct?: Enumerable + } + + + /** + * Ints findMany + */ + export type IntsFindManyArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter, which Ints to fetch. + */ + where?: IntsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Ints to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Ints. + */ + cursor?: IntsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Ints from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Ints. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Ints create + */ + export type IntsCreateArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * The data needed to create a Ints. + */ + data: XOR + } + + + /** + * Ints createMany + */ + export type IntsCreateManyArgs = { + /** + * The data used to create many Ints. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Ints update + */ + export type IntsUpdateArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * The data needed to update a Ints. + */ + data: XOR + /** + * Choose, which Ints to update. + */ + where: IntsWhereUniqueInput + } + + + /** + * Ints updateMany + */ + export type IntsUpdateManyArgs = { + /** + * The data used to update Ints. + */ + data: XOR + /** + * Filter which Ints to update + */ + where?: IntsWhereInput + } + + + /** + * Ints upsert + */ + export type IntsUpsertArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * The filter to search for the Ints to update in case it exists. + */ + where: IntsWhereUniqueInput + /** + * In case the Ints found by the `where` argument doesn't exist, create a new Ints with this data. + */ + create: XOR + /** + * In case the Ints was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Ints delete + */ + export type IntsDeleteArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + /** + * Filter which Ints to delete. + */ + where: IntsWhereUniqueInput + } + + + /** + * Ints deleteMany + */ + export type IntsDeleteManyArgs = { + /** + * Filter which Ints to delete + */ + where?: IntsWhereInput + } + + + /** + * Ints without action + */ + export type IntsArgs = { + /** + * Select specific fields to fetch from the Ints + */ + select?: IntsSelect | null + } + + + + /** + * Model Floats + */ + + + export type AggregateFloats = { + _count: FloatsCountAggregateOutputType | null + _avg: FloatsAvgAggregateOutputType | null + _sum: FloatsSumAggregateOutputType | null + _min: FloatsMinAggregateOutputType | null + _max: FloatsMaxAggregateOutputType | null + } + + export type FloatsAvgAggregateOutputType = { + f8: number | null + } + + export type FloatsSumAggregateOutputType = { + f8: number | null + } + + export type FloatsMinAggregateOutputType = { + id: string | null + f8: number | null + } + + export type FloatsMaxAggregateOutputType = { + id: string | null + f8: number | null + } + + export type FloatsCountAggregateOutputType = { + id: number + f8: number + _all: number + } + + + export type FloatsAvgAggregateInputType = { + f8?: true + } + + export type FloatsSumAggregateInputType = { + f8?: true + } + + export type FloatsMinAggregateInputType = { + id?: true + f8?: true + } + + export type FloatsMaxAggregateInputType = { + id?: true + f8?: true + } + + export type FloatsCountAggregateInputType = { + id?: true + f8?: true + _all?: true + } + + export type FloatsAggregateArgs = { + /** + * Filter which Floats to aggregate. + */ + where?: FloatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Floats to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: FloatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Floats from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Floats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Floats + **/ + _count?: true | FloatsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: FloatsAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: FloatsSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: FloatsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: FloatsMaxAggregateInputType + } + + export type GetFloatsAggregateType = { + [P in keyof T & keyof AggregateFloats]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type FloatsGroupByArgs = { + where?: FloatsWhereInput + orderBy?: Enumerable + by: FloatsScalarFieldEnum[] + having?: FloatsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: FloatsCountAggregateInputType | true + _avg?: FloatsAvgAggregateInputType + _sum?: FloatsSumAggregateInputType + _min?: FloatsMinAggregateInputType + _max?: FloatsMaxAggregateInputType + } + + + export type FloatsGroupByOutputType = { + id: string + f8: number | null + _count: FloatsCountAggregateOutputType | null + _avg: FloatsAvgAggregateOutputType | null + _sum: FloatsSumAggregateOutputType | null + _min: FloatsMinAggregateOutputType | null + _max: FloatsMaxAggregateOutputType | null + } + + type GetFloatsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof FloatsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type FloatsSelect = { + id?: boolean + f8?: boolean + } + + + export type FloatsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Floats : + S extends undefined ? never : + S extends { include: any } & (FloatsArgs | FloatsFindManyArgs) + ? Floats + : S extends { select: any } & (FloatsArgs | FloatsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Floats ? Floats[P] : never + } + : Floats + + + type FloatsCountArgs = + Omit & { + select?: FloatsCountAggregateInputType | true + } + + export interface FloatsDelegate { + + /** + * Find zero or one Floats that matches the filter. + * @param {FloatsFindUniqueArgs} args - Arguments to find a Floats + * @example + * // Get one Floats + * const floats = await prisma.floats.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__FloatsClient> : Prisma__FloatsClient | null, null> + + /** + * Find one Floats that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {FloatsFindUniqueOrThrowArgs} args - Arguments to find a Floats + * @example + * // Get one Floats + * const floats = await prisma.floats.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__FloatsClient> + + /** + * Find the first Floats that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsFindFirstArgs} args - Arguments to find a Floats + * @example + * // Get one Floats + * const floats = await prisma.floats.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__FloatsClient> : Prisma__FloatsClient | null, null> + + /** + * Find the first Floats that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsFindFirstOrThrowArgs} args - Arguments to find a Floats + * @example + * // Get one Floats + * const floats = await prisma.floats.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__FloatsClient> + + /** + * Find zero or more Floats that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Floats + * const floats = await prisma.floats.findMany() + * + * // Get first 10 Floats + * const floats = await prisma.floats.findMany({ take: 10 }) + * + * // Only select the `id` + * const floatsWithIdOnly = await prisma.floats.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Floats. + * @param {FloatsCreateArgs} args - Arguments to create a Floats. + * @example + * // Create one Floats + * const Floats = await prisma.floats.create({ + * data: { + * // ... data to create a Floats + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__FloatsClient> + + /** + * Create many Floats. + * @param {FloatsCreateManyArgs} args - Arguments to create many Floats. + * @example + * // Create many Floats + * const floats = await prisma.floats.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Floats. + * @param {FloatsDeleteArgs} args - Arguments to delete one Floats. + * @example + * // Delete one Floats + * const Floats = await prisma.floats.delete({ + * where: { + * // ... filter to delete one Floats + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__FloatsClient> + + /** + * Update one Floats. + * @param {FloatsUpdateArgs} args - Arguments to update one Floats. + * @example + * // Update one Floats + * const floats = await prisma.floats.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__FloatsClient> + + /** + * Delete zero or more Floats. + * @param {FloatsDeleteManyArgs} args - Arguments to filter Floats to delete. + * @example + * // Delete a few Floats + * const { count } = await prisma.floats.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Floats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Floats + * const floats = await prisma.floats.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Floats. + * @param {FloatsUpsertArgs} args - Arguments to update or create a Floats. + * @example + * // Update or create a Floats + * const floats = await prisma.floats.upsert({ + * create: { + * // ... data to create a Floats + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Floats we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__FloatsClient> + + /** + * Count the number of Floats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsCountArgs} args - Arguments to filter Floats to count. + * @example + * // Count the number of Floats + * const count = await prisma.floats.count({ + * where: { + * // ... the filter for the Floats we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Floats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Floats. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {FloatsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends FloatsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: FloatsGroupByArgs['orderBy'] } + : { orderBy?: FloatsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetFloatsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Floats. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__FloatsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * Floats base type for findUnique actions + */ + export type FloatsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where: FloatsWhereUniqueInput + } + + /** + * Floats findUnique + */ + export interface FloatsFindUniqueArgs extends FloatsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Floats findUniqueOrThrow + */ + export type FloatsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where: FloatsWhereUniqueInput + } + + + /** + * Floats base type for findFirst actions + */ + export type FloatsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where?: FloatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Floats to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Floats. + */ + cursor?: FloatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Floats from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Floats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Floats. + */ + distinct?: Enumerable + } + + /** + * Floats findFirst + */ + export interface FloatsFindFirstArgs extends FloatsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Floats findFirstOrThrow + */ + export type FloatsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where?: FloatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Floats to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Floats. + */ + cursor?: FloatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Floats from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Floats. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Floats. + */ + distinct?: Enumerable + } + + + /** + * Floats findMany + */ + export type FloatsFindManyArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter, which Floats to fetch. + */ + where?: FloatsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Floats to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Floats. + */ + cursor?: FloatsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Floats from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Floats. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Floats create + */ + export type FloatsCreateArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * The data needed to create a Floats. + */ + data: XOR + } + + + /** + * Floats createMany + */ + export type FloatsCreateManyArgs = { + /** + * The data used to create many Floats. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Floats update + */ + export type FloatsUpdateArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * The data needed to update a Floats. + */ + data: XOR + /** + * Choose, which Floats to update. + */ + where: FloatsWhereUniqueInput + } + + + /** + * Floats updateMany + */ + export type FloatsUpdateManyArgs = { + /** + * The data used to update Floats. + */ + data: XOR + /** + * Filter which Floats to update + */ + where?: FloatsWhereInput + } + + + /** + * Floats upsert + */ + export type FloatsUpsertArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * The filter to search for the Floats to update in case it exists. + */ + where: FloatsWhereUniqueInput + /** + * In case the Floats found by the `where` argument doesn't exist, create a new Floats with this data. + */ + create: XOR + /** + * In case the Floats was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Floats delete + */ + export type FloatsDeleteArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + /** + * Filter which Floats to delete. + */ + where: FloatsWhereUniqueInput + } + + + /** + * Floats deleteMany + */ + export type FloatsDeleteManyArgs = { + /** + * Filter which Floats to delete + */ + where?: FloatsWhereInput + } + + + /** + * Floats without action + */ + export type FloatsArgs = { + /** + * Select specific fields to fetch from the Floats + */ + select?: FloatsSelect | null + } + + + + /** + * Model Jsons + */ + + + export type AggregateJsons = { + _count: JsonsCountAggregateOutputType | null + _min: JsonsMinAggregateOutputType | null + _max: JsonsMaxAggregateOutputType | null + } + + export type JsonsMinAggregateOutputType = { + id: string | null + } + + export type JsonsMaxAggregateOutputType = { + id: string | null + } + + export type JsonsCountAggregateOutputType = { + id: number + js: number + jsb: number + _all: number + } + + + export type JsonsMinAggregateInputType = { + id?: true + } + + export type JsonsMaxAggregateInputType = { + id?: true + } + + export type JsonsCountAggregateInputType = { + id?: true + js?: true + jsb?: true + _all?: true + } + + export type JsonsAggregateArgs = { + /** + * Filter which Jsons to aggregate. + */ + where?: JsonsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Jsons to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: JsonsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Jsons from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Jsons. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Jsons + **/ + _count?: true | JsonsCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: JsonsMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: JsonsMaxAggregateInputType + } + + export type GetJsonsAggregateType = { + [P in keyof T & keyof AggregateJsons]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : GetScalarType + : GetScalarType + } + + + + + export type JsonsGroupByArgs = { + where?: JsonsWhereInput + orderBy?: Enumerable + by: JsonsScalarFieldEnum[] + having?: JsonsScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: JsonsCountAggregateInputType | true + _min?: JsonsMinAggregateInputType + _max?: JsonsMaxAggregateInputType + } + + + export type JsonsGroupByOutputType = { + id: string + js: JsonValue | null + jsb: JsonValue | null + _count: JsonsCountAggregateOutputType | null + _min: JsonsMinAggregateOutputType | null + _max: JsonsMaxAggregateOutputType | null + } + + type GetJsonsGroupByPayload = Prisma.PrismaPromise< + Array< + PickArray & + { + [P in ((keyof T) & (keyof JsonsGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : GetScalarType + : GetScalarType + } + > + > + + + export type JsonsSelect = { + id?: boolean + js?: boolean + jsb?: boolean + } + + + export type JsonsGetPayload = + S extends { select: any, include: any } ? 'Please either choose `select` or `include`' : + S extends true ? Jsons : + S extends undefined ? never : + S extends { include: any } & (JsonsArgs | JsonsFindManyArgs) + ? Jsons + : S extends { select: any } & (JsonsArgs | JsonsFindManyArgs) + ? { + [P in TruthyKeys]: + P extends keyof Jsons ? Jsons[P] : never + } + : Jsons + + + type JsonsCountArgs = + Omit & { + select?: JsonsCountAggregateInputType | true + } + + export interface JsonsDelegate { + + /** + * Find zero or one Jsons that matches the filter. + * @param {JsonsFindUniqueArgs} args - Arguments to find a Jsons + * @example + * // Get one Jsons + * const jsons = await prisma.jsons.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUnique( + args: SelectSubset + ): HasReject extends True ? Prisma__JsonsClient> : Prisma__JsonsClient | null, null> + + /** + * Find one Jsons that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {JsonsFindUniqueOrThrowArgs} args - Arguments to find a Jsons + * @example + * // Get one Jsons + * const jsons = await prisma.jsons.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findUniqueOrThrow( + args?: SelectSubset + ): Prisma__JsonsClient> + + /** + * Find the first Jsons that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {JsonsFindFirstArgs} args - Arguments to find a Jsons + * @example + * // Get one Jsons + * const jsons = await prisma.jsons.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirst( + args?: SelectSubset + ): HasReject extends True ? Prisma__JsonsClient> : Prisma__JsonsClient | null, null> + + /** + * Find the first Jsons that matches the filter or + * throw `NotFoundError` if no matches were found. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {JsonsFindFirstOrThrowArgs} args - Arguments to find a Jsons + * @example + * // Get one Jsons + * const jsons = await prisma.jsons.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + **/ + findFirstOrThrow( + args?: SelectSubset + ): Prisma__JsonsClient> + + /** + * Find zero or more Jsons that matches the filter. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {JsonsFindManyArgs=} args - Arguments to filter and select certain fields only. + * @example + * // Get all Jsons + * const jsons = await prisma.jsons.findMany() + * + * // Get first 10 Jsons + * const jsons = await prisma.jsons.findMany({ take: 10 }) + * + * // Only select the `id` + * const jsonsWithIdOnly = await prisma.jsons.findMany({ select: { id: true } }) + * + **/ + findMany( + args?: SelectSubset + ): Prisma.PrismaPromise>> + + /** + * Create a Jsons. + * @param {JsonsCreateArgs} args - Arguments to create a Jsons. + * @example + * // Create one Jsons + * const Jsons = await prisma.jsons.create({ + * data: { + * // ... data to create a Jsons + * } + * }) + * + **/ + create( + args: SelectSubset + ): Prisma__JsonsClient> + + /** + * Create many Jsons. + * @param {JsonsCreateManyArgs} args - Arguments to create many Jsons. + * @example + * // Create many Jsons + * const jsons = await prisma.jsons.createMany({ + * data: { + * // ... provide data here + * } + * }) + * + **/ + createMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Delete a Jsons. + * @param {JsonsDeleteArgs} args - Arguments to delete one Jsons. + * @example + * // Delete one Jsons + * const Jsons = await prisma.jsons.delete({ + * where: { + * // ... filter to delete one Jsons + * } + * }) + * + **/ + delete( + args: SelectSubset + ): Prisma__JsonsClient> + + /** + * Update one Jsons. + * @param {JsonsUpdateArgs} args - Arguments to update one Jsons. + * @example + * // Update one Jsons + * const jsons = await prisma.jsons.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + update( + args: SelectSubset + ): Prisma__JsonsClient> + + /** + * Delete zero or more Jsons. + * @param {JsonsDeleteManyArgs} args - Arguments to filter Jsons to delete. + * @example + * // Delete a few Jsons + * const { count } = await prisma.jsons.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + **/ + deleteMany( + args?: SelectSubset + ): Prisma.PrismaPromise + + /** + * Update zero or more Jsons. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {JsonsUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Jsons + * const jsons = await prisma.jsons.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + **/ + updateMany( + args: SelectSubset + ): Prisma.PrismaPromise + + /** + * Create or update one Jsons. + * @param {JsonsUpsertArgs} args - Arguments to update or create a Jsons. + * @example + * // Update or create a Jsons + * const jsons = await prisma.jsons.upsert({ + * create: { + * // ... data to create a Jsons + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Jsons we want to update + * } + * }) + **/ + upsert( + args: SelectSubset + ): Prisma__JsonsClient> + + /** + * Count the number of Jsons. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {JsonsCountArgs} args - Arguments to filter Jsons to count. + * @example + * // Count the number of Jsons + * const count = await prisma.jsons.count({ + * where: { + * // ... the filter for the Jsons we want to count + * } + * }) + **/ + count( + args?: Subset, + ): Prisma.PrismaPromise< + T extends _Record<'select', any> + ? T['select'] extends true + ? number + : GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Jsons. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {JsonsAggregateArgs} args - Select which aggregations you would like to apply and on what fields. + * @example + * // Ordered by age ascending + * // Where email contains prisma.io + * // Limited to the 10 users + * const aggregations = await prisma.user.aggregate({ + * _avg: { + * age: true, + * }, + * where: { + * email: { + * contains: "prisma.io", + * }, + * }, + * orderBy: { + * age: "asc", + * }, + * take: 10, + * }) + **/ + aggregate(args: Subset): Prisma.PrismaPromise> + + /** + * Group by Jsons. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {JsonsGroupByArgs} args - Group by arguments. + * @example + * // Group by city, order by createdAt, get count + * const result = await prisma.user.groupBy({ + * by: ['city', 'createdAt'], + * orderBy: { + * createdAt: true + * }, + * _count: { + * _all: true + * }, + * }) + * + **/ + groupBy< + T extends JsonsGroupByArgs, + HasSelectOrTake extends Or< + Extends<'skip', Keys>, + Extends<'take', Keys> + >, + OrderByArg extends True extends HasSelectOrTake + ? { orderBy: JsonsGroupByArgs['orderBy'] } + : { orderBy?: JsonsGroupByArgs['orderBy'] }, + OrderFields extends ExcludeUnderscoreKeys>>, + ByFields extends TupleToUnion, + ByValid extends Has, + HavingFields extends GetHavingFields, + HavingValid extends Has, + ByEmpty extends T['by'] extends never[] ? True : False, + InputErrors extends ByEmpty extends True + ? `Error: "by" must not be empty.` + : HavingValid extends False + ? { + [P in HavingFields]: P extends ByFields + ? never + : P extends string + ? `Error: Field "${P}" used in "having" needs to be provided in "by".` + : [ + Error, + 'Field ', + P, + ` in "having" needs to be provided in "by"`, + ] + }[HavingFields] + : 'take' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "take", you also need to provide "orderBy"' + : 'skip' extends Keys + ? 'orderBy' extends Keys + ? ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + : 'Error: If you provide "skip", you also need to provide "orderBy"' + : ByValid extends True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: SubsetIntersection & InputErrors): {} extends InputErrors ? GetJsonsGroupByPayload : Prisma.PrismaPromise + + } + + /** + * The delegate class that acts as a "Promise-like" for Jsons. + * Why is this prefixed with `Prisma__`? + * Because we want to prevent naming conflicts as mentioned in + * https://github.com/prisma/prisma-client-js/issues/707 + */ + export class Prisma__JsonsClient implements Prisma.PrismaPromise { + private readonly _dmmf; + private readonly _queryType; + private readonly _rootField; + private readonly _clientMethod; + private readonly _args; + private readonly _dataPath; + private readonly _errorFormat; + private readonly _measurePerformance?; + private _isList; + private _callsite; + private _requestPromise?; + readonly [Symbol.toStringTag]: 'PrismaPromise'; + constructor(_dmmf: runtime.DMMFClass, _queryType: 'query' | 'mutation', _rootField: string, _clientMethod: string, _args: any, _dataPath: string[], _errorFormat: ErrorFormat, _measurePerformance?: boolean | undefined, _isList?: boolean); + + + private get _document(); + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The + * resolved value cannot be modified from the callback. + * @param onfinally The callback to execute when the Promise is settled (fulfilled or rejected). + * @returns A Promise for the completion of the callback. + */ + finally(onfinally?: (() => void) | undefined | null): Promise; + } + + + + // Custom InputTypes + + /** + * Jsons base type for findUnique actions + */ + export type JsonsFindUniqueArgsBase = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * Filter, which Jsons to fetch. + */ + where: JsonsWhereUniqueInput + } + + /** + * Jsons findUnique + */ + export interface JsonsFindUniqueArgs extends JsonsFindUniqueArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findUniqueOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Jsons findUniqueOrThrow + */ + export type JsonsFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * Filter, which Jsons to fetch. + */ + where: JsonsWhereUniqueInput + } + + + /** + * Jsons base type for findFirst actions + */ + export type JsonsFindFirstArgsBase = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * Filter, which Jsons to fetch. + */ + where?: JsonsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Jsons to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Jsons. + */ + cursor?: JsonsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Jsons from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Jsons. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Jsons. + */ + distinct?: Enumerable + } + + /** + * Jsons findFirst + */ + export interface JsonsFindFirstArgs extends JsonsFindFirstArgsBase { + /** + * Throw an Error if query returns no results + * @deprecated since 4.0.0: use `findFirstOrThrow` method instead + */ + rejectOnNotFound?: RejectOnNotFound + } + + + /** + * Jsons findFirstOrThrow + */ + export type JsonsFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * Filter, which Jsons to fetch. + */ + where?: JsonsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Jsons to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Jsons. + */ + cursor?: JsonsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Jsons from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Jsons. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Jsons. + */ + distinct?: Enumerable + } + + + /** + * Jsons findMany + */ + export type JsonsFindManyArgs = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * Filter, which Jsons to fetch. + */ + where?: JsonsWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Jsons to fetch. + */ + orderBy?: Enumerable + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Jsons. + */ + cursor?: JsonsWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Jsons from the position of the cursor. + */ + take?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Skip the first `n` Jsons. + */ + skip?: number + distinct?: Enumerable + } + + + /** + * Jsons create + */ + export type JsonsCreateArgs = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * The data needed to create a Jsons. + */ + data: XOR + } + + + /** + * Jsons createMany + */ + export type JsonsCreateManyArgs = { + /** + * The data used to create many Jsons. + */ + data: Enumerable + skipDuplicates?: boolean + } + + + /** + * Jsons update + */ + export type JsonsUpdateArgs = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * The data needed to update a Jsons. + */ + data: XOR + /** + * Choose, which Jsons to update. + */ + where: JsonsWhereUniqueInput + } + + + /** + * Jsons updateMany + */ + export type JsonsUpdateManyArgs = { + /** + * The data used to update Jsons. + */ + data: XOR + /** + * Filter which Jsons to update + */ + where?: JsonsWhereInput + } + + + /** + * Jsons upsert + */ + export type JsonsUpsertArgs = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * The filter to search for the Jsons to update in case it exists. + */ + where: JsonsWhereUniqueInput + /** + * In case the Jsons found by the `where` argument doesn't exist, create a new Jsons with this data. + */ + create: XOR + /** + * In case the Jsons was found with the provided `where` argument, update it with this data. + */ + update: XOR + } + + + /** + * Jsons delete + */ + export type JsonsDeleteArgs = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + /** + * Filter which Jsons to delete. + */ + where: JsonsWhereUniqueInput + } + + + /** + * Jsons deleteMany + */ + export type JsonsDeleteManyArgs = { + /** + * Filter which Jsons to delete + */ + where?: JsonsWhereInput + } + + + /** + * Jsons without action + */ + export type JsonsArgs = { + /** + * Select specific fields to fetch from the Jsons + */ + select?: JsonsSelect | null + } + + + + /** + * Enums + */ + + export const BoolsScalarFieldEnum: { + id: 'id', + b: 'b' + }; + + export type BoolsScalarFieldEnum = (typeof BoolsScalarFieldEnum)[keyof typeof BoolsScalarFieldEnum] + + + export const DatetimesScalarFieldEnum: { + id: 'id', + d: 'd', + t: 't' + }; + + export type DatetimesScalarFieldEnum = (typeof DatetimesScalarFieldEnum)[keyof typeof DatetimesScalarFieldEnum] + + + export const FloatsScalarFieldEnum: { + id: 'id', + f8: 'f8' + }; + + export type FloatsScalarFieldEnum = (typeof FloatsScalarFieldEnum)[keyof typeof FloatsScalarFieldEnum] + + + export const IntsScalarFieldEnum: { + id: 'id', + i2: 'i2', + i4: 'i4' + }; + + export type IntsScalarFieldEnum = (typeof IntsScalarFieldEnum)[keyof typeof IntsScalarFieldEnum] + + + export const ItemsScalarFieldEnum: { + id: 'id', + content: 'content', + content_text_null: 'content_text_null', + content_text_null_default: 'content_text_null_default', + intvalue_null: 'intvalue_null', + intvalue_null_default: 'intvalue_null_default' + }; + + export type ItemsScalarFieldEnum = (typeof ItemsScalarFieldEnum)[keyof typeof ItemsScalarFieldEnum] + + + export const JsonNullValueFilter: { + DbNull: typeof DbNull, + JsonNull: typeof JsonNull, + AnyNull: typeof AnyNull + }; + + export type JsonNullValueFilter = (typeof JsonNullValueFilter)[keyof typeof JsonNullValueFilter] + + + export const JsonsScalarFieldEnum: { + id: 'id', + js: 'js', + jsb: 'jsb' + }; + + export type JsonsScalarFieldEnum = (typeof JsonsScalarFieldEnum)[keyof typeof JsonsScalarFieldEnum] + + + export const NullableJsonNullValueInput: { + DbNull: typeof DbNull, + JsonNull: typeof JsonNull + }; + + export type NullableJsonNullValueInput = (typeof NullableJsonNullValueInput)[keyof typeof NullableJsonNullValueInput] + + + export const OtherItemsScalarFieldEnum: { + id: 'id', + content: 'content', + item_id: 'item_id' + }; + + export type OtherItemsScalarFieldEnum = (typeof OtherItemsScalarFieldEnum)[keyof typeof OtherItemsScalarFieldEnum] + + + export const QueryMode: { + default: 'default', + insensitive: 'insensitive' + }; + + export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + + export const SortOrder: { + asc: 'asc', + desc: 'desc' + }; + + export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + + export const TimestampsScalarFieldEnum: { + id: 'id', + created_at: 'created_at', + updated_at: 'updated_at' + }; + + export type TimestampsScalarFieldEnum = (typeof TimestampsScalarFieldEnum)[keyof typeof TimestampsScalarFieldEnum] + + + export const TransactionIsolationLevel: { + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' + }; + + export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + + export const UuidsScalarFieldEnum: { + id: 'id' + }; + + export type UuidsScalarFieldEnum = (typeof UuidsScalarFieldEnum)[keyof typeof UuidsScalarFieldEnum] + + + /** + * Deep Input Types + */ + + + export type ItemsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + content?: StringFilter | string + content_text_null?: StringNullableFilter | string | null + content_text_null_default?: StringNullableFilter | string | null + intvalue_null?: IntNullableFilter | number | null + intvalue_null_default?: IntNullableFilter | number | null + other_items?: XOR | null + } + + export type ItemsOrderByWithRelationInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + other_items?: OtherItemsOrderByWithRelationInput + } + + export type ItemsWhereUniqueInput = { + id?: string + } + + export type ItemsOrderByWithAggregationInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + _count?: ItemsCountOrderByAggregateInput + _avg?: ItemsAvgOrderByAggregateInput + _max?: ItemsMaxOrderByAggregateInput + _min?: ItemsMinOrderByAggregateInput + _sum?: ItemsSumOrderByAggregateInput + } + + export type ItemsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + content?: StringWithAggregatesFilter | string + content_text_null?: StringNullableWithAggregatesFilter | string | null + content_text_null_default?: StringNullableWithAggregatesFilter | string | null + intvalue_null?: IntNullableWithAggregatesFilter | number | null + intvalue_null_default?: IntNullableWithAggregatesFilter | number | null + } + + export type OtherItemsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + content?: StringFilter | string + item_id?: StringNullableFilter | string | null + items?: XOR | null + } + + export type OtherItemsOrderByWithRelationInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + items?: ItemsOrderByWithRelationInput + } + + export type OtherItemsWhereUniqueInput = { + id?: string + item_id?: string + } + + export type OtherItemsOrderByWithAggregationInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + _count?: OtherItemsCountOrderByAggregateInput + _max?: OtherItemsMaxOrderByAggregateInput + _min?: OtherItemsMinOrderByAggregateInput + } + + export type OtherItemsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + content?: StringWithAggregatesFilter | string + item_id?: StringNullableWithAggregatesFilter | string | null + } + + export type TimestampsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + created_at?: DateTimeFilter | Date | string + updated_at?: DateTimeFilter | Date | string + } + + export type TimestampsOrderByWithRelationInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + } + + export type TimestampsWhereUniqueInput = { + id?: string + } + + export type TimestampsOrderByWithAggregationInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + _count?: TimestampsCountOrderByAggregateInput + _max?: TimestampsMaxOrderByAggregateInput + _min?: TimestampsMinOrderByAggregateInput + } + + export type TimestampsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + created_at?: DateTimeWithAggregatesFilter | Date | string + updated_at?: DateTimeWithAggregatesFilter | Date | string + } + + export type DatetimesWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + d?: DateTimeFilter | Date | string + t?: DateTimeFilter | Date | string + } + + export type DatetimesOrderByWithRelationInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + } + + export type DatetimesWhereUniqueInput = { + id?: string + } + + export type DatetimesOrderByWithAggregationInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + _count?: DatetimesCountOrderByAggregateInput + _max?: DatetimesMaxOrderByAggregateInput + _min?: DatetimesMinOrderByAggregateInput + } + + export type DatetimesScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + d?: DateTimeWithAggregatesFilter | Date | string + t?: DateTimeWithAggregatesFilter | Date | string + } + + export type BoolsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + b?: BoolNullableFilter | boolean | null + } + + export type BoolsOrderByWithRelationInput = { + id?: SortOrder + b?: SortOrder + } + + export type BoolsWhereUniqueInput = { + id?: string + } + + export type BoolsOrderByWithAggregationInput = { + id?: SortOrder + b?: SortOrder + _count?: BoolsCountOrderByAggregateInput + _max?: BoolsMaxOrderByAggregateInput + _min?: BoolsMinOrderByAggregateInput + } + + export type BoolsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + b?: BoolNullableWithAggregatesFilter | boolean | null + } + + export type UuidsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: UuidFilter | string + } + + export type UuidsOrderByWithRelationInput = { + id?: SortOrder + } + + export type UuidsWhereUniqueInput = { + id?: string + } + + export type UuidsOrderByWithAggregationInput = { + id?: SortOrder + _count?: UuidsCountOrderByAggregateInput + _max?: UuidsMaxOrderByAggregateInput + _min?: UuidsMinOrderByAggregateInput + } + + export type UuidsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: UuidWithAggregatesFilter | string + } + + export type IntsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + i2?: IntNullableFilter | number | null + i4?: IntNullableFilter | number | null + } + + export type IntsOrderByWithRelationInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + } + + export type IntsWhereUniqueInput = { + id?: string + } + + export type IntsOrderByWithAggregationInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + _count?: IntsCountOrderByAggregateInput + _avg?: IntsAvgOrderByAggregateInput + _max?: IntsMaxOrderByAggregateInput + _min?: IntsMinOrderByAggregateInput + _sum?: IntsSumOrderByAggregateInput + } + + export type IntsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + i2?: IntNullableWithAggregatesFilter | number | null + i4?: IntNullableWithAggregatesFilter | number | null + } + + export type FloatsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + f8?: FloatNullableFilter | number | null + } + + export type FloatsOrderByWithRelationInput = { + id?: SortOrder + f8?: SortOrder + } + + export type FloatsWhereUniqueInput = { + id?: string + } + + export type FloatsOrderByWithAggregationInput = { + id?: SortOrder + f8?: SortOrder + _count?: FloatsCountOrderByAggregateInput + _avg?: FloatsAvgOrderByAggregateInput + _max?: FloatsMaxOrderByAggregateInput + _min?: FloatsMinOrderByAggregateInput + _sum?: FloatsSumOrderByAggregateInput + } + + export type FloatsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + f8?: FloatNullableWithAggregatesFilter | number | null + } + + export type JsonsWhereInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringFilter | string + js?: JsonNullableFilter + jsb?: JsonNullableFilter + } + + export type JsonsOrderByWithRelationInput = { + id?: SortOrder + js?: SortOrder + jsb?: SortOrder + } + + export type JsonsWhereUniqueInput = { + id?: string + } + + export type JsonsOrderByWithAggregationInput = { + id?: SortOrder + js?: SortOrder + jsb?: SortOrder + _count?: JsonsCountOrderByAggregateInput + _max?: JsonsMaxOrderByAggregateInput + _min?: JsonsMinOrderByAggregateInput + } + + export type JsonsScalarWhereWithAggregatesInput = { + AND?: Enumerable + OR?: Enumerable + NOT?: Enumerable + id?: StringWithAggregatesFilter | string + js?: JsonNullableWithAggregatesFilter + jsb?: JsonNullableWithAggregatesFilter + } + + export type ItemsCreateInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + other_items?: OtherItemsCreateNestedOneWithoutItemsInput + } + + export type ItemsUncheckedCreateInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + other_items?: OtherItemsUncheckedCreateNestedOneWithoutItemsInput + } + + export type ItemsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + other_items?: OtherItemsUpdateOneWithoutItemsNestedInput + } + + export type ItemsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + other_items?: OtherItemsUncheckedUpdateOneWithoutItemsNestedInput + } + + export type ItemsCreateManyInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + } + + export type ItemsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type ItemsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type OtherItemsCreateInput = { + id: string + content: string + items?: ItemsCreateNestedOneWithoutOther_itemsInput + } + + export type OtherItemsUncheckedCreateInput = { + id: string + content: string + item_id?: string | null + } + + export type OtherItemsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + items?: ItemsUpdateOneWithoutOther_itemsNestedInput + } + + export type OtherItemsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + item_id?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type OtherItemsCreateManyInput = { + id: string + content: string + item_id?: string | null + } + + export type OtherItemsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + } + + export type OtherItemsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + item_id?: NullableStringFieldUpdateOperationsInput | string | null + } + + export type TimestampsCreateInput = { + id: string + created_at: Date | string + updated_at: Date | string + } + + export type TimestampsUncheckedCreateInput = { + id: string + created_at: Date | string + updated_at: Date | string + } + + export type TimestampsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + created_at?: DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TimestampsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + created_at?: DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TimestampsCreateManyInput = { + id: string + created_at: Date | string + updated_at: Date | string + } + + export type TimestampsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + created_at?: DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type TimestampsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + created_at?: DateTimeFieldUpdateOperationsInput | Date | string + updated_at?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DatetimesCreateInput = { + id: string + d: Date | string + t: Date | string + } + + export type DatetimesUncheckedCreateInput = { + id: string + d: Date | string + t: Date | string + } + + export type DatetimesUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + d?: DateTimeFieldUpdateOperationsInput | Date | string + t?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DatetimesUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + d?: DateTimeFieldUpdateOperationsInput | Date | string + t?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DatetimesCreateManyInput = { + id: string + d: Date | string + t: Date | string + } + + export type DatetimesUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + d?: DateTimeFieldUpdateOperationsInput | Date | string + t?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type DatetimesUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + d?: DateTimeFieldUpdateOperationsInput | Date | string + t?: DateTimeFieldUpdateOperationsInput | Date | string + } + + export type BoolsCreateInput = { + id: string + b?: boolean | null + } + + export type BoolsUncheckedCreateInput = { + id: string + b?: boolean | null + } + + export type BoolsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + b?: NullableBoolFieldUpdateOperationsInput | boolean | null + } + + export type BoolsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + b?: NullableBoolFieldUpdateOperationsInput | boolean | null + } + + export type BoolsCreateManyInput = { + id: string + b?: boolean | null + } + + export type BoolsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + b?: NullableBoolFieldUpdateOperationsInput | boolean | null + } + + export type BoolsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + b?: NullableBoolFieldUpdateOperationsInput | boolean | null + } + + export type UuidsCreateInput = { + id: string + } + + export type UuidsUncheckedCreateInput = { + id: string + } + + export type UuidsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + } + + export type UuidsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + } + + export type UuidsCreateManyInput = { + id: string + } + + export type UuidsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + } + + export type UuidsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + } + + export type IntsCreateInput = { + id: string + i2?: number | null + i4?: number | null + } + + export type IntsUncheckedCreateInput = { + id: string + i2?: number | null + i4?: number | null + } + + export type IntsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + i2?: NullableIntFieldUpdateOperationsInput | number | null + i4?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type IntsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + i2?: NullableIntFieldUpdateOperationsInput | number | null + i4?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type IntsCreateManyInput = { + id: string + i2?: number | null + i4?: number | null + } + + export type IntsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + i2?: NullableIntFieldUpdateOperationsInput | number | null + i4?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type IntsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + i2?: NullableIntFieldUpdateOperationsInput | number | null + i4?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type FloatsCreateInput = { + id: string + f8?: number | null + } + + export type FloatsUncheckedCreateInput = { + id: string + f8?: number | null + } + + export type FloatsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + f8?: NullableFloatFieldUpdateOperationsInput | number | null + } + + export type FloatsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + f8?: NullableFloatFieldUpdateOperationsInput | number | null + } + + export type FloatsCreateManyInput = { + id: string + f8?: number | null + } + + export type FloatsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + f8?: NullableFloatFieldUpdateOperationsInput | number | null + } + + export type FloatsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + f8?: NullableFloatFieldUpdateOperationsInput | number | null + } + + export type JsonsCreateInput = { + id: string + js?: NullableJsonNullValueInput | InputJsonValue + jsb?: NullableJsonNullValueInput | InputJsonValue + } + + export type JsonsUncheckedCreateInput = { + id: string + js?: NullableJsonNullValueInput | InputJsonValue + jsb?: NullableJsonNullValueInput | InputJsonValue + } + + export type JsonsUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + js?: NullableJsonNullValueInput | InputJsonValue + jsb?: NullableJsonNullValueInput | InputJsonValue + } + + export type JsonsUncheckedUpdateInput = { + id?: StringFieldUpdateOperationsInput | string + js?: NullableJsonNullValueInput | InputJsonValue + jsb?: NullableJsonNullValueInput | InputJsonValue + } + + export type JsonsCreateManyInput = { + id: string + js?: NullableJsonNullValueInput | InputJsonValue + jsb?: NullableJsonNullValueInput | InputJsonValue + } + + export type JsonsUpdateManyMutationInput = { + id?: StringFieldUpdateOperationsInput | string + js?: NullableJsonNullValueInput | InputJsonValue + jsb?: NullableJsonNullValueInput | InputJsonValue + } + + export type JsonsUncheckedUpdateManyInput = { + id?: StringFieldUpdateOperationsInput | string + js?: NullableJsonNullValueInput | InputJsonValue + jsb?: NullableJsonNullValueInput | InputJsonValue + } + + export type StringFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringFilter | string + } + + export type StringNullableFilter = { + equals?: string | null + in?: Enumerable | string | null + notIn?: Enumerable | string | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringNullableFilter | string | null + } + + export type IntNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableFilter | number | null + } + + export type OtherItemsRelationFilter = { + is?: OtherItemsWhereInput | null + isNot?: OtherItemsWhereInput | null + } + + export type ItemsCountOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type ItemsAvgOrderByAggregateInput = { + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type ItemsMaxOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type ItemsMinOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + content_text_null?: SortOrder + content_text_null_default?: SortOrder + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type ItemsSumOrderByAggregateInput = { + intvalue_null?: SortOrder + intvalue_null_default?: SortOrder + } + + export type StringWithAggregatesFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringWithAggregatesFilter | string + _count?: NestedIntFilter + _min?: NestedStringFilter + _max?: NestedStringFilter + } + + export type StringNullableWithAggregatesFilter = { + equals?: string | null + in?: Enumerable | string | null + notIn?: Enumerable | string | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + mode?: QueryMode + not?: NestedStringNullableWithAggregatesFilter | string | null + _count?: NestedIntNullableFilter + _min?: NestedStringNullableFilter + _max?: NestedStringNullableFilter + } + + export type IntNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedIntNullableFilter + _min?: NestedIntNullableFilter + _max?: NestedIntNullableFilter + } + + export type ItemsRelationFilter = { + is?: ItemsWhereInput | null + isNot?: ItemsWhereInput | null + } + + export type OtherItemsCountOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + } + + export type OtherItemsMaxOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + } + + export type OtherItemsMinOrderByAggregateInput = { + id?: SortOrder + content?: SortOrder + item_id?: SortOrder + } + + export type DateTimeFilter = { + equals?: Date | string + in?: Enumerable | Enumerable | Date | string + notIn?: Enumerable | Enumerable | Date | string + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeFilter | Date | string + } + + export type TimestampsCountOrderByAggregateInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + } + + export type TimestampsMaxOrderByAggregateInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + } + + export type TimestampsMinOrderByAggregateInput = { + id?: SortOrder + created_at?: SortOrder + updated_at?: SortOrder + } + + export type DateTimeWithAggregatesFilter = { + equals?: Date | string + in?: Enumerable | Enumerable | Date | string + notIn?: Enumerable | Enumerable | Date | string + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeWithAggregatesFilter | Date | string + _count?: NestedIntFilter + _min?: NestedDateTimeFilter + _max?: NestedDateTimeFilter + } + + export type DatetimesCountOrderByAggregateInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + } + + export type DatetimesMaxOrderByAggregateInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + } + + export type DatetimesMinOrderByAggregateInput = { + id?: SortOrder + d?: SortOrder + t?: SortOrder + } + + export type BoolNullableFilter = { + equals?: boolean | null + not?: NestedBoolNullableFilter | boolean | null + } + + export type BoolsCountOrderByAggregateInput = { + id?: SortOrder + b?: SortOrder + } + + export type BoolsMaxOrderByAggregateInput = { + id?: SortOrder + b?: SortOrder + } + + export type BoolsMinOrderByAggregateInput = { + id?: SortOrder + b?: SortOrder + } + + export type BoolNullableWithAggregatesFilter = { + equals?: boolean | null + not?: NestedBoolNullableWithAggregatesFilter | boolean | null + _count?: NestedIntNullableFilter + _min?: NestedBoolNullableFilter + _max?: NestedBoolNullableFilter + } + + export type UuidFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + mode?: QueryMode + not?: NestedUuidFilter | string + } + + export type UuidsCountOrderByAggregateInput = { + id?: SortOrder + } + + export type UuidsMaxOrderByAggregateInput = { + id?: SortOrder + } + + export type UuidsMinOrderByAggregateInput = { + id?: SortOrder + } + + export type UuidWithAggregatesFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + mode?: QueryMode + not?: NestedUuidWithAggregatesFilter | string + _count?: NestedIntFilter + _min?: NestedStringFilter + _max?: NestedStringFilter + } + + export type IntsCountOrderByAggregateInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + } + + export type IntsAvgOrderByAggregateInput = { + i2?: SortOrder + i4?: SortOrder + } + + export type IntsMaxOrderByAggregateInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + } + + export type IntsMinOrderByAggregateInput = { + id?: SortOrder + i2?: SortOrder + i4?: SortOrder + } + + export type IntsSumOrderByAggregateInput = { + i2?: SortOrder + i4?: SortOrder + } + + export type FloatNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableFilter | number | null + } + + export type FloatsCountOrderByAggregateInput = { + id?: SortOrder + f8?: SortOrder + } + + export type FloatsAvgOrderByAggregateInput = { + f8?: SortOrder + } + + export type FloatsMaxOrderByAggregateInput = { + id?: SortOrder + f8?: SortOrder + } + + export type FloatsMinOrderByAggregateInput = { + id?: SortOrder + f8?: SortOrder + } + + export type FloatsSumOrderByAggregateInput = { + f8?: SortOrder + } + + export type FloatNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedFloatNullableFilter + _min?: NestedFloatNullableFilter + _max?: NestedFloatNullableFilter + } + export type JsonNullableFilter = + | PatchUndefined< + Either, Exclude, 'path'>>, + Required + > + | OptionalFlat, 'path'>> + + export type JsonNullableFilterBase = { + equals?: InputJsonValue | JsonNullValueFilter + path?: string[] + string_contains?: string + string_starts_with?: string + string_ends_with?: string + array_contains?: InputJsonValue | null + array_starts_with?: InputJsonValue | null + array_ends_with?: InputJsonValue | null + lt?: InputJsonValue + lte?: InputJsonValue + gt?: InputJsonValue + gte?: InputJsonValue + not?: InputJsonValue | JsonNullValueFilter + } + + export type JsonsCountOrderByAggregateInput = { + id?: SortOrder + js?: SortOrder + jsb?: SortOrder + } + + export type JsonsMaxOrderByAggregateInput = { + id?: SortOrder + } + + export type JsonsMinOrderByAggregateInput = { + id?: SortOrder + } + export type JsonNullableWithAggregatesFilter = + | PatchUndefined< + Either, Exclude, 'path'>>, + Required + > + | OptionalFlat, 'path'>> + + export type JsonNullableWithAggregatesFilterBase = { + equals?: InputJsonValue | JsonNullValueFilter + path?: string[] + string_contains?: string + string_starts_with?: string + string_ends_with?: string + array_contains?: InputJsonValue | null + array_starts_with?: InputJsonValue | null + array_ends_with?: InputJsonValue | null + lt?: InputJsonValue + lte?: InputJsonValue + gt?: InputJsonValue + gte?: InputJsonValue + not?: InputJsonValue | JsonNullValueFilter + _count?: NestedIntNullableFilter + _min?: NestedJsonNullableFilter + _max?: NestedJsonNullableFilter + } + + export type OtherItemsCreateNestedOneWithoutItemsInput = { + create?: XOR + connectOrCreate?: OtherItemsCreateOrConnectWithoutItemsInput + connect?: OtherItemsWhereUniqueInput + } + + export type OtherItemsUncheckedCreateNestedOneWithoutItemsInput = { + create?: XOR + connectOrCreate?: OtherItemsCreateOrConnectWithoutItemsInput + connect?: OtherItemsWhereUniqueInput + } + + export type StringFieldUpdateOperationsInput = { + set?: string + } + + export type NullableStringFieldUpdateOperationsInput = { + set?: string | null + } + + export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type OtherItemsUpdateOneWithoutItemsNestedInput = { + create?: XOR + connectOrCreate?: OtherItemsCreateOrConnectWithoutItemsInput + upsert?: OtherItemsUpsertWithoutItemsInput + disconnect?: boolean + delete?: boolean + connect?: OtherItemsWhereUniqueInput + update?: XOR + } + + export type OtherItemsUncheckedUpdateOneWithoutItemsNestedInput = { + create?: XOR + connectOrCreate?: OtherItemsCreateOrConnectWithoutItemsInput + upsert?: OtherItemsUpsertWithoutItemsInput + disconnect?: boolean + delete?: boolean + connect?: OtherItemsWhereUniqueInput + update?: XOR + } + + export type ItemsCreateNestedOneWithoutOther_itemsInput = { + create?: XOR + connectOrCreate?: ItemsCreateOrConnectWithoutOther_itemsInput + connect?: ItemsWhereUniqueInput + } + + export type ItemsUpdateOneWithoutOther_itemsNestedInput = { + create?: XOR + connectOrCreate?: ItemsCreateOrConnectWithoutOther_itemsInput + upsert?: ItemsUpsertWithoutOther_itemsInput + disconnect?: boolean + delete?: boolean + connect?: ItemsWhereUniqueInput + update?: XOR + } + + export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string + } + + export type NullableBoolFieldUpdateOperationsInput = { + set?: boolean | null + } + + export type NullableFloatFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number + } + + export type NestedStringFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringFilter | string + } + + export type NestedStringNullableFilter = { + equals?: string | null + in?: Enumerable | string | null + notIn?: Enumerable | string | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringNullableFilter | string | null + } + + export type NestedIntNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableFilter | number | null + } + + export type NestedStringWithAggregatesFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringWithAggregatesFilter | string + _count?: NestedIntFilter + _min?: NestedStringFilter + _max?: NestedStringFilter + } + + export type NestedIntFilter = { + equals?: number + in?: Enumerable | number + notIn?: Enumerable | number + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntFilter | number + } + + export type NestedStringNullableWithAggregatesFilter = { + equals?: string | null + in?: Enumerable | string | null + notIn?: Enumerable | string | null + lt?: string + lte?: string + gt?: string + gte?: string + contains?: string + startsWith?: string + endsWith?: string + not?: NestedStringNullableWithAggregatesFilter | string | null + _count?: NestedIntNullableFilter + _min?: NestedStringNullableFilter + _max?: NestedStringNullableFilter + } + + export type NestedIntNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedIntNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedIntNullableFilter + _min?: NestedIntNullableFilter + _max?: NestedIntNullableFilter + } + + export type NestedFloatNullableFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableFilter | number | null + } + + export type NestedDateTimeFilter = { + equals?: Date | string + in?: Enumerable | Enumerable | Date | string + notIn?: Enumerable | Enumerable | Date | string + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeFilter | Date | string + } + + export type NestedDateTimeWithAggregatesFilter = { + equals?: Date | string + in?: Enumerable | Enumerable | Date | string + notIn?: Enumerable | Enumerable | Date | string + lt?: Date | string + lte?: Date | string + gt?: Date | string + gte?: Date | string + not?: NestedDateTimeWithAggregatesFilter | Date | string + _count?: NestedIntFilter + _min?: NestedDateTimeFilter + _max?: NestedDateTimeFilter + } + + export type NestedBoolNullableFilter = { + equals?: boolean | null + not?: NestedBoolNullableFilter | boolean | null + } + + export type NestedBoolNullableWithAggregatesFilter = { + equals?: boolean | null + not?: NestedBoolNullableWithAggregatesFilter | boolean | null + _count?: NestedIntNullableFilter + _min?: NestedBoolNullableFilter + _max?: NestedBoolNullableFilter + } + + export type NestedUuidFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + not?: NestedUuidFilter | string + } + + export type NestedUuidWithAggregatesFilter = { + equals?: string + in?: Enumerable | string + notIn?: Enumerable | string + lt?: string + lte?: string + gt?: string + gte?: string + not?: NestedUuidWithAggregatesFilter | string + _count?: NestedIntFilter + _min?: NestedStringFilter + _max?: NestedStringFilter + } + + export type NestedFloatNullableWithAggregatesFilter = { + equals?: number | null + in?: Enumerable | number | null + notIn?: Enumerable | number | null + lt?: number + lte?: number + gt?: number + gte?: number + not?: NestedFloatNullableWithAggregatesFilter | number | null + _count?: NestedIntNullableFilter + _avg?: NestedFloatNullableFilter + _sum?: NestedFloatNullableFilter + _min?: NestedFloatNullableFilter + _max?: NestedFloatNullableFilter + } + export type NestedJsonNullableFilter = + | PatchUndefined< + Either, Exclude, 'path'>>, + Required + > + | OptionalFlat, 'path'>> + + export type NestedJsonNullableFilterBase = { + equals?: InputJsonValue | JsonNullValueFilter + path?: string[] + string_contains?: string + string_starts_with?: string + string_ends_with?: string + array_contains?: InputJsonValue | null + array_starts_with?: InputJsonValue | null + array_ends_with?: InputJsonValue | null + lt?: InputJsonValue + lte?: InputJsonValue + gt?: InputJsonValue + gte?: InputJsonValue + not?: InputJsonValue | JsonNullValueFilter + } + + export type OtherItemsCreateWithoutItemsInput = { + id: string + content: string + } + + export type OtherItemsUncheckedCreateWithoutItemsInput = { + id: string + content: string + } + + export type OtherItemsCreateOrConnectWithoutItemsInput = { + where: OtherItemsWhereUniqueInput + create: XOR + } + + export type OtherItemsUpsertWithoutItemsInput = { + update: XOR + create: XOR + } + + export type OtherItemsUpdateWithoutItemsInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + } + + export type OtherItemsUncheckedUpdateWithoutItemsInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + } + + export type ItemsCreateWithoutOther_itemsInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + } + + export type ItemsUncheckedCreateWithoutOther_itemsInput = { + id: string + content: string + content_text_null?: string | null + content_text_null_default?: string | null + intvalue_null?: number | null + intvalue_null_default?: number | null + } + + export type ItemsCreateOrConnectWithoutOther_itemsInput = { + where: ItemsWhereUniqueInput + create: XOR + } + + export type ItemsUpsertWithoutOther_itemsInput = { + update: XOR + create: XOR + } + + export type ItemsUpdateWithoutOther_itemsInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + } + + export type ItemsUncheckedUpdateWithoutOther_itemsInput = { + id?: StringFieldUpdateOperationsInput | string + content?: StringFieldUpdateOperationsInput | string + content_text_null?: NullableStringFieldUpdateOperationsInput | string | null + content_text_null_default?: NullableStringFieldUpdateOperationsInput | string | null + intvalue_null?: NullableIntFieldUpdateOperationsInput | number | null + intvalue_null_default?: NullableIntFieldUpdateOperationsInput | number | null + } + + + + /** + * Batch Payload for updateMany & deleteMany & createMany + */ + + export type BatchPayload = { + count: number + } + + /** + * DMMF + */ + export const dmmf: runtime.BaseDMMF +} \ No newline at end of file diff --git a/e2e/satellite_client/src/prisma/schema.prisma b/e2e/satellite_client/src/prisma/schema.prisma index 2529a2493f..c26ee9572b 100644 --- a/e2e/satellite_client/src/prisma/schema.prisma +++ b/e2e/satellite_client/src/prisma/schema.prisma @@ -6,8 +6,7 @@ datasource db { generator electric { provider = "../node_modules/@electric-sql/prisma-generator/dist/bin.js" output = "../generated/client" - relationModel = true - writeNullishInModelTypes = true + relationModel = "false" } generator client { @@ -23,6 +22,7 @@ model Items { intvalue_null Int? intvalue_null_default Int? other_items OtherItems? + @@map("items") } model OtherItems { @@ -30,36 +30,50 @@ model OtherItems { content String item_id String? @unique items Items? @relation(fields: [item_id], references: [id]) + @@map("other_items") } model Timestamps { id String @id created_at DateTime @db.Timestamp(3) updated_at DateTime @db.Timestamptz(3) + @@map("timestamps") } model Datetimes { id String @id d DateTime @db.Date t DateTime @db.Time(3) + @@map("datetimes") } model Bools { id String @id b Boolean? + @@map("bools") } model Uuids { id String @id @db.Uuid /// @zod.string.uuid() + @@map("uuids") } model Ints { id String @id i2 Int? @db.SmallInt /// @zod.number.int().gte(-32768).lte(32767) i4 Int? /// @zod.number.int().gte(-2147483648).lte(2147483647) + @@map("ints") } model Floats { id String @id f8 Float? @db.DoublePrecision /// @zod.custom.use(z.number().or(z.nan())) + @@map("floats") +} + +model Jsons { + id String @id + js Json? @db.Json + jsb Json? + @@map("jsons") } \ No newline at end of file diff --git a/e2e/tests/03.19_node_satellite_can_sync_json.lux b/e2e/tests/03.19_node_satellite_can_sync_json.lux new file mode 100644 index 0000000000..4e2d7474c5 --- /dev/null +++ b/e2e/tests/03.19_node_satellite_can_sync_json.lux @@ -0,0 +1,102 @@ +[doc NodeJS Satellite correctly syncs json values from and to Electric] +[include _shared.luxinc] +[include _satellite_macros.luxinc] + +[invoke setup] + +[shell proxy_1] + [local sql= + """ + CREATE TABLE public.jsons ( + id TEXT PRIMARY KEY, + -- js JSON, + jsb JSONB + ); + ALTER TABLE public.jsons ENABLE ELECTRIC; + """] + [invoke migrate_pg 20230908 $sql] + +[invoke setup_client 1 electric_1 5133] + +[shell satellite_1] + [invoke node_await_table "jsons"] + [invoke node_sync_table "jsons"] + +[shell pg_1] + #!INSERT INTO public.jsons (id, js, jsb) VALUES ('row1', '{ "a": 1, "c": true, "b": "foo", "d": null, "e": [1,2,3] }', '[ { "a": 1 }, { "d": false, "b": 5 } ]'); + !INSERT INTO public.jsons (id, jsb) VALUES ('row1', '[ { "a": 1 }, { "d": false, "b": 5 } ]'); + ??INSERT 0 1 + +[shell satellite_1] + # Wait for the rows to arrive + [invoke node_await_get_json "row1"] + + # read raw JSON that is stored in the DB + # json must preserve whitespace and key ordering + #[invoke node_get_json_raw "row1" "{ a: 1, c: true, b: \"foo\", d: null, e: [1,2,3] }"] + # when parsed as JSON, whitespace is trimmed but key order is kept + #[invoke node_get_json "row1" "{ a: 1, c: true, b: \"foo\", d: null, e: [1,2,3] }"] + # jsonb trims white space and sorts keys + [invoke node_get_jsonb_raw "row1" "[{\"a\": 1}, {\"b\": 5, \"d\": false}]"] + [invoke node_get_jsonb "row1" "[ { a: 1 }, { b: 5, d: false } ]"] + + # write JSON null value and DB NULL value + [invoke node_write_json "row2" "client.JsonNull" "null"] + # read JsonNull value + #[invoke node_get_json "row2" "{ __is_electric_json_null__: true }"] + [invoke node_get_jsonb "row2" "null"] + + # TODO: also write JsonNull to jsonb col because we cannot test the js col yet + + # write regular JSON values + [invoke node_write_json "row3" 500 "{ a: true, b: [ 1, 2 ] }"] + #[invoke node_get_json "row3" 500] + [invoke node_get_jsonb "row3" "{ a: true, b: [ 1, 2 ] }"] + + [invoke node_write_json "row4" "[ 1, { a: \"foo\" }, true ]" "'bar'"] + #[invoke node_get_json "row4" "[ 1, { a: \"foo\" }, true ]"] + [invoke node_get_jsonb "row4" "'bar'"] + +[shell pg_1] + [invoke wait-for "SELECT * FROM public.jsons;" "row4" 10 $psql] + + !SELECT * FROM public.jsons; + #??row1 | {"a": 1, "c": true, "b": "foo", "d": null, "e": [1,2,3] } | [{"a": 1}, {"b": {"c": true}, "d": false}] + #??row2 | { __is_electric_json_null__: true } | null + #??row3 | 500 | {"a": true, "b": [1, 2]} + #??row4 | [ 1, { a: "foo" }, true ] | "bar" + ??row1 | [{"a": 1}, {"b": 5, "d": false}] + ??row2 | + ??row3 | {"a": true, "b": [1, 2]} + ??row4 | "bar" + +# Start a new Satellite client and verify that it receives all rows +[invoke setup_client 2 electric_1 5133] + +[shell satellite_2] + [invoke node_await_table "jsons"] + [invoke node_sync_table "jsons"] + + # Wait for the rows to arrive + [invoke node_await_get_json "row4"] + + # read raw JSON that is stored in the DB + # json must preserve whitespace and key ordering + #[invoke node_get_json_raw "row1" "{ a: 1, c: true, b: \"foo\", d: null, e: [1,2,3] }"] + # when parsed as JSON, whitespace is trimmed but key order is kept + #[invoke node_get_json "row1" "{ a: 1, c: true, b: \"foo\", d: null, e: [1,2,3] }"] + # jsonb trims white space and sorts keys + [invoke node_get_jsonb_raw "row1" "[{\"a\": 1}, {\"b\": 5, \"d\": false}]"] + [invoke node_get_jsonb "row1" "[ { a: 1 }, { b: 5, d: false } ]"] + + #[invoke node_get_json "row2" "{ __is_electric_json_null__: true }"] + [invoke node_get_jsonb "row2" "null"] + + #[invoke node_get_json "row3" 500] + [invoke node_get_jsonb "row3" "{ a: true, b: [ 1, 2 ] }"] + + #[invoke node_get_json "row4" "[ 1, { a: \"foo\" }, true ]"] + [invoke node_get_jsonb "row4" "'bar'"] + +[cleanup] + [invoke teardown] diff --git a/e2e/tests/_satellite_macros.luxinc b/e2e/tests/_satellite_macros.luxinc index c981c208de..2b410ad9c9 100644 --- a/e2e/tests/_satellite_macros.luxinc +++ b/e2e/tests/_satellite_macros.luxinc @@ -55,6 +55,10 @@ [invoke wait-for "await client.get_float(db, '${id}')" "${id}" 10 $node] [endmacro] +[macro node_await_get_json id] + [invoke wait-for "await client.get_jsonb(db, '${id}')" "${id}" 10 $node] +[endmacro] + [macro node_write_float id value] # Can write valid floats to the DB !await client.write_float(db, '${id}', ${value}) @@ -80,6 +84,38 @@ ??$node [endmacro] +[macro node_get_json_raw id expected_json] + !await client.get_json_raw(db, '${id}') + ??${expected_json} + ??$node +[endmacro] + +[macro node_get_jsonb_raw id expected_jsonb] + !await client.get_jsonb_raw(db, '${id}') + ??${expected_jsonb} + ??$node +[endmacro] + +[macro node_get_json id expected_json] + !await client.get_json(db, '${id}') + ??{ id: '${id}', js: ${expected_json} } + ??$node +[endmacro] + +[macro node_get_jsonb id expected_jsonb] + !await client.get_jsonb(db, '${id}') + ??{ id: '${id}', jsb: ${expected_jsonb} } + ??$node +[endmacro] + +[macro node_write_json id json_value jsonb_value] + # Can write valid JSON to the DB + !await client.write_json(db, '${id}', ${json_value}, ${jsonb_value}) + #??{ id: '${id}', js: ${json_value}, jsb: ${jsonb_value} } + ??{ id: '${id}', jsb: ${jsonb_value} } + ??$node +[endmacro] + [macro node_await_get_timestamps match] [invoke wait-for "await client.get_timestamps(db)" "${match}" 10 $node] [endmacro] From c1d63d408a571ba7f9654a7eefd1823d46d3249c Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Tue, 14 Nov 2023 00:48:14 +0200 Subject: [PATCH 07/11] fixup! e2e test for jsonb values --- .../03.19_node_satellite_can_sync_json.lux | 18 ++++++++++++------ e2e/tests/_satellite_macros.luxinc | 2 +- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/e2e/tests/03.19_node_satellite_can_sync_json.lux b/e2e/tests/03.19_node_satellite_can_sync_json.lux index 4e2d7474c5..e091d1ca72 100644 --- a/e2e/tests/03.19_node_satellite_can_sync_json.lux +++ b/e2e/tests/03.19_node_satellite_can_sync_json.lux @@ -53,9 +53,12 @@ #[invoke node_get_json "row3" 500] [invoke node_get_jsonb "row3" "{ a: true, b: [ 1, 2 ] }"] - [invoke node_write_json "row4" "[ 1, { a: \"foo\" }, true ]" "'bar'"] - #[invoke node_get_json "row4" "[ 1, { a: \"foo\" }, true ]"] - [invoke node_get_jsonb "row4" "'bar'"] + [invoke node_write_json "row4" "'bar'" "[ 1, { a: 'foo' }, true ]"] + # [invoke node_get_json "row4" "'bar'"] + [invoke node_get_jsonb "row4" "[ 1, { a: 'foo' }, true ]"] + + [invoke node_write_json "row5" "null" "[\"it's ⚡\", {}, \"\\u2603 under \\u2602\"]"] + [invoke node_get_jsonb "row5" "[ \"it's ⚡\", {}, '☃ under ☂' ]"] [shell pg_1] [invoke wait-for "SELECT * FROM public.jsons;" "row4" 10 $psql] @@ -68,7 +71,8 @@ ??row1 | [{"a": 1}, {"b": 5, "d": false}] ??row2 | ??row3 | {"a": true, "b": [1, 2]} - ??row4 | "bar" + ??row4 | [1, {"a": "foo"}, true] + ??row5 | ["it's ⚡", {}, "☃ under ☂"] # Start a new Satellite client and verify that it receives all rows [invoke setup_client 2 electric_1 5133] @@ -95,8 +99,10 @@ #[invoke node_get_json "row3" 500] [invoke node_get_jsonb "row3" "{ a: true, b: [ 1, 2 ] }"] - #[invoke node_get_json "row4" "[ 1, { a: \"foo\" }, true ]"] - [invoke node_get_jsonb "row4" "'bar'"] + #[invoke node_get_json "row4" "'bar'"] + [invoke node_get_jsonb "row4" "[ 1, { a: 'foo' }, true ]"] + + [invoke node_get_jsonb "row5" "[ \"it's ⚡\", {}, '☃ under ☂' ]"] [cleanup] [invoke teardown] diff --git a/e2e/tests/_satellite_macros.luxinc b/e2e/tests/_satellite_macros.luxinc index 2b410ad9c9..6553f54c83 100644 --- a/e2e/tests/_satellite_macros.luxinc +++ b/e2e/tests/_satellite_macros.luxinc @@ -112,7 +112,7 @@ # Can write valid JSON to the DB !await client.write_json(db, '${id}', ${json_value}, ${jsonb_value}) #??{ id: '${id}', js: ${json_value}, jsb: ${jsonb_value} } - ??{ id: '${id}', jsb: ${jsonb_value} } + # ??{ id: '${id}', jsb: ${jsonb_value} } ??$node [endmacro] From 80c1dc1a689733059cc2fed6b04ac251d07c933e Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Tue, 14 Nov 2023 14:18:12 +0200 Subject: [PATCH 08/11] Add unsupported JSON features to the E2E test for demo purposes --- .../03.19_node_satellite_can_sync_json.lux | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/e2e/tests/03.19_node_satellite_can_sync_json.lux b/e2e/tests/03.19_node_satellite_can_sync_json.lux index e091d1ca72..ec0fe9a3d7 100644 --- a/e2e/tests/03.19_node_satellite_can_sync_json.lux +++ b/e2e/tests/03.19_node_satellite_can_sync_json.lux @@ -60,6 +60,31 @@ [invoke node_write_json "row5" "null" "[\"it's ⚡\", {}, \"\\u2603 under \\u2602\"]"] [invoke node_get_jsonb "row5" "[ \"it's ⚡\", {}, '☃ under ☂' ]"] + # JSON does not support special floating-point values. Per the builtin JSON.stringify() function: + # + # > JSON.stringify([NaN, Infinity, -Infinity]) + # '[null,null,null]' + # + [invoke node_write_json "row6" "null" "[NaN, Infinity, -Infinity]"] + [invoke node_get_jsonb "row6" "[ null, null, null ]"] + + # Even though JSON can encode the NUL code point and unpaired surrogates, those will fail Postgres' jsonb validation. + # Per the builtin JSON.stringify() function: + # + # > JSON.stringify("hello\x00NUL") + # '"hello\\u0000NUL"' + # > JSON.stringify("\ud83d\ude43") + # '"🙃"' + # > JSON.stringify("\ud83d") + # '"\\ud83d"' + # > JSON.stringify("\ude43") + # '"\\ude43"' + # + # NOTE: this currently causes Electric's validation to fail because the chosen JSON library + # does not support Unicode escape sequences. + [invoke node_write_json "row7" "null" "['\x00', '\ud83d\ude43', '\ud83d', '\ude43']"] + [invoke node_get_jsonb "row7" "[ '\"\\u0000\"', '\"🙃\"', '\"\\ud83d\"', '\"\\ude43\"' ]"] + [shell pg_1] [invoke wait-for "SELECT * FROM public.jsons;" "row4" 10 $psql] From 73c3766048325676141ce9e7fb9a52dd5a515c1c Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 28 Nov 2023 09:06:16 +0100 Subject: [PATCH 09/11] Map Prisma's Json type to the right PG type --- .../tableDescriptionWriters/writeTableSchemas.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/generator/src/functions/tableDescriptionWriters/writeTableSchemas.ts b/generator/src/functions/tableDescriptionWriters/writeTableSchemas.ts index 9bd25d58f7..48c47877c3 100644 --- a/generator/src/functions/tableDescriptionWriters/writeTableSchemas.ts +++ b/generator/src/functions/tableDescriptionWriters/writeTableSchemas.ts @@ -107,7 +107,6 @@ function pgType(field: ExtendedDMMFField, modelName: string): string { const prismaType = field.type const attributes = field.attributes switch (prismaType) { - // BigInt, Boolean, Bytes, DateTime, Decimal, Float, Int, JSON, String case 'String': return stringToPg(attributes) case 'Int': @@ -125,12 +124,22 @@ function pgType(field: ExtendedDMMFField, modelName: string): string { case 'Float': return 'FLOAT8' case 'Json': - return 'JSON' + return jsonToPg(attributes) default: return 'UNRECOGNIZED PRISMA TYPE' } } +function jsonToPg(attributes: Array) { + const pgTypeAttribute = attributes.find((a) => a.type.startsWith('@db')) + if (pgTypeAttribute && pgTypeAttribute.type === '@db.Json') { + return 'JSON' + } else { + // default mapping for Prisma's `Json` type is PG's JSONB + return 'JSONB' + } +} + function dateTimeToPg( attributes: Array, field: string, From 7e3be71331615d05e4a9df9eb5aef9651e08b7e2 Mon Sep 17 00:00:00 2001 From: Kevin De Porre Date: Tue, 28 Nov 2023 09:18:44 +0100 Subject: [PATCH 10/11] Improve comments and remove some obsolete comments --- .../typescript/src/client/conversions/datatypes/json.ts | 7 +------ clients/typescript/test/client/conversions/sqlite.test.ts | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/clients/typescript/src/client/conversions/datatypes/json.ts b/clients/typescript/src/client/conversions/datatypes/json.ts index 598bc1c6f0..6e965eafff 100644 --- a/clients/typescript/src/client/conversions/datatypes/json.ts +++ b/clients/typescript/src/client/conversions/datatypes/json.ts @@ -4,7 +4,7 @@ type JSON = string | number | boolean | Array | Record export function serialiseJSON(v: JSON): string { if (isJsonNull(v)) { - // user provided the special Prisma.JsonNull value + // user provided the special `JsonNull` value // to indicate a JSON null value rather than a DB NULL return JSON.stringify(null) } @@ -25,8 +25,3 @@ function isJsonNull(v: JSON): boolean { v['__is_electric_json_null__'] ) } - -// TODO: do not use prisma's json null value -// but define our own -// and modify the generator to accept ours -// then we no longer have to pass it all the way through until here diff --git a/clients/typescript/test/client/conversions/sqlite.test.ts b/clients/typescript/test/client/conversions/sqlite.test.ts index b7a580f852..6916ed81ee 100644 --- a/clients/typescript/test/client/conversions/sqlite.test.ts +++ b/clients/typescript/test/client/conversions/sqlite.test.ts @@ -233,7 +233,7 @@ test.serial('json is converted correctly to SQLite', async (t) => { await tbl.create({ data: { id: 2, - json: null, // TODO: fix this type error --> update the typings in the generator + json: null, }, }) From ee059cdb147f663aa4c9385696a457f4f10dd47e Mon Sep 17 00:00:00 2001 From: Oleksii Sholik Date: Tue, 28 Nov 2023 16:14:46 +0200 Subject: [PATCH 11/11] Remove demo code from the E2E test --- .../03.19_node_satellite_can_sync_json.lux | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/e2e/tests/03.19_node_satellite_can_sync_json.lux b/e2e/tests/03.19_node_satellite_can_sync_json.lux index ec0fe9a3d7..4b2e0e4fba 100644 --- a/e2e/tests/03.19_node_satellite_can_sync_json.lux +++ b/e2e/tests/03.19_node_satellite_can_sync_json.lux @@ -46,27 +46,22 @@ #[invoke node_get_json "row2" "{ __is_electric_json_null__: true }"] [invoke node_get_jsonb "row2" "null"] - # TODO: also write JsonNull to jsonb col because we cannot test the js col yet + [invoke node_write_json "row3" "null" "client.JsonNull"] + # read JsonNull value + #[invoke node_get_json "row3" "null"] + [invoke node_get_jsonb "row3" "{ __is_electric_json_null__: true }"] # write regular JSON values - [invoke node_write_json "row3" 500 "{ a: true, b: [ 1, 2 ] }"] - #[invoke node_get_json "row3" 500] - [invoke node_get_jsonb "row3" "{ a: true, b: [ 1, 2 ] }"] - - [invoke node_write_json "row4" "'bar'" "[ 1, { a: 'foo' }, true ]"] - # [invoke node_get_json "row4" "'bar'"] - [invoke node_get_jsonb "row4" "[ 1, { a: 'foo' }, true ]"] + [invoke node_write_json "row4" 500 "{ a: true, b: [ 1, 2 ] }"] + #[invoke node_get_json "row4" 500] + [invoke node_get_jsonb "row4" "{ a: true, b: [ 1, 2 ] }"] - [invoke node_write_json "row5" "null" "[\"it's ⚡\", {}, \"\\u2603 under \\u2602\"]"] - [invoke node_get_jsonb "row5" "[ \"it's ⚡\", {}, '☃ under ☂' ]"] + [invoke node_write_json "row5" "'bar'" "[ 1, { a: 'foo' }, true ]"] + # [invoke node_get_json "row5" "'bar'"] + [invoke node_get_jsonb "row5" "[ 1, { a: 'foo' }, true ]"] - # JSON does not support special floating-point values. Per the builtin JSON.stringify() function: - # - # > JSON.stringify([NaN, Infinity, -Infinity]) - # '[null,null,null]' - # - [invoke node_write_json "row6" "null" "[NaN, Infinity, -Infinity]"] - [invoke node_get_jsonb "row6" "[ null, null, null ]"] + [invoke node_write_json "row6" "null" "[\"it's ⚡\", {}, \"\\u2603 under \\u2602\"]"] + [invoke node_get_jsonb "row6" "[ \"it's ⚡\", {}, '☃ under ☂' ]"] # Even though JSON can encode the NUL code point and unpaired surrogates, those will fail Postgres' jsonb validation. # Per the builtin JSON.stringify() function: @@ -80,10 +75,12 @@ # > JSON.stringify("\ude43") # '"\\ude43"' # + # See VAX-1365. + # # NOTE: this currently causes Electric's validation to fail because the chosen JSON library # does not support Unicode escape sequences. - [invoke node_write_json "row7" "null" "['\x00', '\ud83d\ude43', '\ud83d', '\ude43']"] - [invoke node_get_jsonb "row7" "[ '\"\\u0000\"', '\"🙃\"', '\"\\ud83d\"', '\"\\ude43\"' ]"] + #[invoke node_write_json "row7" "null" "['\x00', '\ud83d\ude43', '\ud83d', '\ude43']"] + #[invoke node_get_jsonb "row7" "[ '\"\\u0000\"', '\"🙃\"', '\"\\ud83d\"', '\"\\ude43\"' ]"] [shell pg_1] [invoke wait-for "SELECT * FROM public.jsons;" "row4" 10 $psql] @@ -95,9 +92,10 @@ #??row4 | [ 1, { a: "foo" }, true ] | "bar" ??row1 | [{"a": 1}, {"b": 5, "d": false}] ??row2 | - ??row3 | {"a": true, "b": [1, 2]} - ??row4 | [1, {"a": "foo"}, true] - ??row5 | ["it's ⚡", {}, "☃ under ☂"] + ??row3 | null + ??row4 | {"a": true, "b": [1, 2]} + ??row5 | [1, {"a": "foo"}, true] + ??row6 | ["it's ⚡", {}, "☃ under ☂"] # Start a new Satellite client and verify that it receives all rows [invoke setup_client 2 electric_1 5133] @@ -107,7 +105,7 @@ [invoke node_sync_table "jsons"] # Wait for the rows to arrive - [invoke node_await_get_json "row4"] + [invoke node_await_get_json "row6"] # read raw JSON that is stored in the DB # json must preserve whitespace and key ordering @@ -121,13 +119,16 @@ #[invoke node_get_json "row2" "{ __is_electric_json_null__: true }"] [invoke node_get_jsonb "row2" "null"] - #[invoke node_get_json "row3" 500] - [invoke node_get_jsonb "row3" "{ a: true, b: [ 1, 2 ] }"] + #[invoke node_get_json "row3" "null"] + [invoke node_get_jsonb "row3" "{ __is_electric_json_null__: true }"] + + #[invoke node_get_json "row4" 500] + [invoke node_get_jsonb "row4" "{ a: true, b: [ 1, 2 ] }"] - #[invoke node_get_json "row4" "'bar'"] - [invoke node_get_jsonb "row4" "[ 1, { a: 'foo' }, true ]"] + #[invoke node_get_json "row5" "'bar'"] + [invoke node_get_jsonb "row5" "[ 1, { a: 'foo' }, true ]"] - [invoke node_get_jsonb "row5" "[ \"it's ⚡\", {}, '☃ under ☂' ]"] + [invoke node_get_jsonb "row6" "[ \"it's ⚡\", {}, '☃ under ☂' ]"] [cleanup] [invoke teardown]