From 6f561750dff82a46d56c74811e5a52f52227c87f Mon Sep 17 00:00:00 2001 From: Nikolas Burk Date: Wed, 1 Oct 2025 13:54:35 +0200 Subject: [PATCH 01/13] update react-router-7 example --- .../app/generated/prisma/browser.ts | 23 + .../app/generated/prisma/client.ts | 47 + .../app/generated/prisma/commonInputTypes.ts | 167 +++ .../app/generated/prisma/enums.ts | 14 + .../app/generated/prisma/internal/class.ts | 232 ++++ .../prisma/internal/prismaNamespace.ts | 754 +++++++++++ .../prisma/internal/prismaNamespaceBrowser.ts | 94 ++ .../app/generated/prisma/models.ts | 11 + .../app/generated/prisma/models/Todo.ts | 1127 +++++++++++++++++ orm/react-router-7/app/lib/prisma.ts | 2 +- orm/react-router-7/package.json | 4 +- orm/react-router-7/prisma/schema.prisma | 4 +- 12 files changed, 2475 insertions(+), 4 deletions(-) create mode 100644 orm/react-router-7/app/generated/prisma/browser.ts create mode 100644 orm/react-router-7/app/generated/prisma/client.ts create mode 100644 orm/react-router-7/app/generated/prisma/commonInputTypes.ts create mode 100644 orm/react-router-7/app/generated/prisma/enums.ts create mode 100644 orm/react-router-7/app/generated/prisma/internal/class.ts create mode 100644 orm/react-router-7/app/generated/prisma/internal/prismaNamespace.ts create mode 100644 orm/react-router-7/app/generated/prisma/internal/prismaNamespaceBrowser.ts create mode 100644 orm/react-router-7/app/generated/prisma/models.ts create mode 100644 orm/react-router-7/app/generated/prisma/models/Todo.ts diff --git a/orm/react-router-7/app/generated/prisma/browser.ts b/orm/react-router-7/app/generated/prisma/browser.ts new file mode 100644 index 000000000000..885e34911899 --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/browser.ts @@ -0,0 +1,23 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma-related types and utilities in a browser. + * Use it to get access to models, enums, and input types. + * + * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only. + * See `client.ts` for the standard, server-side entry point. + * + * 🟢 You can import this file directly. + */ + +import * as Prisma from './internal/prismaNamespaceBrowser' +export { Prisma } +export * as $Enums from './enums' +export * from './enums'; +/** + * Model Todo + * + */ +export type Todo = Prisma.TodoModel diff --git a/orm/react-router-7/app/generated/prisma/client.ts b/orm/react-router-7/app/generated/prisma/client.ts new file mode 100644 index 000000000000..7e96ad4ea485 --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/client.ts @@ -0,0 +1,47 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types. + * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead. + * + * 🟢 You can import this file directly. + */ + +import * as process from 'node:process' +import * as path from 'node:path' +import { fileURLToPath } from 'node:url' +globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url)) + +import * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums" +import * as $Class from "./internal/class" +import * as Prisma from "./internal/prismaNamespace" + +export * as $Enums from './enums' +export * from "./enums" +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Todos + * const todos = await prisma.todo.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export const PrismaClient = $Class.getPrismaClientClass(__dirname) +export type PrismaClient = $Class.PrismaClient +export { Prisma } + + + +/** + * Model Todo + * + */ +export type Todo = Prisma.TodoModel diff --git a/orm/react-router-7/app/generated/prisma/commonInputTypes.ts b/orm/react-router-7/app/generated/prisma/commonInputTypes.ts new file mode 100644 index 000000000000..ac3280bee2ab --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/commonInputTypes.ts @@ -0,0 +1,167 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports various common sort, input & filter types that are not directly linked to a particular model. + * + * 🟢 You can import this file directly. + */ + +import type * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums" +import type * as Prisma from "./internal/prismaNamespace" + + +export type StringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type DateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeFilter<$PrismaModel> +} + +export type NestedStringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type NestedDateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type NestedIntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeFilter<$PrismaModel> +} + + diff --git a/orm/react-router-7/app/generated/prisma/enums.ts b/orm/react-router-7/app/generated/prisma/enums.ts new file mode 100644 index 000000000000..0189a3446d4f --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/enums.ts @@ -0,0 +1,14 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* +* This file exports all enum related types from the schema. +* +* 🟢 You can import this file directly. +*/ + + + +// This file is empty because there are no enums in the schema. +export {} diff --git a/orm/react-router-7/app/generated/prisma/internal/class.ts b/orm/react-router-7/app/generated/prisma/internal/class.ts new file mode 100644 index 000000000000..f095d2bb96f0 --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/internal/class.ts @@ -0,0 +1,232 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * Please import the `PrismaClient` class from the `client.ts` file instead. + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "./prismaNamespace" + + +const config: runtime.GetPrismaClientConfig = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client" + }, + "output": { + "value": "/Users/nikolasburk/Desktop/examples-v7/orm/react-router-7/app/generated/prisma", + "fromEnvVar": null + }, + "config": { + "engineType": "client" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "darwin", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "/Users/nikolasburk/Desktop/examples-v7/orm/react-router-7/prisma/schema.prisma", + "isCustomOutput": true + }, + "relativePath": "../../../prisma", + "clientVersion": "6.16.3", + "engineVersion": "bb420e667c1820a8c05a38023385f6cc7ef8e83a", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "postinstall": false, + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client\"\n engineType = \"client\"\n output = \"../app/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel Todo {\n id String @id @default(cuid())\n title String\n complete Boolean @default(false)\n createdAt DateTime @default(now())\n}\n", + "inlineSchemaHash": "55b0a1fd7ceefc1e41ec4efffd8398ec936c90710468c070cbd22d7d65c0ec71", + "copyEngine": true, + "runtimeDataModel": { + "models": {}, + "enums": {}, + "types": {} + }, + "dirname": "" +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"Todo\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"complete\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.engineWasm = undefined + +async function decodeBase64AsWasm(wasmBase64: string): Promise { + const { Buffer } = await import('node:buffer') + const wasmArray = Buffer.from(wasmBase64, 'base64') + return new WebAssembly.Module(wasmArray) +} + +config.compilerWasm = { + getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"), + + getQueryCompilerWasmModule: async () => { + const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.postgresql.wasm-base64.mjs") + return await decodeBase64AsWasm(wasm) + } +} + + + + +export type LogOptions = + 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never + +export interface PrismaClientConstructor { + /** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Todos + * const todos = await prisma.todo.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + + new < + Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + LogOpts extends LogOptions = LogOptions, + OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'], + ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs + >(options?: Prisma.Subset ): PrismaClient +} + +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Todos + * const todos = await prisma.todo.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + +export interface PrismaClient< + in LogOpts extends Prisma.LogLevel = never, + in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'], + in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs +> { + [K: symbol]: { types: Prisma.TypeMap['other'] } + + $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient; + + /** + * Connect with the database + */ + $connect(): runtime.Types.Utils.JsPromise; + + /** + * Disconnect from the database + */ + $disconnect(): runtime.Types.Utils.JsPromise; + +/** + * 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 }): runtime.Types.Utils.JsPromise> + + $transaction(fn: (prisma: Omit) => runtime.Types.Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise + + + $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs, runtime.Types.Utils.Call, { + extArgs: ExtArgs + }>> + + /** + * `prisma.todo`: Exposes CRUD operations for the **Todo** model. + * Example usage: + * ```ts + * // Fetch zero or more Todos + * const todos = await prisma.todo.findMany() + * ``` + */ + get todo(): Prisma.TodoDelegate; +} + +export function getPrismaClientClass(dirname: string): PrismaClientConstructor { + config.dirname = dirname + return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor +} diff --git a/orm/react-router-7/app/generated/prisma/internal/prismaNamespace.ts b/orm/react-router-7/app/generated/prisma/internal/prismaNamespace.ts new file mode 100644 index 000000000000..073004afc4a4 --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/internal/prismaNamespace.ts @@ -0,0 +1,754 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the client.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "../models" +import { type PrismaClient } from "./class" + +export type * from '../models' + +export type DMMF = typeof runtime.DMMF + +export type PrismaPromise = runtime.Types.Public.PrismaPromise + +/** + * Prisma Errors + */ + +export const PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError +export type PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + +export const PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError +export type PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + +export const PrismaClientRustPanicError = runtime.PrismaClientRustPanicError +export type PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + +export const PrismaClientInitializationError = runtime.PrismaClientInitializationError +export type PrismaClientInitializationError = runtime.PrismaClientInitializationError + +export const PrismaClientValidationError = runtime.PrismaClientValidationError +export type PrismaClientValidationError = runtime.PrismaClientValidationError + +/** + * Re-export of sql-template-tag + */ +export const sql = runtime.sqltag +export const empty = runtime.empty +export const join = runtime.join +export const raw = runtime.raw +export const Sql = runtime.Sql +export type Sql = runtime.Sql + + + +/** + * Decimal.js + */ +export const Decimal = runtime.Decimal +export type 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 + +/** +* Extensions +*/ +export type Extension = runtime.Types.Extensions.UserArgs +export const getExtensionContext = runtime.Extensions.getExtensionContext +export type Args = runtime.Types.Public.Args +export type Payload = runtime.Types.Public.Payload +export type Result = runtime.Types.Public.Result +export type Exact = runtime.Types.Public.Exact + +export type PrismaVersion = { + client: string + engine: string +} + +/** + * Prisma Client JS version: 6.16.3 + * Query Engine version: bb420e667c1820a8c05a38023385f6cc7ef8e83a + */ +export const prismaVersion: PrismaVersion = { + client: "6.16.3", + engine: "bb420e667c1820a8c05a38023385f6cc7ef8e83a" +} + +/** + * Utility Types + */ + +export type JsonObject = runtime.JsonObject +export type JsonArray = runtime.JsonArray +export type JsonValue = runtime.JsonValue +export type InputJsonObject = runtime.InputJsonObject +export type InputJsonArray = runtime.InputJsonArray +export type InputJsonValue = runtime.InputJsonValue + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +type SelectAndInclude = { + select: any + include: any +} + +type SelectAndOmit = { + select: any + omit: any +} + +/** + * 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; + +/** + * 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`.' + : T extends SelectAndOmit + ? 'Please either choose `select` or `omit`.' + : {}) + +/** + * 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 + */ +export 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] + +export type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 +> = O extends unknown ? _Either : never + +export type Union = any + +export 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 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 +export 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 ? P : 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>>; + +export type Boolean = True | False + +export type True = 1 + +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 + +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 + +export 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 +export type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + +/** + * Like `Pick`, but additionally can also accept an array of keys + */ +export type PickEnumerable | keyof T> = Prisma__Pick> + +/** + * Exclude all keys with underscores + */ +export type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + +export type FieldRef = runtime.FieldRef + +type FieldRefInputType = Model extends never ? never : FieldRef + + +export const ModelName = { + Todo: 'Todo' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + +export interface TypeMapCb extends runtime.Types.Utils.Fn<{extArgs: runtime.Types.Extensions.InternalArgs }, runtime.Types.Utils.Record> { + returns: TypeMap +} + +export type TypeMap = { + globalOmitOptions: { + omit: GlobalOmitOptions + } + meta: { + modelProps: "todo" + txIsolationLevel: TransactionIsolationLevel + } + model: { + Todo: { + payload: Prisma.$TodoPayload + fields: Prisma.TodoFieldRefs + operations: { + findUnique: { + args: Prisma.TodoFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.TodoFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.TodoFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.TodoFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.TodoFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.TodoCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.TodoCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.TodoCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.TodoDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.TodoUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.TodoDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.TodoUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.TodoUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.TodoUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.TodoAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.TodoGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.TodoCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + } +} & { + other: { + payload: any + operations: { + $executeRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + } + } +} + +/** + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const TodoScalarFieldEnum = { + id: 'id', + title: 'title', + complete: 'complete', + createdAt: 'createdAt' +} as const + +export type TodoScalarFieldEnum = (typeof TodoScalarFieldEnum)[keyof typeof TodoScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + + +/** + * Field references + */ + + +/** + * Reference to a field of type 'String' + */ +export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> + + + +/** + * Reference to a field of type 'String[]' + */ +export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> + + + +/** + * Reference to a field of type 'Boolean' + */ +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + +/** + * Reference to a field of type 'DateTime' + */ +export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> + + + +/** + * Reference to a field of type 'DateTime[]' + */ +export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'> + + + +/** + * Reference to a field of type 'Int' + */ +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + +/** + * Reference to a field of type 'Int[]' + */ +export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + + +/** + * Batch Payload for updateMany & deleteMany & createMany + */ +export type BatchPayload = { + count: number +} + + +export type Datasource = { + url?: string +} +export type Datasources = { + db?: Datasource +} + +export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs> +export type DefaultPrismaClient = PrismaClient +export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' +export interface PrismaClientOptions { + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasourceUrl?: string + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + /** + * @example + * ``` + * // Shorthand for `emit: 'stdout'` + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events only + * log: [ + * { emit: 'event', level: 'query' }, + * { emit: 'event', level: 'info' }, + * { emit: 'event', level: 'warn' } + * { emit: 'event', level: 'error' } + * ] + * + * / Emit as events and log to stdout + * og: [ + * { 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?: (LogLevel | LogDefinition)[] + /** + * The default values for transactionOptions + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: { + maxWait?: number + timeout?: number + isolationLevel?: TransactionIsolationLevel + } + /** + * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale` + */ + adapter?: runtime.SqlDriverAdapterFactory | null + /** + * Global configuration for omitting model fields by default. + * + * @example + * ``` + * const prisma = new PrismaClient({ + * omit: { + * user: { + * password: true + * } + * } + * }) + * ``` + */ + omit?: GlobalOmitConfig +} +export type GlobalOmitConfig = { + todo?: Prisma.TodoOmit +} + +/* Types for Logging */ +export type LogLevel = 'info' | 'query' | 'warn' | 'error' +export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' +} + +export type CheckIsLogLevel = T extends LogLevel ? T : never; + +export type GetLogType = CheckIsLogLevel< + T extends LogDefinition ? T['level'] : T +>; + +export type GetEvents = T extends Array + ? 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' + | 'findUniqueOrThrow' + | 'findMany' + | 'findFirst' + | 'findFirstOrThrow' + | 'create' + | 'createMany' + | 'createManyAndReturn' + | 'update' + | 'updateMany' + | 'updateManyAndReturn' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + | 'groupBy' + +/** + * `PrismaClient` proxy available in interactive transactions. + */ +export type TransactionClient = Omit + diff --git a/orm/react-router-7/app/generated/prisma/internal/prismaNamespaceBrowser.ts b/orm/react-router-7/app/generated/prisma/internal/prismaNamespaceBrowser.ts new file mode 100644 index 000000000000..d5ef4b85a445 --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -0,0 +1,94 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/index-browser" + +export type * from '../models' +export type * from './prismaNamespace' + +export const Decimal = runtime.Decimal + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +export const ModelName = { + Todo: 'Todo' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + +/* + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const TodoScalarFieldEnum = { + id: 'id', + title: 'title', + complete: 'complete', + createdAt: 'createdAt' +} as const + +export type TodoScalarFieldEnum = (typeof TodoScalarFieldEnum)[keyof typeof TodoScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + diff --git a/orm/react-router-7/app/generated/prisma/models.ts b/orm/react-router-7/app/generated/prisma/models.ts new file mode 100644 index 000000000000..f7805ac5ab3e --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/models.ts @@ -0,0 +1,11 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This is a barrel export file for all models and their related types. + * + * 🟢 You can import this file directly. + */ +export type * from './models/Todo' +export type * from './commonInputTypes' \ No newline at end of file diff --git a/orm/react-router-7/app/generated/prisma/models/Todo.ts b/orm/react-router-7/app/generated/prisma/models/Todo.ts new file mode 100644 index 000000000000..29067640072b --- /dev/null +++ b/orm/react-router-7/app/generated/prisma/models/Todo.ts @@ -0,0 +1,1127 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `Todo` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model Todo + * + */ +export type TodoModel = runtime.Types.Result.DefaultSelection + +export type AggregateTodo = { + _count: TodoCountAggregateOutputType | null + _min: TodoMinAggregateOutputType | null + _max: TodoMaxAggregateOutputType | null +} + +export type TodoMinAggregateOutputType = { + id: string | null + title: string | null + complete: boolean | null + createdAt: Date | null +} + +export type TodoMaxAggregateOutputType = { + id: string | null + title: string | null + complete: boolean | null + createdAt: Date | null +} + +export type TodoCountAggregateOutputType = { + id: number + title: number + complete: number + createdAt: number + _all: number +} + + +export type TodoMinAggregateInputType = { + id?: true + title?: true + complete?: true + createdAt?: true +} + +export type TodoMaxAggregateInputType = { + id?: true + title?: true + complete?: true + createdAt?: true +} + +export type TodoCountAggregateInputType = { + id?: true + title?: true + complete?: true + createdAt?: true + _all?: true +} + +export type TodoAggregateArgs = { + /** + * Filter which Todo to aggregate. + */ + where?: Prisma.TodoWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Todos to fetch. + */ + orderBy?: Prisma.TodoOrderByWithRelationInput | Prisma.TodoOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.TodoWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Todos 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` Todos. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Todos + **/ + _count?: true | TodoCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: TodoMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: TodoMaxAggregateInputType +} + +export type GetTodoAggregateType = { + [P in keyof T & keyof AggregateTodo]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type TodoGroupByArgs = { + where?: Prisma.TodoWhereInput + orderBy?: Prisma.TodoOrderByWithAggregationInput | Prisma.TodoOrderByWithAggregationInput[] + by: Prisma.TodoScalarFieldEnum[] | Prisma.TodoScalarFieldEnum + having?: Prisma.TodoScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: TodoCountAggregateInputType | true + _min?: TodoMinAggregateInputType + _max?: TodoMaxAggregateInputType +} + +export type TodoGroupByOutputType = { + id: string + title: string + complete: boolean + createdAt: Date + _count: TodoCountAggregateOutputType | null + _min: TodoMinAggregateOutputType | null + _max: TodoMaxAggregateOutputType | null +} + +type GetTodoGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof TodoGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type TodoWhereInput = { + AND?: Prisma.TodoWhereInput | Prisma.TodoWhereInput[] + OR?: Prisma.TodoWhereInput[] + NOT?: Prisma.TodoWhereInput | Prisma.TodoWhereInput[] + id?: Prisma.StringFilter<"Todo"> | string + title?: Prisma.StringFilter<"Todo"> | string + complete?: Prisma.BoolFilter<"Todo"> | boolean + createdAt?: Prisma.DateTimeFilter<"Todo"> | Date | string +} + +export type TodoOrderByWithRelationInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + complete?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type TodoWhereUniqueInput = Prisma.AtLeast<{ + id?: string + AND?: Prisma.TodoWhereInput | Prisma.TodoWhereInput[] + OR?: Prisma.TodoWhereInput[] + NOT?: Prisma.TodoWhereInput | Prisma.TodoWhereInput[] + title?: Prisma.StringFilter<"Todo"> | string + complete?: Prisma.BoolFilter<"Todo"> | boolean + createdAt?: Prisma.DateTimeFilter<"Todo"> | Date | string +}, "id"> + +export type TodoOrderByWithAggregationInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + complete?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + _count?: Prisma.TodoCountOrderByAggregateInput + _max?: Prisma.TodoMaxOrderByAggregateInput + _min?: Prisma.TodoMinOrderByAggregateInput +} + +export type TodoScalarWhereWithAggregatesInput = { + AND?: Prisma.TodoScalarWhereWithAggregatesInput | Prisma.TodoScalarWhereWithAggregatesInput[] + OR?: Prisma.TodoScalarWhereWithAggregatesInput[] + NOT?: Prisma.TodoScalarWhereWithAggregatesInput | Prisma.TodoScalarWhereWithAggregatesInput[] + id?: Prisma.StringWithAggregatesFilter<"Todo"> | string + title?: Prisma.StringWithAggregatesFilter<"Todo"> | string + complete?: Prisma.BoolWithAggregatesFilter<"Todo"> | boolean + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Todo"> | Date | string +} + +export type TodoCreateInput = { + id?: string + title: string + complete?: boolean + createdAt?: Date | string +} + +export type TodoUncheckedCreateInput = { + id?: string + title: string + complete?: boolean + createdAt?: Date | string +} + +export type TodoUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + title?: Prisma.StringFieldUpdateOperationsInput | string + complete?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type TodoUncheckedUpdateInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + title?: Prisma.StringFieldUpdateOperationsInput | string + complete?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type TodoCreateManyInput = { + id?: string + title: string + complete?: boolean + createdAt?: Date | string +} + +export type TodoUpdateManyMutationInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + title?: Prisma.StringFieldUpdateOperationsInput | string + complete?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type TodoUncheckedUpdateManyInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + title?: Prisma.StringFieldUpdateOperationsInput | string + complete?: Prisma.BoolFieldUpdateOperationsInput | boolean + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string +} + +export type TodoCountOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + complete?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type TodoMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + complete?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type TodoMinOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + complete?: Prisma.SortOrder + createdAt?: Prisma.SortOrder +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type BoolFieldUpdateOperationsInput = { + set?: boolean +} + +export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string +} + + + +export type TodoSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + complete?: boolean + createdAt?: boolean +}, ExtArgs["result"]["todo"]> + +export type TodoSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + complete?: boolean + createdAt?: boolean +}, ExtArgs["result"]["todo"]> + +export type TodoSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + complete?: boolean + createdAt?: boolean +}, ExtArgs["result"]["todo"]> + +export type TodoSelectScalar = { + id?: boolean + title?: boolean + complete?: boolean + createdAt?: boolean +} + +export type TodoOmit = runtime.Types.Extensions.GetOmit<"id" | "title" | "complete" | "createdAt", ExtArgs["result"]["todo"]> + +export type $TodoPayload = { + name: "Todo" + objects: {} + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: string + title: string + complete: boolean + createdAt: Date + }, ExtArgs["result"]["todo"]> + composites: {} +} + +export type TodoGetPayload = runtime.Types.Result.GetResult + +export type TodoCountArgs = + Omit & { + select?: TodoCountAggregateInputType | true + } + +export interface TodoDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Todo'], meta: { name: 'Todo' } } + /** + * Find zero or one Todo that matches the filter. + * @param {TodoFindUniqueArgs} args - Arguments to find a Todo + * @example + * // Get one Todo + * const todo = await prisma.todo.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__TodoClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Todo that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {TodoFindUniqueOrThrowArgs} args - Arguments to find a Todo + * @example + * // Get one Todo + * const todo = await prisma.todo.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__TodoClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Todo 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 {TodoFindFirstArgs} args - Arguments to find a Todo + * @example + * // Get one Todo + * const todo = await prisma.todo.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__TodoClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Todo that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {TodoFindFirstOrThrowArgs} args - Arguments to find a Todo + * @example + * // Get one Todo + * const todo = await prisma.todo.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__TodoClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Todos 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 {TodoFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Todos + * const todos = await prisma.todo.findMany() + * + * // Get first 10 Todos + * const todos = await prisma.todo.findMany({ take: 10 }) + * + * // Only select the `id` + * const todoWithIdOnly = await prisma.todo.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Todo. + * @param {TodoCreateArgs} args - Arguments to create a Todo. + * @example + * // Create one Todo + * const Todo = await prisma.todo.create({ + * data: { + * // ... data to create a Todo + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__TodoClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Todos. + * @param {TodoCreateManyArgs} args - Arguments to create many Todos. + * @example + * // Create many Todos + * const todo = await prisma.todo.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Todos and returns the data saved in the database. + * @param {TodoCreateManyAndReturnArgs} args - Arguments to create many Todos. + * @example + * // Create many Todos + * const todo = await prisma.todo.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Todos and only return the `id` + * const todoWithIdOnly = await prisma.todo.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Todo. + * @param {TodoDeleteArgs} args - Arguments to delete one Todo. + * @example + * // Delete one Todo + * const Todo = await prisma.todo.delete({ + * where: { + * // ... filter to delete one Todo + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__TodoClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Todo. + * @param {TodoUpdateArgs} args - Arguments to update one Todo. + * @example + * // Update one Todo + * const todo = await prisma.todo.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__TodoClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Todos. + * @param {TodoDeleteManyArgs} args - Arguments to filter Todos to delete. + * @example + * // Delete a few Todos + * const { count } = await prisma.todo.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Todos. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Todos + * const todo = await prisma.todo.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Todos and returns the data updated in the database. + * @param {TodoUpdateManyAndReturnArgs} args - Arguments to update many Todos. + * @example + * // Update many Todos + * const todo = await prisma.todo.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Todos and only return the `id` + * const todoWithIdOnly = await prisma.todo.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Todo. + * @param {TodoUpsertArgs} args - Arguments to update or create a Todo. + * @example + * // Update or create a Todo + * const todo = await prisma.todo.upsert({ + * create: { + * // ... data to create a Todo + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Todo we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__TodoClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Todos. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoCountArgs} args - Arguments to filter Todos to count. + * @example + * // Count the number of Todos + * const count = await prisma.todo.count({ + * where: { + * // ... the filter for the Todos we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Todo. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Todo. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {TodoGroupByArgs} 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 TodoGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: TodoGroupByArgs['orderBy'] } + : { orderBy?: TodoGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetTodoGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Todo model + */ +readonly fields: TodoFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Todo. + * 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 interface Prisma__TodoClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Todo model + */ +export interface TodoFieldRefs { + readonly id: Prisma.FieldRef<"Todo", 'String'> + readonly title: Prisma.FieldRef<"Todo", 'String'> + readonly complete: Prisma.FieldRef<"Todo", 'Boolean'> + readonly createdAt: Prisma.FieldRef<"Todo", 'DateTime'> +} + + +// Custom InputTypes +/** + * Todo findUnique + */ +export type TodoFindUniqueArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * Filter, which Todo to fetch. + */ + where: Prisma.TodoWhereUniqueInput +} + +/** + * Todo findUniqueOrThrow + */ +export type TodoFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * Filter, which Todo to fetch. + */ + where: Prisma.TodoWhereUniqueInput +} + +/** + * Todo findFirst + */ +export type TodoFindFirstArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * Filter, which Todo to fetch. + */ + where?: Prisma.TodoWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Todos to fetch. + */ + orderBy?: Prisma.TodoOrderByWithRelationInput | Prisma.TodoOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Todos. + */ + cursor?: Prisma.TodoWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Todos 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` Todos. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Todos. + */ + distinct?: Prisma.TodoScalarFieldEnum | Prisma.TodoScalarFieldEnum[] +} + +/** + * Todo findFirstOrThrow + */ +export type TodoFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * Filter, which Todo to fetch. + */ + where?: Prisma.TodoWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Todos to fetch. + */ + orderBy?: Prisma.TodoOrderByWithRelationInput | Prisma.TodoOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Todos. + */ + cursor?: Prisma.TodoWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Todos 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` Todos. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Todos. + */ + distinct?: Prisma.TodoScalarFieldEnum | Prisma.TodoScalarFieldEnum[] +} + +/** + * Todo findMany + */ +export type TodoFindManyArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * Filter, which Todos to fetch. + */ + where?: Prisma.TodoWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Todos to fetch. + */ + orderBy?: Prisma.TodoOrderByWithRelationInput | Prisma.TodoOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Todos. + */ + cursor?: Prisma.TodoWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Todos 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` Todos. + */ + skip?: number + distinct?: Prisma.TodoScalarFieldEnum | Prisma.TodoScalarFieldEnum[] +} + +/** + * Todo create + */ +export type TodoCreateArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * The data needed to create a Todo. + */ + data: Prisma.XOR +} + +/** + * Todo createMany + */ +export type TodoCreateManyArgs = { + /** + * The data used to create many Todos. + */ + data: Prisma.TodoCreateManyInput | Prisma.TodoCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Todo createManyAndReturn + */ +export type TodoCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * The data used to create many Todos. + */ + data: Prisma.TodoCreateManyInput | Prisma.TodoCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Todo update + */ +export type TodoUpdateArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * The data needed to update a Todo. + */ + data: Prisma.XOR + /** + * Choose, which Todo to update. + */ + where: Prisma.TodoWhereUniqueInput +} + +/** + * Todo updateMany + */ +export type TodoUpdateManyArgs = { + /** + * The data used to update Todos. + */ + data: Prisma.XOR + /** + * Filter which Todos to update + */ + where?: Prisma.TodoWhereInput + /** + * Limit how many Todos to update. + */ + limit?: number +} + +/** + * Todo updateManyAndReturn + */ +export type TodoUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * The data used to update Todos. + */ + data: Prisma.XOR + /** + * Filter which Todos to update + */ + where?: Prisma.TodoWhereInput + /** + * Limit how many Todos to update. + */ + limit?: number +} + +/** + * Todo upsert + */ +export type TodoUpsertArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * The filter to search for the Todo to update in case it exists. + */ + where: Prisma.TodoWhereUniqueInput + /** + * In case the Todo found by the `where` argument doesn't exist, create a new Todo with this data. + */ + create: Prisma.XOR + /** + * In case the Todo was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Todo delete + */ +export type TodoDeleteArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null + /** + * Filter which Todo to delete. + */ + where: Prisma.TodoWhereUniqueInput +} + +/** + * Todo deleteMany + */ +export type TodoDeleteManyArgs = { + /** + * Filter which Todos to delete + */ + where?: Prisma.TodoWhereInput + /** + * Limit how many Todos to delete. + */ + limit?: number +} + +/** + * Todo without action + */ +export type TodoDefaultArgs = { + /** + * Select specific fields to fetch from the Todo + */ + select?: Prisma.TodoSelect | null + /** + * Omit specific fields from the Todo + */ + omit?: Prisma.TodoOmit | null +} diff --git a/orm/react-router-7/app/lib/prisma.ts b/orm/react-router-7/app/lib/prisma.ts index e0de2fccc8b2..b2a680e14990 100644 --- a/orm/react-router-7/app/lib/prisma.ts +++ b/orm/react-router-7/app/lib/prisma.ts @@ -1,4 +1,4 @@ -import { PrismaClient } from '@prisma/client' +import { PrismaClient } from '../generated/prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' const prisma = new PrismaClient().$extends(withAccelerate()) diff --git a/orm/react-router-7/package.json b/orm/react-router-7/package.json index c479dc31fc13..ea6ddc7e4d09 100644 --- a/orm/react-router-7/package.json +++ b/orm/react-router-7/package.json @@ -9,17 +9,17 @@ "typecheck": "react-router typegen && tsc" }, "dependencies": { - "@prisma/client": "6.9.0", + "@prisma/client": "6.16.3", "@prisma/extension-accelerate": "2.0.2", "@react-router/node": "7.6.3", "@react-router/serve": "7.6.3", "isbot": "5.1.28", - "prisma": "6.9.0", "react": "19.1.0", "react-dom": "19.1.0", "react-router": "7.6.3" }, "devDependencies": { + "prisma": "6.16.3", "@react-router/dev": "7.6.3", "@tailwindcss/vite": "4.1.11", "@types/node": "22.15.32", diff --git a/orm/react-router-7/prisma/schema.prisma b/orm/react-router-7/prisma/schema.prisma index aeb394a4660f..c5f323e41844 100644 --- a/orm/react-router-7/prisma/schema.prisma +++ b/orm/react-router-7/prisma/schema.prisma @@ -5,7 +5,9 @@ // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init generator client { - provider = "prisma-client-js" + provider = "prisma-client" + engineType = "client" + output = "../app/generated/prisma" } datasource db { From ce4d6f6002501e8ff849b6b72d86589212fb195d Mon Sep 17 00:00:00 2001 From: Nikolas Burk Date: Wed, 1 Oct 2025 14:04:22 +0200 Subject: [PATCH 02/13] update solid-start example --- orm/solid-start/lib/prisma.ts | 2 +- orm/solid-start/package.json | 4 +- orm/solid-start/prisma/schema.prisma | 4 +- orm/solid-start/prisma/seed.ts | 2 +- .../src/generated/prisma/browser.ts | 28 + .../src/generated/prisma/client.ts | 52 + .../src/generated/prisma/commonInputTypes.ts | 251 +++ orm/solid-start/src/generated/prisma/enums.ts | 14 + .../src/generated/prisma/internal/class.ts | 241 +++ .../prisma/internal/prismaNamespace.ts | 848 ++++++++++ .../prisma/internal/prismaNamespaceBrowser.ts | 113 ++ .../src/generated/prisma/models.ts | 12 + .../src/generated/prisma/models/Post.ts | 1388 +++++++++++++++++ .../src/generated/prisma/models/User.ts | 1312 ++++++++++++++++ 14 files changed, 4266 insertions(+), 5 deletions(-) create mode 100644 orm/solid-start/src/generated/prisma/browser.ts create mode 100644 orm/solid-start/src/generated/prisma/client.ts create mode 100644 orm/solid-start/src/generated/prisma/commonInputTypes.ts create mode 100644 orm/solid-start/src/generated/prisma/enums.ts create mode 100644 orm/solid-start/src/generated/prisma/internal/class.ts create mode 100644 orm/solid-start/src/generated/prisma/internal/prismaNamespace.ts create mode 100644 orm/solid-start/src/generated/prisma/internal/prismaNamespaceBrowser.ts create mode 100644 orm/solid-start/src/generated/prisma/models.ts create mode 100644 orm/solid-start/src/generated/prisma/models/Post.ts create mode 100644 orm/solid-start/src/generated/prisma/models/User.ts diff --git a/orm/solid-start/lib/prisma.ts b/orm/solid-start/lib/prisma.ts index 46f6f1810a01..9583863c6224 100644 --- a/orm/solid-start/lib/prisma.ts +++ b/orm/solid-start/lib/prisma.ts @@ -1,4 +1,4 @@ -import { PrismaClient } from '@prisma/client' +import { PrismaClient } from '../src/generated/prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' const prisma = new PrismaClient().$extends(withAccelerate()) diff --git a/orm/solid-start/package.json b/orm/solid-start/package.json index fbf875d8cff0..9ba1cc7bf4d9 100644 --- a/orm/solid-start/package.json +++ b/orm/solid-start/package.json @@ -10,7 +10,7 @@ "seed": "tsx prisma/seed.ts" }, "dependencies": { - "@prisma/client": "6.9.0", + "@prisma/client": "6.16.3", "@prisma/extension-accelerate": "2.0.2", "@solidjs/start": "1.1.7", "solid-js": "1.9.7", @@ -22,7 +22,7 @@ "devDependencies": { "@tailwindcss/postcss": "4.1.11", "postcss": "8.5.6", - "prisma": "6.9.0", + "prisma": "6.16.3", "tailwindcss": "4.1.11", "tsx": "4.20.3" } diff --git a/orm/solid-start/prisma/schema.prisma b/orm/solid-start/prisma/schema.prisma index bf4fc46a5f07..76cd9741d84b 100644 --- a/orm/solid-start/prisma/schema.prisma +++ b/orm/solid-start/prisma/schema.prisma @@ -5,7 +5,9 @@ // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init generator client { - provider = "prisma-client-js" + provider = "prisma-client" + engineType = "client" + output = "../src/generated/prisma" } datasource db { diff --git a/orm/solid-start/prisma/seed.ts b/orm/solid-start/prisma/seed.ts index 25d97f708103..cadf81e70376 100644 --- a/orm/solid-start/prisma/seed.ts +++ b/orm/solid-start/prisma/seed.ts @@ -1,4 +1,4 @@ -import { PrismaClient, Prisma } from '@prisma/client' +import { PrismaClient, Prisma } from '../src/generated/prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' const prisma = new PrismaClient().$extends(withAccelerate()) diff --git a/orm/solid-start/src/generated/prisma/browser.ts b/orm/solid-start/src/generated/prisma/browser.ts new file mode 100644 index 000000000000..e8ef4c6baf02 --- /dev/null +++ b/orm/solid-start/src/generated/prisma/browser.ts @@ -0,0 +1,28 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma-related types and utilities in a browser. + * Use it to get access to models, enums, and input types. + * + * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only. + * See `client.ts` for the standard, server-side entry point. + * + * 🟢 You can import this file directly. + */ + +import * as Prisma from './internal/prismaNamespaceBrowser' +export { Prisma } +export * as $Enums from './enums' +export * from './enums'; +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Post + * + */ +export type Post = Prisma.PostModel diff --git a/orm/solid-start/src/generated/prisma/client.ts b/orm/solid-start/src/generated/prisma/client.ts new file mode 100644 index 000000000000..7b9669007702 --- /dev/null +++ b/orm/solid-start/src/generated/prisma/client.ts @@ -0,0 +1,52 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types. + * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead. + * + * 🟢 You can import this file directly. + */ + +import * as process from 'node:process' +import * as path from 'node:path' +import { fileURLToPath } from 'node:url' +globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url)) + +import * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums" +import * as $Class from "./internal/class" +import * as Prisma from "./internal/prismaNamespace" + +export * as $Enums from './enums' +export * from "./enums" +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export const PrismaClient = $Class.getPrismaClientClass(__dirname) +export type PrismaClient = $Class.PrismaClient +export { Prisma } + + + +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Post + * + */ +export type Post = Prisma.PostModel diff --git a/orm/solid-start/src/generated/prisma/commonInputTypes.ts b/orm/solid-start/src/generated/prisma/commonInputTypes.ts new file mode 100644 index 000000000000..e3fd127933bb --- /dev/null +++ b/orm/solid-start/src/generated/prisma/commonInputTypes.ts @@ -0,0 +1,251 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports various common sort, input & filter types that are not directly linked to a particular model. + * + * 🟢 You can import this file directly. + */ + +import type * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums" +import type * as Prisma from "./internal/prismaNamespace" + + +export type IntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type StringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type StringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + +export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type NestedIntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type NestedStringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatFilter<$PrismaModel> | number +} + +export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + + diff --git a/orm/solid-start/src/generated/prisma/enums.ts b/orm/solid-start/src/generated/prisma/enums.ts new file mode 100644 index 000000000000..0189a3446d4f --- /dev/null +++ b/orm/solid-start/src/generated/prisma/enums.ts @@ -0,0 +1,14 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* +* This file exports all enum related types from the schema. +* +* 🟢 You can import this file directly. +*/ + + + +// This file is empty because there are no enums in the schema. +export {} diff --git a/orm/solid-start/src/generated/prisma/internal/class.ts b/orm/solid-start/src/generated/prisma/internal/class.ts new file mode 100644 index 000000000000..1a096dec404f --- /dev/null +++ b/orm/solid-start/src/generated/prisma/internal/class.ts @@ -0,0 +1,241 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * Please import the `PrismaClient` class from the `client.ts` file instead. + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "./prismaNamespace" + + +const config: runtime.GetPrismaClientConfig = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client" + }, + "output": { + "value": "/Users/nikolasburk/Desktop/examples-v7/orm/solid-start/src/generated/prisma", + "fromEnvVar": null + }, + "config": { + "engineType": "client" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "darwin", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "/Users/nikolasburk/Desktop/examples-v7/orm/solid-start/prisma/schema.prisma", + "isCustomOutput": true + }, + "relativePath": "../../../prisma", + "clientVersion": "6.16.3", + "engineVersion": "bb420e667c1820a8c05a38023385f6cc7ef8e83a", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client\"\n engineType = \"client\"\n output = \"../src/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n posts Post[]\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n published Boolean @default(false)\n authorId Int\n author User @relation(fields: [authorId], references: [id])\n}\n", + "inlineSchemaHash": "1a26515a2addd71c919ccd9ddfb45cc055f90e607de0254743764a2f7e065fd5", + "copyEngine": false, + "runtimeDataModel": { + "models": {}, + "enums": {}, + "types": {} + }, + "dirname": "" +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"posts\",\"kind\":\"object\",\"type\":\"Post\",\"relationName\":\"PostToUser\"}],\"dbName\":null},\"Post\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"content\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"published\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"authorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"author\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"PostToUser\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.engineWasm = undefined + +async function decodeBase64AsWasm(wasmBase64: string): Promise { + const { Buffer } = await import('node:buffer') + const wasmArray = Buffer.from(wasmBase64, 'base64') + return new WebAssembly.Module(wasmArray) +} + +config.compilerWasm = { + getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"), + + getQueryCompilerWasmModule: async () => { + const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.postgresql.wasm-base64.mjs") + return await decodeBase64AsWasm(wasm) + } +} + + + + +export type LogOptions = + 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never + +export interface PrismaClientConstructor { + /** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + + new < + Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + LogOpts extends LogOptions = LogOptions, + OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'], + ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs + >(options?: Prisma.Subset ): PrismaClient +} + +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + +export interface PrismaClient< + in LogOpts extends Prisma.LogLevel = never, + in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'], + in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs +> { + [K: symbol]: { types: Prisma.TypeMap['other'] } + + $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient; + + /** + * Connect with the database + */ + $connect(): runtime.Types.Utils.JsPromise; + + /** + * Disconnect from the database + */ + $disconnect(): runtime.Types.Utils.JsPromise; + +/** + * 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 }): runtime.Types.Utils.JsPromise> + + $transaction(fn: (prisma: Omit) => runtime.Types.Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise + + + $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs, runtime.Types.Utils.Call, { + extArgs: ExtArgs + }>> + + /** + * `prisma.user`: Exposes CRUD operations for the **User** model. + * Example usage: + * ```ts + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + */ + get user(): Prisma.UserDelegate; + + /** + * `prisma.post`: Exposes CRUD operations for the **Post** model. + * Example usage: + * ```ts + * // Fetch zero or more Posts + * const posts = await prisma.post.findMany() + * ``` + */ + get post(): Prisma.PostDelegate; +} + +export function getPrismaClientClass(dirname: string): PrismaClientConstructor { + config.dirname = dirname + return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor +} diff --git a/orm/solid-start/src/generated/prisma/internal/prismaNamespace.ts b/orm/solid-start/src/generated/prisma/internal/prismaNamespace.ts new file mode 100644 index 000000000000..feac437c628d --- /dev/null +++ b/orm/solid-start/src/generated/prisma/internal/prismaNamespace.ts @@ -0,0 +1,848 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the client.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "../models" +import { type PrismaClient } from "./class" + +export type * from '../models' + +export type DMMF = typeof runtime.DMMF + +export type PrismaPromise = runtime.Types.Public.PrismaPromise + +/** + * Prisma Errors + */ + +export const PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError +export type PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + +export const PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError +export type PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + +export const PrismaClientRustPanicError = runtime.PrismaClientRustPanicError +export type PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + +export const PrismaClientInitializationError = runtime.PrismaClientInitializationError +export type PrismaClientInitializationError = runtime.PrismaClientInitializationError + +export const PrismaClientValidationError = runtime.PrismaClientValidationError +export type PrismaClientValidationError = runtime.PrismaClientValidationError + +/** + * Re-export of sql-template-tag + */ +export const sql = runtime.sqltag +export const empty = runtime.empty +export const join = runtime.join +export const raw = runtime.raw +export const Sql = runtime.Sql +export type Sql = runtime.Sql + + + +/** + * Decimal.js + */ +export const Decimal = runtime.Decimal +export type 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 + +/** +* Extensions +*/ +export type Extension = runtime.Types.Extensions.UserArgs +export const getExtensionContext = runtime.Extensions.getExtensionContext +export type Args = runtime.Types.Public.Args +export type Payload = runtime.Types.Public.Payload +export type Result = runtime.Types.Public.Result +export type Exact = runtime.Types.Public.Exact + +export type PrismaVersion = { + client: string + engine: string +} + +/** + * Prisma Client JS version: 6.16.3 + * Query Engine version: bb420e667c1820a8c05a38023385f6cc7ef8e83a + */ +export const prismaVersion: PrismaVersion = { + client: "6.16.3", + engine: "bb420e667c1820a8c05a38023385f6cc7ef8e83a" +} + +/** + * Utility Types + */ + +export type JsonObject = runtime.JsonObject +export type JsonArray = runtime.JsonArray +export type JsonValue = runtime.JsonValue +export type InputJsonObject = runtime.InputJsonObject +export type InputJsonArray = runtime.InputJsonArray +export type InputJsonValue = runtime.InputJsonValue + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +type SelectAndInclude = { + select: any + include: any +} + +type SelectAndOmit = { + select: any + omit: any +} + +/** + * 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; + +/** + * 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`.' + : T extends SelectAndOmit + ? 'Please either choose `select` or `omit`.' + : {}) + +/** + * 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 + */ +export 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] + +export type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 +> = O extends unknown ? _Either : never + +export type Union = any + +export 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 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 +export 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 ? P : 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>>; + +export type Boolean = True | False + +export type True = 1 + +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 + +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 + +export 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 +export type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + +/** + * Like `Pick`, but additionally can also accept an array of keys + */ +export type PickEnumerable | keyof T> = Prisma__Pick> + +/** + * Exclude all keys with underscores + */ +export type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + +export type FieldRef = runtime.FieldRef + +type FieldRefInputType = Model extends never ? never : FieldRef + + +export const ModelName = { + User: 'User', + Post: 'Post' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + +export interface TypeMapCb extends runtime.Types.Utils.Fn<{extArgs: runtime.Types.Extensions.InternalArgs }, runtime.Types.Utils.Record> { + returns: TypeMap +} + +export type TypeMap = { + globalOmitOptions: { + omit: GlobalOmitOptions + } + meta: { + modelProps: "user" | "post" + txIsolationLevel: TransactionIsolationLevel + } + model: { + User: { + payload: Prisma.$UserPayload + fields: Prisma.UserFieldRefs + operations: { + findUnique: { + args: Prisma.UserFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.UserFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.UserCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.UserCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UserCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.UserDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.UserUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.UserUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.UserUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.UserGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.UserCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Post: { + payload: Prisma.$PostPayload + fields: Prisma.PostFieldRefs + operations: { + findUnique: { + args: Prisma.PostFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PostFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PostFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PostFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PostFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PostCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PostCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PostCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.PostDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PostUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PostDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PostUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.PostUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.PostUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PostAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PostGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PostCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + } +} & { + other: { + payload: any + operations: { + $executeRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + } + } +} + +/** + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + email: 'email', + name: 'name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const PostScalarFieldEnum = { + id: 'id', + title: 'title', + content: 'content', + published: 'published', + authorId: 'authorId' +} as const + +export type PostScalarFieldEnum = (typeof PostScalarFieldEnum)[keyof typeof PostScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + + +/** + * Field references + */ + + +/** + * Reference to a field of type 'Int' + */ +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + +/** + * Reference to a field of type 'Int[]' + */ +export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + + + +/** + * Reference to a field of type 'String' + */ +export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> + + + +/** + * Reference to a field of type 'String[]' + */ +export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> + + + +/** + * Reference to a field of type 'Boolean' + */ +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + +/** + * Reference to a field of type 'Float' + */ +export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> + + + +/** + * Reference to a field of type 'Float[]' + */ +export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> + + +/** + * Batch Payload for updateMany & deleteMany & createMany + */ +export type BatchPayload = { + count: number +} + + +export type Datasource = { + url?: string +} +export type Datasources = { + db?: Datasource +} + +export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs> +export type DefaultPrismaClient = PrismaClient +export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' +export interface PrismaClientOptions { + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasourceUrl?: string + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + /** + * @example + * ``` + * // Shorthand for `emit: 'stdout'` + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events only + * log: [ + * { emit: 'event', level: 'query' }, + * { emit: 'event', level: 'info' }, + * { emit: 'event', level: 'warn' } + * { emit: 'event', level: 'error' } + * ] + * + * / Emit as events and log to stdout + * og: [ + * { 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?: (LogLevel | LogDefinition)[] + /** + * The default values for transactionOptions + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: { + maxWait?: number + timeout?: number + isolationLevel?: TransactionIsolationLevel + } + /** + * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale` + */ + adapter?: runtime.SqlDriverAdapterFactory | null + /** + * Global configuration for omitting model fields by default. + * + * @example + * ``` + * const prisma = new PrismaClient({ + * omit: { + * user: { + * password: true + * } + * } + * }) + * ``` + */ + omit?: GlobalOmitConfig +} +export type GlobalOmitConfig = { + user?: Prisma.UserOmit + post?: Prisma.PostOmit +} + +/* Types for Logging */ +export type LogLevel = 'info' | 'query' | 'warn' | 'error' +export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' +} + +export type CheckIsLogLevel = T extends LogLevel ? T : never; + +export type GetLogType = CheckIsLogLevel< + T extends LogDefinition ? T['level'] : T +>; + +export type GetEvents = T extends Array + ? 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' + | 'findUniqueOrThrow' + | 'findMany' + | 'findFirst' + | 'findFirstOrThrow' + | 'create' + | 'createMany' + | 'createManyAndReturn' + | 'update' + | 'updateMany' + | 'updateManyAndReturn' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + | 'groupBy' + +/** + * `PrismaClient` proxy available in interactive transactions. + */ +export type TransactionClient = Omit + diff --git a/orm/solid-start/src/generated/prisma/internal/prismaNamespaceBrowser.ts b/orm/solid-start/src/generated/prisma/internal/prismaNamespaceBrowser.ts new file mode 100644 index 000000000000..a36a7f751844 --- /dev/null +++ b/orm/solid-start/src/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -0,0 +1,113 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/index-browser" + +export type * from '../models' +export type * from './prismaNamespace' + +export const Decimal = runtime.Decimal + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +export const ModelName = { + User: 'User', + Post: 'Post' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + +/* + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + email: 'email', + name: 'name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const PostScalarFieldEnum = { + id: 'id', + title: 'title', + content: 'content', + published: 'published', + authorId: 'authorId' +} as const + +export type PostScalarFieldEnum = (typeof PostScalarFieldEnum)[keyof typeof PostScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + diff --git a/orm/solid-start/src/generated/prisma/models.ts b/orm/solid-start/src/generated/prisma/models.ts new file mode 100644 index 000000000000..c9a79b69577b --- /dev/null +++ b/orm/solid-start/src/generated/prisma/models.ts @@ -0,0 +1,12 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This is a barrel export file for all models and their related types. + * + * 🟢 You can import this file directly. + */ +export type * from './models/User' +export type * from './models/Post' +export type * from './commonInputTypes' \ No newline at end of file diff --git a/orm/solid-start/src/generated/prisma/models/Post.ts b/orm/solid-start/src/generated/prisma/models/Post.ts new file mode 100644 index 000000000000..b9f8c6669e64 --- /dev/null +++ b/orm/solid-start/src/generated/prisma/models/Post.ts @@ -0,0 +1,1388 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `Post` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model Post + * + */ +export type PostModel = runtime.Types.Result.DefaultSelection + +export type AggregatePost = { + _count: PostCountAggregateOutputType | null + _avg: PostAvgAggregateOutputType | null + _sum: PostSumAggregateOutputType | null + _min: PostMinAggregateOutputType | null + _max: PostMaxAggregateOutputType | null +} + +export type PostAvgAggregateOutputType = { + id: number | null + authorId: number | null +} + +export type PostSumAggregateOutputType = { + id: number | null + authorId: number | null +} + +export type PostMinAggregateOutputType = { + id: number | null + title: string | null + content: string | null + published: boolean | null + authorId: number | null +} + +export type PostMaxAggregateOutputType = { + id: number | null + title: string | null + content: string | null + published: boolean | null + authorId: number | null +} + +export type PostCountAggregateOutputType = { + id: number + title: number + content: number + published: number + authorId: number + _all: number +} + + +export type PostAvgAggregateInputType = { + id?: true + authorId?: true +} + +export type PostSumAggregateInputType = { + id?: true + authorId?: true +} + +export type PostMinAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true +} + +export type PostMaxAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true +} + +export type PostCountAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true + _all?: true +} + +export type PostAggregateArgs = { + /** + * Filter which Post to aggregate. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Posts + **/ + _count?: true | PostCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PostAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PostSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PostMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PostMaxAggregateInputType +} + +export type GetPostAggregateType = { + [P in keyof T & keyof AggregatePost]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PostGroupByArgs = { + where?: Prisma.PostWhereInput + orderBy?: Prisma.PostOrderByWithAggregationInput | Prisma.PostOrderByWithAggregationInput[] + by: Prisma.PostScalarFieldEnum[] | Prisma.PostScalarFieldEnum + having?: Prisma.PostScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PostCountAggregateInputType | true + _avg?: PostAvgAggregateInputType + _sum?: PostSumAggregateInputType + _min?: PostMinAggregateInputType + _max?: PostMaxAggregateInputType +} + +export type PostGroupByOutputType = { + id: number + title: string + content: string | null + published: boolean + authorId: number + _count: PostCountAggregateOutputType | null + _avg: PostAvgAggregateOutputType | null + _sum: PostSumAggregateOutputType | null + _min: PostMinAggregateOutputType | null + _max: PostMaxAggregateOutputType | null +} + +type GetPostGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PostGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PostWhereInput = { + AND?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + OR?: Prisma.PostWhereInput[] + NOT?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + id?: Prisma.IntFilter<"Post"> | number + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number + author?: Prisma.XOR +} + +export type PostOrderByWithRelationInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrderInput | Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder + author?: Prisma.UserOrderByWithRelationInput +} + +export type PostWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + OR?: Prisma.PostWhereInput[] + NOT?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number + author?: Prisma.XOR +}, "id"> + +export type PostOrderByWithAggregationInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrderInput | Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder + _count?: Prisma.PostCountOrderByAggregateInput + _avg?: Prisma.PostAvgOrderByAggregateInput + _max?: Prisma.PostMaxOrderByAggregateInput + _min?: Prisma.PostMinOrderByAggregateInput + _sum?: Prisma.PostSumOrderByAggregateInput +} + +export type PostScalarWhereWithAggregatesInput = { + AND?: Prisma.PostScalarWhereWithAggregatesInput | Prisma.PostScalarWhereWithAggregatesInput[] + OR?: Prisma.PostScalarWhereWithAggregatesInput[] + NOT?: Prisma.PostScalarWhereWithAggregatesInput | Prisma.PostScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"Post"> | number + title?: Prisma.StringWithAggregatesFilter<"Post"> | string + content?: Prisma.StringNullableWithAggregatesFilter<"Post"> | string | null + published?: Prisma.BoolWithAggregatesFilter<"Post"> | boolean + authorId?: Prisma.IntWithAggregatesFilter<"Post"> | number +} + +export type PostCreateInput = { + title: string + content?: string | null + published?: boolean + author: Prisma.UserCreateNestedOneWithoutPostsInput +} + +export type PostUncheckedCreateInput = { + id?: number + title: string + content?: string | null + published?: boolean + authorId: number +} + +export type PostUpdateInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + author?: Prisma.UserUpdateOneRequiredWithoutPostsNestedInput +} + +export type PostUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + authorId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostCreateManyInput = { + id?: number + title: string + content?: string | null + published?: boolean + authorId: number +} + +export type PostUpdateManyMutationInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + authorId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostListRelationFilter = { + every?: Prisma.PostWhereInput + some?: Prisma.PostWhereInput + none?: Prisma.PostWhereInput +} + +export type PostOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type PostCountOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostMinOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostSumOrderByAggregateInput = { + id?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostCreateNestedManyWithoutAuthorInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] +} + +export type PostUncheckedCreateNestedManyWithoutAuthorInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] +} + +export type PostUpdateManyWithoutAuthorNestedInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + upsert?: Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput | Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + set?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + disconnect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + delete?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + update?: Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput | Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput[] + updateMany?: Prisma.PostUpdateManyWithWhereWithoutAuthorInput | Prisma.PostUpdateManyWithWhereWithoutAuthorInput[] + deleteMany?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] +} + +export type PostUncheckedUpdateManyWithoutAuthorNestedInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + upsert?: Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput | Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + set?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + disconnect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + delete?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + update?: Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput | Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput[] + updateMany?: Prisma.PostUpdateManyWithWhereWithoutAuthorInput | Prisma.PostUpdateManyWithWhereWithoutAuthorInput[] + deleteMany?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] +} + +export type BoolFieldUpdateOperationsInput = { + set?: boolean +} + +export type PostCreateWithoutAuthorInput = { + title: string + content?: string | null + published?: boolean +} + +export type PostUncheckedCreateWithoutAuthorInput = { + id?: number + title: string + content?: string | null + published?: boolean +} + +export type PostCreateOrConnectWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + create: Prisma.XOR +} + +export type PostCreateManyAuthorInputEnvelope = { + data: Prisma.PostCreateManyAuthorInput | Prisma.PostCreateManyAuthorInput[] + skipDuplicates?: boolean +} + +export type PostUpsertWithWhereUniqueWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PostUpdateWithWhereUniqueWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + data: Prisma.XOR +} + +export type PostUpdateManyWithWhereWithoutAuthorInput = { + where: Prisma.PostScalarWhereInput + data: Prisma.XOR +} + +export type PostScalarWhereInput = { + AND?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] + OR?: Prisma.PostScalarWhereInput[] + NOT?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] + id?: Prisma.IntFilter<"Post"> | number + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number +} + +export type PostCreateManyAuthorInput = { + id?: number + title: string + content?: string | null + published?: boolean +} + +export type PostUpdateWithoutAuthorInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateWithoutAuthorInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateManyWithoutAuthorInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + + + +export type PostSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectScalar = { + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean +} + +export type PostOmit = runtime.Types.Extensions.GetOmit<"id" | "title" | "content" | "published" | "authorId", ExtArgs["result"]["post"]> +export type PostInclude = { + author?: boolean | Prisma.UserDefaultArgs +} +export type PostIncludeCreateManyAndReturn = { + author?: boolean | Prisma.UserDefaultArgs +} +export type PostIncludeUpdateManyAndReturn = { + author?: boolean | Prisma.UserDefaultArgs +} + +export type $PostPayload = { + name: "Post" + objects: { + author: Prisma.$UserPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + title: string + content: string | null + published: boolean + authorId: number + }, ExtArgs["result"]["post"]> + composites: {} +} + +export type PostGetPayload = runtime.Types.Result.GetResult + +export type PostCountArgs = + Omit & { + select?: PostCountAggregateInputType | true + } + +export interface PostDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Post'], meta: { name: 'Post' } } + /** + * Find zero or one Post that matches the filter. + * @param {PostFindUniqueArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Post that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PostFindUniqueOrThrowArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Post 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 {PostFindFirstArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Post that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {PostFindFirstOrThrowArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Posts 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 {PostFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Posts + * const posts = await prisma.post.findMany() + * + * // Get first 10 Posts + * const posts = await prisma.post.findMany({ take: 10 }) + * + * // Only select the `id` + * const postWithIdOnly = await prisma.post.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Post. + * @param {PostCreateArgs} args - Arguments to create a Post. + * @example + * // Create one Post + * const Post = await prisma.post.create({ + * data: { + * // ... data to create a Post + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Posts. + * @param {PostCreateManyArgs} args - Arguments to create many Posts. + * @example + * // Create many Posts + * const post = await prisma.post.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Posts and returns the data saved in the database. + * @param {PostCreateManyAndReturnArgs} args - Arguments to create many Posts. + * @example + * // Create many Posts + * const post = await prisma.post.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Posts and only return the `id` + * const postWithIdOnly = await prisma.post.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Post. + * @param {PostDeleteArgs} args - Arguments to delete one Post. + * @example + * // Delete one Post + * const Post = await prisma.post.delete({ + * where: { + * // ... filter to delete one Post + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Post. + * @param {PostUpdateArgs} args - Arguments to update one Post. + * @example + * // Update one Post + * const post = await prisma.post.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Posts. + * @param {PostDeleteManyArgs} args - Arguments to filter Posts to delete. + * @example + * // Delete a few Posts + * const { count } = await prisma.post.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Posts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Posts + * const post = await prisma.post.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Posts and returns the data updated in the database. + * @param {PostUpdateManyAndReturnArgs} args - Arguments to update many Posts. + * @example + * // Update many Posts + * const post = await prisma.post.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Posts and only return the `id` + * const postWithIdOnly = await prisma.post.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Post. + * @param {PostUpsertArgs} args - Arguments to update or create a Post. + * @example + * // Update or create a Post + * const post = await prisma.post.upsert({ + * create: { + * // ... data to create a Post + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Post we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Posts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostCountArgs} args - Arguments to filter Posts to count. + * @example + * // Count the number of Posts + * const count = await prisma.post.count({ + * where: { + * // ... the filter for the Posts we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Post. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Post. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostGroupByArgs} 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 PostGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PostGroupByArgs['orderBy'] } + : { orderBy?: PostGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetPostGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Post model + */ +readonly fields: PostFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Post. + * 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 interface Prisma__PostClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + author = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Post model + */ +export interface PostFieldRefs { + readonly id: Prisma.FieldRef<"Post", 'Int'> + readonly title: Prisma.FieldRef<"Post", 'String'> + readonly content: Prisma.FieldRef<"Post", 'String'> + readonly published: Prisma.FieldRef<"Post", 'Boolean'> + readonly authorId: Prisma.FieldRef<"Post", 'Int'> +} + + +// Custom InputTypes +/** + * Post findUnique + */ +export type PostFindUniqueArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post findUniqueOrThrow + */ +export type PostFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post findFirst + */ +export type PostFindFirstArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Posts. + */ + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post findFirstOrThrow + */ +export type PostFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Posts. + */ + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post findMany + */ +export type PostFindManyArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Posts to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post create + */ +export type PostCreateArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The data needed to create a Post. + */ + data: Prisma.XOR +} + +/** + * Post createMany + */ +export type PostCreateManyArgs = { + /** + * The data used to create many Posts. + */ + data: Prisma.PostCreateManyInput | Prisma.PostCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Post createManyAndReturn + */ +export type PostCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * The data used to create many Posts. + */ + data: Prisma.PostCreateManyInput | Prisma.PostCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostIncludeCreateManyAndReturn | null +} + +/** + * Post update + */ +export type PostUpdateArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The data needed to update a Post. + */ + data: Prisma.XOR + /** + * Choose, which Post to update. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post updateMany + */ +export type PostUpdateManyArgs = { + /** + * The data used to update Posts. + */ + data: Prisma.XOR + /** + * Filter which Posts to update + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to update. + */ + limit?: number +} + +/** + * Post updateManyAndReturn + */ +export type PostUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * The data used to update Posts. + */ + data: Prisma.XOR + /** + * Filter which Posts to update + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostIncludeUpdateManyAndReturn | null +} + +/** + * Post upsert + */ +export type PostUpsertArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The filter to search for the Post to update in case it exists. + */ + where: Prisma.PostWhereUniqueInput + /** + * In case the Post found by the `where` argument doesn't exist, create a new Post with this data. + */ + create: Prisma.XOR + /** + * In case the Post was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Post delete + */ +export type PostDeleteArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter which Post to delete. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post deleteMany + */ +export type PostDeleteManyArgs = { + /** + * Filter which Posts to delete + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to delete. + */ + limit?: number +} + +/** + * Post without action + */ +export type PostDefaultArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null +} diff --git a/orm/solid-start/src/generated/prisma/models/User.ts b/orm/solid-start/src/generated/prisma/models/User.ts new file mode 100644 index 000000000000..7286fee160a1 --- /dev/null +++ b/orm/solid-start/src/generated/prisma/models/User.ts @@ -0,0 +1,1312 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `User` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model User + * + */ +export type UserModel = runtime.Types.Result.DefaultSelection + +export type AggregateUser = { + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +export type UserAvgAggregateOutputType = { + id: number | null +} + +export type UserSumAggregateOutputType = { + id: number | null +} + +export type UserMinAggregateOutputType = { + id: number | null + email: string | null + name: string | null +} + +export type UserMaxAggregateOutputType = { + id: number | null + email: string | null + name: string | null +} + +export type UserCountAggregateOutputType = { + id: number + email: number + name: number + _all: number +} + + +export type UserAvgAggregateInputType = { + id?: true +} + +export type UserSumAggregateInputType = { + id?: true +} + +export type UserMinAggregateInputType = { + id?: true + email?: true + name?: true +} + +export type UserMaxAggregateInputType = { + id?: true + email?: true + name?: true +} + +export type UserCountAggregateInputType = { + id?: true + email?: true + name?: true + _all?: true +} + +export type UserAggregateArgs = { + /** + * Filter which User to aggregate. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Users + **/ + _count?: true | UserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: UserAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: UserSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserMaxAggregateInputType +} + +export type GetUserAggregateType = { + [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type UserGroupByArgs = { + where?: Prisma.UserWhereInput + orderBy?: Prisma.UserOrderByWithAggregationInput | Prisma.UserOrderByWithAggregationInput[] + by: Prisma.UserScalarFieldEnum[] | Prisma.UserScalarFieldEnum + having?: Prisma.UserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserCountAggregateInputType | true + _avg?: UserAvgAggregateInputType + _sum?: UserSumAggregateInputType + _min?: UserMinAggregateInputType + _max?: UserMaxAggregateInputType +} + +export type UserGroupByOutputType = { + id: number + email: string + name: string | null + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserWhereInput = { + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + id?: Prisma.IntFilter<"User"> | number + email?: Prisma.StringFilter<"User"> | string + name?: Prisma.StringNullableFilter<"User"> | string | null + posts?: Prisma.PostListRelationFilter +} + +export type UserOrderByWithRelationInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + posts?: Prisma.PostOrderByRelationAggregateInput +} + +export type UserWhereUniqueInput = Prisma.AtLeast<{ + id?: number + email?: string + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + name?: Prisma.StringNullableFilter<"User"> | string | null + posts?: Prisma.PostListRelationFilter +}, "id" | "email"> + +export type UserOrderByWithAggregationInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.UserCountOrderByAggregateInput + _avg?: Prisma.UserAvgOrderByAggregateInput + _max?: Prisma.UserMaxOrderByAggregateInput + _min?: Prisma.UserMinOrderByAggregateInput + _sum?: Prisma.UserSumOrderByAggregateInput +} + +export type UserScalarWhereWithAggregatesInput = { + AND?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + OR?: Prisma.UserScalarWhereWithAggregatesInput[] + NOT?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"User"> | number + email?: Prisma.StringWithAggregatesFilter<"User"> | string + name?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null +} + +export type UserCreateInput = { + email: string + name?: string | null + posts?: Prisma.PostCreateNestedManyWithoutAuthorInput +} + +export type UserUncheckedCreateInput = { + id?: number + email: string + name?: string | null + posts?: Prisma.PostUncheckedCreateNestedManyWithoutAuthorInput +} + +export type UserUpdateInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + posts?: Prisma.PostUpdateManyWithoutAuthorNestedInput +} + +export type UserUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + posts?: Prisma.PostUncheckedUpdateManyWithoutAuthorNestedInput +} + +export type UserCreateManyInput = { + id?: number + email: string + name?: string | null +} + +export type UserUpdateManyMutationInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserCountOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserAvgOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type UserMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserMinOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserSumOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type UserScalarRelationFilter = { + is?: Prisma.UserWhereInput + isNot?: Prisma.UserWhereInput +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + +export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number +} + +export type UserCreateNestedOneWithoutPostsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutPostsInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutPostsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutPostsInput + upsert?: Prisma.UserUpsertWithoutPostsInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutPostsInput> +} + +export type UserCreateWithoutPostsInput = { + email: string + name?: string | null +} + +export type UserUncheckedCreateWithoutPostsInput = { + id?: number + email: string + name?: string | null +} + +export type UserCreateOrConnectWithoutPostsInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutPostsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutPostsInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutPostsInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateWithoutPostsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type UserCountOutputType + */ + +export type UserCountOutputType = { + posts: number +} + +export type UserCountOutputTypeSelect = { + posts?: boolean | UserCountOutputTypeCountPostsArgs +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: Prisma.UserCountOutputTypeSelect | null +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountPostsArgs = { + where?: Prisma.PostWhereInput +} + + +export type UserSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean + posts?: boolean | Prisma.User$postsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +}, ExtArgs["result"]["user"]> + +export type UserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectScalar = { + id?: boolean + email?: boolean + name?: boolean +} + +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "email" | "name", ExtArgs["result"]["user"]> +export type UserInclude = { + posts?: boolean | Prisma.User$postsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +} +export type UserIncludeCreateManyAndReturn = {} +export type UserIncludeUpdateManyAndReturn = {} + +export type $UserPayload = { + name: "User" + objects: { + posts: Prisma.$PostPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + email: string + name: string | null + }, ExtArgs["result"]["user"]> + composites: {} +} + +export type UserGetPayload = runtime.Types.Result.GetResult + +export type UserCountArgs = + Omit & { + select?: UserCountAggregateInputType | true + } + +export interface UserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } + /** + * Find zero or one User that matches the filter. + * @param {UserFindUniqueArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one User that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User 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 {UserFindFirstArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {UserFindFirstOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Users 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 {UserFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Users + * const users = await prisma.user.findMany() + * + * // Get first 10 Users + * const users = await prisma.user.findMany({ take: 10 }) + * + * // Only select the `id` + * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a User. + * @param {UserCreateArgs} args - Arguments to create a User. + * @example + * // Create one User + * const User = await prisma.user.create({ + * data: { + * // ... data to create a User + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Users. + * @param {UserCreateManyArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Users and returns the data saved in the database. + * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Users and only return the `id` + * const userWithIdOnly = await prisma.user.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a User. + * @param {UserDeleteArgs} args - Arguments to delete one User. + * @example + * // Delete one User + * const User = await prisma.user.delete({ + * where: { + * // ... filter to delete one User + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one User. + * @param {UserUpdateArgs} args - Arguments to update one User. + * @example + * // Update one User + * const user = await prisma.user.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Users. + * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. + * @example + * // Delete a few Users + * const { count } = await prisma.user.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Users + * const user = await prisma.user.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users and returns the data updated in the database. + * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. + * @example + * // Update many Users + * const user = await prisma.user.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Users and only return the `id` + * const userWithIdOnly = await prisma.user.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one User. + * @param {UserUpsertArgs} args - Arguments to update or create a User. + * @example + * // Update or create a User + * const user = await prisma.user.upsert({ + * create: { + * // ... data to create a User + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the User we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserCountArgs} args - Arguments to filter Users to count. + * @example + * // Count the number of Users + * const count = await prisma.user.count({ + * where: { + * // ... the filter for the Users we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserGroupByArgs} 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 UserGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: UserGroupByArgs['orderBy'] } + : { orderBy?: UserGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the User model + */ +readonly fields: UserFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for User. + * 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 interface Prisma__UserClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + posts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the User model + */ +export interface UserFieldRefs { + readonly id: Prisma.FieldRef<"User", 'Int'> + readonly email: Prisma.FieldRef<"User", 'String'> + readonly name: Prisma.FieldRef<"User", 'String'> +} + + +// Custom InputTypes +/** + * User findUnique + */ +export type UserFindUniqueArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findUniqueOrThrow + */ +export type UserFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findFirst + */ +export type UserFindFirstArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findFirstOrThrow + */ +export type UserFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findMany + */ +export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which Users to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User create + */ +export type UserCreateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to create a User. + */ + data: Prisma.XOR +} + +/** + * User createMany + */ +export type UserCreateManyArgs = { + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User createManyAndReturn + */ +export type UserCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectCreateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User update + */ +export type UserUpdateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to update a User. + */ + data: Prisma.XOR + /** + * Choose, which User to update. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User updateMany + */ +export type UserUpdateManyArgs = { + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User updateManyAndReturn + */ +export type UserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User upsert + */ +export type UserUpsertArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The filter to search for the User to update in case it exists. + */ + where: Prisma.UserWhereUniqueInput + /** + * In case the User found by the `where` argument doesn't exist, create a new User with this data. + */ + create: Prisma.XOR + /** + * In case the User was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * User delete + */ +export type UserDeleteArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter which User to delete. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User deleteMany + */ +export type UserDeleteManyArgs = { + /** + * Filter which Users to delete + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to delete. + */ + limit?: number +} + +/** + * User.posts + */ +export type User$postsArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + where?: Prisma.PostWhereInput + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + cursor?: Prisma.PostWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * User without action + */ +export type UserDefaultArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null +} From cef228521ee87de3f70e61f011add1c78bea36a2 Mon Sep 17 00:00:00 2001 From: Nikolas Burk Date: Wed, 1 Oct 2025 14:35:06 +0200 Subject: [PATCH 03/13] update nextjs example --- orm/nextjs/app/generated/prisma/browser.ts | 28 + orm/nextjs/app/generated/prisma/client.ts | 52 + .../app/generated/prisma/commonInputTypes.ts | 251 +++ orm/nextjs/app/generated/prisma/enums.ts | 14 + .../app/generated/prisma/internal/class.ts | 242 +++ .../prisma/internal/prismaNamespace.ts | 848 ++++++++++ .../prisma/internal/prismaNamespaceBrowser.ts | 113 ++ orm/nextjs/app/generated/prisma/models.ts | 12 + .../app/generated/prisma/models/Post.ts | 1388 +++++++++++++++++ .../app/generated/prisma/models/User.ts | 1312 ++++++++++++++++ orm/nextjs/lib/prisma.ts | 2 +- orm/nextjs/package.json | 10 +- orm/nextjs/prisma/schema.prisma | 5 +- orm/nextjs/prisma/seed.ts | 2 +- 14 files changed, 4271 insertions(+), 8 deletions(-) create mode 100644 orm/nextjs/app/generated/prisma/browser.ts create mode 100644 orm/nextjs/app/generated/prisma/client.ts create mode 100644 orm/nextjs/app/generated/prisma/commonInputTypes.ts create mode 100644 orm/nextjs/app/generated/prisma/enums.ts create mode 100644 orm/nextjs/app/generated/prisma/internal/class.ts create mode 100644 orm/nextjs/app/generated/prisma/internal/prismaNamespace.ts create mode 100644 orm/nextjs/app/generated/prisma/internal/prismaNamespaceBrowser.ts create mode 100644 orm/nextjs/app/generated/prisma/models.ts create mode 100644 orm/nextjs/app/generated/prisma/models/Post.ts create mode 100644 orm/nextjs/app/generated/prisma/models/User.ts diff --git a/orm/nextjs/app/generated/prisma/browser.ts b/orm/nextjs/app/generated/prisma/browser.ts new file mode 100644 index 000000000000..e8ef4c6baf02 --- /dev/null +++ b/orm/nextjs/app/generated/prisma/browser.ts @@ -0,0 +1,28 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma-related types and utilities in a browser. + * Use it to get access to models, enums, and input types. + * + * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only. + * See `client.ts` for the standard, server-side entry point. + * + * 🟢 You can import this file directly. + */ + +import * as Prisma from './internal/prismaNamespaceBrowser' +export { Prisma } +export * as $Enums from './enums' +export * from './enums'; +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Post + * + */ +export type Post = Prisma.PostModel diff --git a/orm/nextjs/app/generated/prisma/client.ts b/orm/nextjs/app/generated/prisma/client.ts new file mode 100644 index 000000000000..7b9669007702 --- /dev/null +++ b/orm/nextjs/app/generated/prisma/client.ts @@ -0,0 +1,52 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types. + * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead. + * + * 🟢 You can import this file directly. + */ + +import * as process from 'node:process' +import * as path from 'node:path' +import { fileURLToPath } from 'node:url' +globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url)) + +import * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums" +import * as $Class from "./internal/class" +import * as Prisma from "./internal/prismaNamespace" + +export * as $Enums from './enums' +export * from "./enums" +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export const PrismaClient = $Class.getPrismaClientClass(__dirname) +export type PrismaClient = $Class.PrismaClient +export { Prisma } + + + +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Post + * + */ +export type Post = Prisma.PostModel diff --git a/orm/nextjs/app/generated/prisma/commonInputTypes.ts b/orm/nextjs/app/generated/prisma/commonInputTypes.ts new file mode 100644 index 000000000000..e3fd127933bb --- /dev/null +++ b/orm/nextjs/app/generated/prisma/commonInputTypes.ts @@ -0,0 +1,251 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports various common sort, input & filter types that are not directly linked to a particular model. + * + * 🟢 You can import this file directly. + */ + +import type * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums" +import type * as Prisma from "./internal/prismaNamespace" + + +export type IntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type StringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type StringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + +export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type NestedIntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type NestedStringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatFilter<$PrismaModel> | number +} + +export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + + diff --git a/orm/nextjs/app/generated/prisma/enums.ts b/orm/nextjs/app/generated/prisma/enums.ts new file mode 100644 index 000000000000..0189a3446d4f --- /dev/null +++ b/orm/nextjs/app/generated/prisma/enums.ts @@ -0,0 +1,14 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* +* This file exports all enum related types from the schema. +* +* 🟢 You can import this file directly. +*/ + + + +// This file is empty because there are no enums in the schema. +export {} diff --git a/orm/nextjs/app/generated/prisma/internal/class.ts b/orm/nextjs/app/generated/prisma/internal/class.ts new file mode 100644 index 000000000000..d5567d0a8fd0 --- /dev/null +++ b/orm/nextjs/app/generated/prisma/internal/class.ts @@ -0,0 +1,242 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * Please import the `PrismaClient` class from the `client.ts` file instead. + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "./prismaNamespace" + + +const config: runtime.GetPrismaClientConfig = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client" + }, + "output": { + "value": "/Users/nikolasburk/Desktop/examples-v7/orm/nextjs/app/generated/prisma", + "fromEnvVar": null + }, + "config": { + "engineType": "client" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "darwin", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "/Users/nikolasburk/Desktop/examples-v7/orm/nextjs/prisma/schema.prisma", + "isCustomOutput": true + }, + "relativePath": "../../../prisma", + "clientVersion": "6.16.3", + "engineVersion": "bb420e667c1820a8c05a38023385f6cc7ef8e83a", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "postinstall": false, + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\n// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?\n// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init\n\ngenerator client {\n provider = \"prisma-client\"\n engineType = \"client\"\n output = \"../app/generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n posts Post[]\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n published Boolean @default(false)\n authorId Int\n author User @relation(fields: [authorId], references: [id])\n}\n", + "inlineSchemaHash": "47c22c9569c6a0ae4a6d19d812492453a2e335ec26f1055cd7592bc4f6eac8a6", + "copyEngine": true, + "runtimeDataModel": { + "models": {}, + "enums": {}, + "types": {} + }, + "dirname": "" +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"posts\",\"kind\":\"object\",\"type\":\"Post\",\"relationName\":\"PostToUser\"}],\"dbName\":null},\"Post\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"content\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"published\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"authorId\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"author\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"PostToUser\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.engineWasm = undefined + +async function decodeBase64AsWasm(wasmBase64: string): Promise { + const { Buffer } = await import('node:buffer') + const wasmArray = Buffer.from(wasmBase64, 'base64') + return new WebAssembly.Module(wasmArray) +} + +config.compilerWasm = { + getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"), + + getQueryCompilerWasmModule: async () => { + const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.postgresql.wasm-base64.mjs") + return await decodeBase64AsWasm(wasm) + } +} + + + + +export type LogOptions = + 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never + +export interface PrismaClientConstructor { + /** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + + new < + Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + LogOpts extends LogOptions = LogOptions, + OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'], + ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs + >(options?: Prisma.Subset ): PrismaClient +} + +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + +export interface PrismaClient< + in LogOpts extends Prisma.LogLevel = never, + in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'], + in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs +> { + [K: symbol]: { types: Prisma.TypeMap['other'] } + + $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient; + + /** + * Connect with the database + */ + $connect(): runtime.Types.Utils.JsPromise; + + /** + * Disconnect from the database + */ + $disconnect(): runtime.Types.Utils.JsPromise; + +/** + * 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 }): runtime.Types.Utils.JsPromise> + + $transaction(fn: (prisma: Omit) => runtime.Types.Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise + + + $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs, runtime.Types.Utils.Call, { + extArgs: ExtArgs + }>> + + /** + * `prisma.user`: Exposes CRUD operations for the **User** model. + * Example usage: + * ```ts + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + */ + get user(): Prisma.UserDelegate; + + /** + * `prisma.post`: Exposes CRUD operations for the **Post** model. + * Example usage: + * ```ts + * // Fetch zero or more Posts + * const posts = await prisma.post.findMany() + * ``` + */ + get post(): Prisma.PostDelegate; +} + +export function getPrismaClientClass(dirname: string): PrismaClientConstructor { + config.dirname = dirname + return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor +} diff --git a/orm/nextjs/app/generated/prisma/internal/prismaNamespace.ts b/orm/nextjs/app/generated/prisma/internal/prismaNamespace.ts new file mode 100644 index 000000000000..feac437c628d --- /dev/null +++ b/orm/nextjs/app/generated/prisma/internal/prismaNamespace.ts @@ -0,0 +1,848 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the client.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "../models" +import { type PrismaClient } from "./class" + +export type * from '../models' + +export type DMMF = typeof runtime.DMMF + +export type PrismaPromise = runtime.Types.Public.PrismaPromise + +/** + * Prisma Errors + */ + +export const PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError +export type PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + +export const PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError +export type PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + +export const PrismaClientRustPanicError = runtime.PrismaClientRustPanicError +export type PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + +export const PrismaClientInitializationError = runtime.PrismaClientInitializationError +export type PrismaClientInitializationError = runtime.PrismaClientInitializationError + +export const PrismaClientValidationError = runtime.PrismaClientValidationError +export type PrismaClientValidationError = runtime.PrismaClientValidationError + +/** + * Re-export of sql-template-tag + */ +export const sql = runtime.sqltag +export const empty = runtime.empty +export const join = runtime.join +export const raw = runtime.raw +export const Sql = runtime.Sql +export type Sql = runtime.Sql + + + +/** + * Decimal.js + */ +export const Decimal = runtime.Decimal +export type 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 + +/** +* Extensions +*/ +export type Extension = runtime.Types.Extensions.UserArgs +export const getExtensionContext = runtime.Extensions.getExtensionContext +export type Args = runtime.Types.Public.Args +export type Payload = runtime.Types.Public.Payload +export type Result = runtime.Types.Public.Result +export type Exact = runtime.Types.Public.Exact + +export type PrismaVersion = { + client: string + engine: string +} + +/** + * Prisma Client JS version: 6.16.3 + * Query Engine version: bb420e667c1820a8c05a38023385f6cc7ef8e83a + */ +export const prismaVersion: PrismaVersion = { + client: "6.16.3", + engine: "bb420e667c1820a8c05a38023385f6cc7ef8e83a" +} + +/** + * Utility Types + */ + +export type JsonObject = runtime.JsonObject +export type JsonArray = runtime.JsonArray +export type JsonValue = runtime.JsonValue +export type InputJsonObject = runtime.InputJsonObject +export type InputJsonArray = runtime.InputJsonArray +export type InputJsonValue = runtime.InputJsonValue + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +type SelectAndInclude = { + select: any + include: any +} + +type SelectAndOmit = { + select: any + omit: any +} + +/** + * 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; + +/** + * 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`.' + : T extends SelectAndOmit + ? 'Please either choose `select` or `omit`.' + : {}) + +/** + * 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 + */ +export 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] + +export type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 +> = O extends unknown ? _Either : never + +export type Union = any + +export 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 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 +export 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 ? P : 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>>; + +export type Boolean = True | False + +export type True = 1 + +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 + +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 + +export 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 +export type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + +/** + * Like `Pick`, but additionally can also accept an array of keys + */ +export type PickEnumerable | keyof T> = Prisma__Pick> + +/** + * Exclude all keys with underscores + */ +export type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + +export type FieldRef = runtime.FieldRef + +type FieldRefInputType = Model extends never ? never : FieldRef + + +export const ModelName = { + User: 'User', + Post: 'Post' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + +export interface TypeMapCb extends runtime.Types.Utils.Fn<{extArgs: runtime.Types.Extensions.InternalArgs }, runtime.Types.Utils.Record> { + returns: TypeMap +} + +export type TypeMap = { + globalOmitOptions: { + omit: GlobalOmitOptions + } + meta: { + modelProps: "user" | "post" + txIsolationLevel: TransactionIsolationLevel + } + model: { + User: { + payload: Prisma.$UserPayload + fields: Prisma.UserFieldRefs + operations: { + findUnique: { + args: Prisma.UserFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.UserFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.UserCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.UserCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UserCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.UserDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.UserUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.UserUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.UserUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.UserGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.UserCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Post: { + payload: Prisma.$PostPayload + fields: Prisma.PostFieldRefs + operations: { + findUnique: { + args: Prisma.PostFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PostFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PostFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PostFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PostFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PostCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PostCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PostCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.PostDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PostUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PostDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PostUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.PostUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.PostUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PostAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PostGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PostCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + } +} & { + other: { + payload: any + operations: { + $executeRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + } + } +} + +/** + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + email: 'email', + name: 'name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const PostScalarFieldEnum = { + id: 'id', + title: 'title', + content: 'content', + published: 'published', + authorId: 'authorId' +} as const + +export type PostScalarFieldEnum = (typeof PostScalarFieldEnum)[keyof typeof PostScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + + +/** + * Field references + */ + + +/** + * Reference to a field of type 'Int' + */ +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + +/** + * Reference to a field of type 'Int[]' + */ +export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + + + +/** + * Reference to a field of type 'String' + */ +export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> + + + +/** + * Reference to a field of type 'String[]' + */ +export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> + + + +/** + * Reference to a field of type 'Boolean' + */ +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + +/** + * Reference to a field of type 'Float' + */ +export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> + + + +/** + * Reference to a field of type 'Float[]' + */ +export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> + + +/** + * Batch Payload for updateMany & deleteMany & createMany + */ +export type BatchPayload = { + count: number +} + + +export type Datasource = { + url?: string +} +export type Datasources = { + db?: Datasource +} + +export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs> +export type DefaultPrismaClient = PrismaClient +export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' +export interface PrismaClientOptions { + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasourceUrl?: string + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + /** + * @example + * ``` + * // Shorthand for `emit: 'stdout'` + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events only + * log: [ + * { emit: 'event', level: 'query' }, + * { emit: 'event', level: 'info' }, + * { emit: 'event', level: 'warn' } + * { emit: 'event', level: 'error' } + * ] + * + * / Emit as events and log to stdout + * og: [ + * { 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?: (LogLevel | LogDefinition)[] + /** + * The default values for transactionOptions + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: { + maxWait?: number + timeout?: number + isolationLevel?: TransactionIsolationLevel + } + /** + * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale` + */ + adapter?: runtime.SqlDriverAdapterFactory | null + /** + * Global configuration for omitting model fields by default. + * + * @example + * ``` + * const prisma = new PrismaClient({ + * omit: { + * user: { + * password: true + * } + * } + * }) + * ``` + */ + omit?: GlobalOmitConfig +} +export type GlobalOmitConfig = { + user?: Prisma.UserOmit + post?: Prisma.PostOmit +} + +/* Types for Logging */ +export type LogLevel = 'info' | 'query' | 'warn' | 'error' +export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' +} + +export type CheckIsLogLevel = T extends LogLevel ? T : never; + +export type GetLogType = CheckIsLogLevel< + T extends LogDefinition ? T['level'] : T +>; + +export type GetEvents = T extends Array + ? 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' + | 'findUniqueOrThrow' + | 'findMany' + | 'findFirst' + | 'findFirstOrThrow' + | 'create' + | 'createMany' + | 'createManyAndReturn' + | 'update' + | 'updateMany' + | 'updateManyAndReturn' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + | 'groupBy' + +/** + * `PrismaClient` proxy available in interactive transactions. + */ +export type TransactionClient = Omit + diff --git a/orm/nextjs/app/generated/prisma/internal/prismaNamespaceBrowser.ts b/orm/nextjs/app/generated/prisma/internal/prismaNamespaceBrowser.ts new file mode 100644 index 000000000000..a36a7f751844 --- /dev/null +++ b/orm/nextjs/app/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -0,0 +1,113 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/index-browser" + +export type * from '../models' +export type * from './prismaNamespace' + +export const Decimal = runtime.Decimal + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +export const ModelName = { + User: 'User', + Post: 'Post' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + +/* + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + email: 'email', + name: 'name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const PostScalarFieldEnum = { + id: 'id', + title: 'title', + content: 'content', + published: 'published', + authorId: 'authorId' +} as const + +export type PostScalarFieldEnum = (typeof PostScalarFieldEnum)[keyof typeof PostScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + diff --git a/orm/nextjs/app/generated/prisma/models.ts b/orm/nextjs/app/generated/prisma/models.ts new file mode 100644 index 000000000000..c9a79b69577b --- /dev/null +++ b/orm/nextjs/app/generated/prisma/models.ts @@ -0,0 +1,12 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This is a barrel export file for all models and their related types. + * + * 🟢 You can import this file directly. + */ +export type * from './models/User' +export type * from './models/Post' +export type * from './commonInputTypes' \ No newline at end of file diff --git a/orm/nextjs/app/generated/prisma/models/Post.ts b/orm/nextjs/app/generated/prisma/models/Post.ts new file mode 100644 index 000000000000..b9f8c6669e64 --- /dev/null +++ b/orm/nextjs/app/generated/prisma/models/Post.ts @@ -0,0 +1,1388 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `Post` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model Post + * + */ +export type PostModel = runtime.Types.Result.DefaultSelection + +export type AggregatePost = { + _count: PostCountAggregateOutputType | null + _avg: PostAvgAggregateOutputType | null + _sum: PostSumAggregateOutputType | null + _min: PostMinAggregateOutputType | null + _max: PostMaxAggregateOutputType | null +} + +export type PostAvgAggregateOutputType = { + id: number | null + authorId: number | null +} + +export type PostSumAggregateOutputType = { + id: number | null + authorId: number | null +} + +export type PostMinAggregateOutputType = { + id: number | null + title: string | null + content: string | null + published: boolean | null + authorId: number | null +} + +export type PostMaxAggregateOutputType = { + id: number | null + title: string | null + content: string | null + published: boolean | null + authorId: number | null +} + +export type PostCountAggregateOutputType = { + id: number + title: number + content: number + published: number + authorId: number + _all: number +} + + +export type PostAvgAggregateInputType = { + id?: true + authorId?: true +} + +export type PostSumAggregateInputType = { + id?: true + authorId?: true +} + +export type PostMinAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true +} + +export type PostMaxAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true +} + +export type PostCountAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true + _all?: true +} + +export type PostAggregateArgs = { + /** + * Filter which Post to aggregate. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Posts + **/ + _count?: true | PostCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PostAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PostSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PostMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PostMaxAggregateInputType +} + +export type GetPostAggregateType = { + [P in keyof T & keyof AggregatePost]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PostGroupByArgs = { + where?: Prisma.PostWhereInput + orderBy?: Prisma.PostOrderByWithAggregationInput | Prisma.PostOrderByWithAggregationInput[] + by: Prisma.PostScalarFieldEnum[] | Prisma.PostScalarFieldEnum + having?: Prisma.PostScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PostCountAggregateInputType | true + _avg?: PostAvgAggregateInputType + _sum?: PostSumAggregateInputType + _min?: PostMinAggregateInputType + _max?: PostMaxAggregateInputType +} + +export type PostGroupByOutputType = { + id: number + title: string + content: string | null + published: boolean + authorId: number + _count: PostCountAggregateOutputType | null + _avg: PostAvgAggregateOutputType | null + _sum: PostSumAggregateOutputType | null + _min: PostMinAggregateOutputType | null + _max: PostMaxAggregateOutputType | null +} + +type GetPostGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PostGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PostWhereInput = { + AND?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + OR?: Prisma.PostWhereInput[] + NOT?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + id?: Prisma.IntFilter<"Post"> | number + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number + author?: Prisma.XOR +} + +export type PostOrderByWithRelationInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrderInput | Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder + author?: Prisma.UserOrderByWithRelationInput +} + +export type PostWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + OR?: Prisma.PostWhereInput[] + NOT?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number + author?: Prisma.XOR +}, "id"> + +export type PostOrderByWithAggregationInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrderInput | Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder + _count?: Prisma.PostCountOrderByAggregateInput + _avg?: Prisma.PostAvgOrderByAggregateInput + _max?: Prisma.PostMaxOrderByAggregateInput + _min?: Prisma.PostMinOrderByAggregateInput + _sum?: Prisma.PostSumOrderByAggregateInput +} + +export type PostScalarWhereWithAggregatesInput = { + AND?: Prisma.PostScalarWhereWithAggregatesInput | Prisma.PostScalarWhereWithAggregatesInput[] + OR?: Prisma.PostScalarWhereWithAggregatesInput[] + NOT?: Prisma.PostScalarWhereWithAggregatesInput | Prisma.PostScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"Post"> | number + title?: Prisma.StringWithAggregatesFilter<"Post"> | string + content?: Prisma.StringNullableWithAggregatesFilter<"Post"> | string | null + published?: Prisma.BoolWithAggregatesFilter<"Post"> | boolean + authorId?: Prisma.IntWithAggregatesFilter<"Post"> | number +} + +export type PostCreateInput = { + title: string + content?: string | null + published?: boolean + author: Prisma.UserCreateNestedOneWithoutPostsInput +} + +export type PostUncheckedCreateInput = { + id?: number + title: string + content?: string | null + published?: boolean + authorId: number +} + +export type PostUpdateInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + author?: Prisma.UserUpdateOneRequiredWithoutPostsNestedInput +} + +export type PostUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + authorId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostCreateManyInput = { + id?: number + title: string + content?: string | null + published?: boolean + authorId: number +} + +export type PostUpdateManyMutationInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + authorId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostListRelationFilter = { + every?: Prisma.PostWhereInput + some?: Prisma.PostWhereInput + none?: Prisma.PostWhereInput +} + +export type PostOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type PostCountOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostMinOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostSumOrderByAggregateInput = { + id?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostCreateNestedManyWithoutAuthorInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] +} + +export type PostUncheckedCreateNestedManyWithoutAuthorInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] +} + +export type PostUpdateManyWithoutAuthorNestedInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + upsert?: Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput | Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + set?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + disconnect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + delete?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + update?: Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput | Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput[] + updateMany?: Prisma.PostUpdateManyWithWhereWithoutAuthorInput | Prisma.PostUpdateManyWithWhereWithoutAuthorInput[] + deleteMany?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] +} + +export type PostUncheckedUpdateManyWithoutAuthorNestedInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + upsert?: Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput | Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + set?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + disconnect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + delete?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + update?: Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput | Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput[] + updateMany?: Prisma.PostUpdateManyWithWhereWithoutAuthorInput | Prisma.PostUpdateManyWithWhereWithoutAuthorInput[] + deleteMany?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] +} + +export type BoolFieldUpdateOperationsInput = { + set?: boolean +} + +export type PostCreateWithoutAuthorInput = { + title: string + content?: string | null + published?: boolean +} + +export type PostUncheckedCreateWithoutAuthorInput = { + id?: number + title: string + content?: string | null + published?: boolean +} + +export type PostCreateOrConnectWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + create: Prisma.XOR +} + +export type PostCreateManyAuthorInputEnvelope = { + data: Prisma.PostCreateManyAuthorInput | Prisma.PostCreateManyAuthorInput[] + skipDuplicates?: boolean +} + +export type PostUpsertWithWhereUniqueWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PostUpdateWithWhereUniqueWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + data: Prisma.XOR +} + +export type PostUpdateManyWithWhereWithoutAuthorInput = { + where: Prisma.PostScalarWhereInput + data: Prisma.XOR +} + +export type PostScalarWhereInput = { + AND?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] + OR?: Prisma.PostScalarWhereInput[] + NOT?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] + id?: Prisma.IntFilter<"Post"> | number + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number +} + +export type PostCreateManyAuthorInput = { + id?: number + title: string + content?: string | null + published?: boolean +} + +export type PostUpdateWithoutAuthorInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateWithoutAuthorInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateManyWithoutAuthorInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + + + +export type PostSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectScalar = { + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean +} + +export type PostOmit = runtime.Types.Extensions.GetOmit<"id" | "title" | "content" | "published" | "authorId", ExtArgs["result"]["post"]> +export type PostInclude = { + author?: boolean | Prisma.UserDefaultArgs +} +export type PostIncludeCreateManyAndReturn = { + author?: boolean | Prisma.UserDefaultArgs +} +export type PostIncludeUpdateManyAndReturn = { + author?: boolean | Prisma.UserDefaultArgs +} + +export type $PostPayload = { + name: "Post" + objects: { + author: Prisma.$UserPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + title: string + content: string | null + published: boolean + authorId: number + }, ExtArgs["result"]["post"]> + composites: {} +} + +export type PostGetPayload = runtime.Types.Result.GetResult + +export type PostCountArgs = + Omit & { + select?: PostCountAggregateInputType | true + } + +export interface PostDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Post'], meta: { name: 'Post' } } + /** + * Find zero or one Post that matches the filter. + * @param {PostFindUniqueArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Post that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PostFindUniqueOrThrowArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Post 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 {PostFindFirstArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Post that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {PostFindFirstOrThrowArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Posts 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 {PostFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Posts + * const posts = await prisma.post.findMany() + * + * // Get first 10 Posts + * const posts = await prisma.post.findMany({ take: 10 }) + * + * // Only select the `id` + * const postWithIdOnly = await prisma.post.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Post. + * @param {PostCreateArgs} args - Arguments to create a Post. + * @example + * // Create one Post + * const Post = await prisma.post.create({ + * data: { + * // ... data to create a Post + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Posts. + * @param {PostCreateManyArgs} args - Arguments to create many Posts. + * @example + * // Create many Posts + * const post = await prisma.post.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Posts and returns the data saved in the database. + * @param {PostCreateManyAndReturnArgs} args - Arguments to create many Posts. + * @example + * // Create many Posts + * const post = await prisma.post.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Posts and only return the `id` + * const postWithIdOnly = await prisma.post.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Post. + * @param {PostDeleteArgs} args - Arguments to delete one Post. + * @example + * // Delete one Post + * const Post = await prisma.post.delete({ + * where: { + * // ... filter to delete one Post + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Post. + * @param {PostUpdateArgs} args - Arguments to update one Post. + * @example + * // Update one Post + * const post = await prisma.post.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Posts. + * @param {PostDeleteManyArgs} args - Arguments to filter Posts to delete. + * @example + * // Delete a few Posts + * const { count } = await prisma.post.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Posts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Posts + * const post = await prisma.post.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Posts and returns the data updated in the database. + * @param {PostUpdateManyAndReturnArgs} args - Arguments to update many Posts. + * @example + * // Update many Posts + * const post = await prisma.post.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Posts and only return the `id` + * const postWithIdOnly = await prisma.post.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Post. + * @param {PostUpsertArgs} args - Arguments to update or create a Post. + * @example + * // Update or create a Post + * const post = await prisma.post.upsert({ + * create: { + * // ... data to create a Post + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Post we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Posts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostCountArgs} args - Arguments to filter Posts to count. + * @example + * // Count the number of Posts + * const count = await prisma.post.count({ + * where: { + * // ... the filter for the Posts we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Post. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Post. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostGroupByArgs} 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 PostGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PostGroupByArgs['orderBy'] } + : { orderBy?: PostGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetPostGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Post model + */ +readonly fields: PostFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Post. + * 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 interface Prisma__PostClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + author = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Post model + */ +export interface PostFieldRefs { + readonly id: Prisma.FieldRef<"Post", 'Int'> + readonly title: Prisma.FieldRef<"Post", 'String'> + readonly content: Prisma.FieldRef<"Post", 'String'> + readonly published: Prisma.FieldRef<"Post", 'Boolean'> + readonly authorId: Prisma.FieldRef<"Post", 'Int'> +} + + +// Custom InputTypes +/** + * Post findUnique + */ +export type PostFindUniqueArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post findUniqueOrThrow + */ +export type PostFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post findFirst + */ +export type PostFindFirstArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Posts. + */ + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post findFirstOrThrow + */ +export type PostFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Posts. + */ + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post findMany + */ +export type PostFindManyArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Posts to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post create + */ +export type PostCreateArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The data needed to create a Post. + */ + data: Prisma.XOR +} + +/** + * Post createMany + */ +export type PostCreateManyArgs = { + /** + * The data used to create many Posts. + */ + data: Prisma.PostCreateManyInput | Prisma.PostCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Post createManyAndReturn + */ +export type PostCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * The data used to create many Posts. + */ + data: Prisma.PostCreateManyInput | Prisma.PostCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostIncludeCreateManyAndReturn | null +} + +/** + * Post update + */ +export type PostUpdateArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The data needed to update a Post. + */ + data: Prisma.XOR + /** + * Choose, which Post to update. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post updateMany + */ +export type PostUpdateManyArgs = { + /** + * The data used to update Posts. + */ + data: Prisma.XOR + /** + * Filter which Posts to update + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to update. + */ + limit?: number +} + +/** + * Post updateManyAndReturn + */ +export type PostUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * The data used to update Posts. + */ + data: Prisma.XOR + /** + * Filter which Posts to update + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostIncludeUpdateManyAndReturn | null +} + +/** + * Post upsert + */ +export type PostUpsertArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The filter to search for the Post to update in case it exists. + */ + where: Prisma.PostWhereUniqueInput + /** + * In case the Post found by the `where` argument doesn't exist, create a new Post with this data. + */ + create: Prisma.XOR + /** + * In case the Post was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Post delete + */ +export type PostDeleteArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter which Post to delete. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post deleteMany + */ +export type PostDeleteManyArgs = { + /** + * Filter which Posts to delete + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to delete. + */ + limit?: number +} + +/** + * Post without action + */ +export type PostDefaultArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null +} diff --git a/orm/nextjs/app/generated/prisma/models/User.ts b/orm/nextjs/app/generated/prisma/models/User.ts new file mode 100644 index 000000000000..7286fee160a1 --- /dev/null +++ b/orm/nextjs/app/generated/prisma/models/User.ts @@ -0,0 +1,1312 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `User` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums" +import type * as Prisma from "../internal/prismaNamespace" + +/** + * Model User + * + */ +export type UserModel = runtime.Types.Result.DefaultSelection + +export type AggregateUser = { + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +export type UserAvgAggregateOutputType = { + id: number | null +} + +export type UserSumAggregateOutputType = { + id: number | null +} + +export type UserMinAggregateOutputType = { + id: number | null + email: string | null + name: string | null +} + +export type UserMaxAggregateOutputType = { + id: number | null + email: string | null + name: string | null +} + +export type UserCountAggregateOutputType = { + id: number + email: number + name: number + _all: number +} + + +export type UserAvgAggregateInputType = { + id?: true +} + +export type UserSumAggregateInputType = { + id?: true +} + +export type UserMinAggregateInputType = { + id?: true + email?: true + name?: true +} + +export type UserMaxAggregateInputType = { + id?: true + email?: true + name?: true +} + +export type UserCountAggregateInputType = { + id?: true + email?: true + name?: true + _all?: true +} + +export type UserAggregateArgs = { + /** + * Filter which User to aggregate. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Users + **/ + _count?: true | UserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: UserAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: UserSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserMaxAggregateInputType +} + +export type GetUserAggregateType = { + [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type UserGroupByArgs = { + where?: Prisma.UserWhereInput + orderBy?: Prisma.UserOrderByWithAggregationInput | Prisma.UserOrderByWithAggregationInput[] + by: Prisma.UserScalarFieldEnum[] | Prisma.UserScalarFieldEnum + having?: Prisma.UserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserCountAggregateInputType | true + _avg?: UserAvgAggregateInputType + _sum?: UserSumAggregateInputType + _min?: UserMinAggregateInputType + _max?: UserMaxAggregateInputType +} + +export type UserGroupByOutputType = { + id: number + email: string + name: string | null + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserWhereInput = { + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + id?: Prisma.IntFilter<"User"> | number + email?: Prisma.StringFilter<"User"> | string + name?: Prisma.StringNullableFilter<"User"> | string | null + posts?: Prisma.PostListRelationFilter +} + +export type UserOrderByWithRelationInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + posts?: Prisma.PostOrderByRelationAggregateInput +} + +export type UserWhereUniqueInput = Prisma.AtLeast<{ + id?: number + email?: string + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + name?: Prisma.StringNullableFilter<"User"> | string | null + posts?: Prisma.PostListRelationFilter +}, "id" | "email"> + +export type UserOrderByWithAggregationInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.UserCountOrderByAggregateInput + _avg?: Prisma.UserAvgOrderByAggregateInput + _max?: Prisma.UserMaxOrderByAggregateInput + _min?: Prisma.UserMinOrderByAggregateInput + _sum?: Prisma.UserSumOrderByAggregateInput +} + +export type UserScalarWhereWithAggregatesInput = { + AND?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + OR?: Prisma.UserScalarWhereWithAggregatesInput[] + NOT?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"User"> | number + email?: Prisma.StringWithAggregatesFilter<"User"> | string + name?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null +} + +export type UserCreateInput = { + email: string + name?: string | null + posts?: Prisma.PostCreateNestedManyWithoutAuthorInput +} + +export type UserUncheckedCreateInput = { + id?: number + email: string + name?: string | null + posts?: Prisma.PostUncheckedCreateNestedManyWithoutAuthorInput +} + +export type UserUpdateInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + posts?: Prisma.PostUpdateManyWithoutAuthorNestedInput +} + +export type UserUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + posts?: Prisma.PostUncheckedUpdateManyWithoutAuthorNestedInput +} + +export type UserCreateManyInput = { + id?: number + email: string + name?: string | null +} + +export type UserUpdateManyMutationInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserCountOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserAvgOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type UserMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserMinOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserSumOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type UserScalarRelationFilter = { + is?: Prisma.UserWhereInput + isNot?: Prisma.UserWhereInput +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + +export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number +} + +export type UserCreateNestedOneWithoutPostsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutPostsInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutPostsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutPostsInput + upsert?: Prisma.UserUpsertWithoutPostsInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutPostsInput> +} + +export type UserCreateWithoutPostsInput = { + email: string + name?: string | null +} + +export type UserUncheckedCreateWithoutPostsInput = { + id?: number + email: string + name?: string | null +} + +export type UserCreateOrConnectWithoutPostsInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutPostsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutPostsInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutPostsInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateWithoutPostsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type UserCountOutputType + */ + +export type UserCountOutputType = { + posts: number +} + +export type UserCountOutputTypeSelect = { + posts?: boolean | UserCountOutputTypeCountPostsArgs +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: Prisma.UserCountOutputTypeSelect | null +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountPostsArgs = { + where?: Prisma.PostWhereInput +} + + +export type UserSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean + posts?: boolean | Prisma.User$postsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +}, ExtArgs["result"]["user"]> + +export type UserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectScalar = { + id?: boolean + email?: boolean + name?: boolean +} + +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "email" | "name", ExtArgs["result"]["user"]> +export type UserInclude = { + posts?: boolean | Prisma.User$postsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +} +export type UserIncludeCreateManyAndReturn = {} +export type UserIncludeUpdateManyAndReturn = {} + +export type $UserPayload = { + name: "User" + objects: { + posts: Prisma.$PostPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + email: string + name: string | null + }, ExtArgs["result"]["user"]> + composites: {} +} + +export type UserGetPayload = runtime.Types.Result.GetResult + +export type UserCountArgs = + Omit & { + select?: UserCountAggregateInputType | true + } + +export interface UserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } + /** + * Find zero or one User that matches the filter. + * @param {UserFindUniqueArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one User that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User 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 {UserFindFirstArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {UserFindFirstOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Users 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 {UserFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Users + * const users = await prisma.user.findMany() + * + * // Get first 10 Users + * const users = await prisma.user.findMany({ take: 10 }) + * + * // Only select the `id` + * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a User. + * @param {UserCreateArgs} args - Arguments to create a User. + * @example + * // Create one User + * const User = await prisma.user.create({ + * data: { + * // ... data to create a User + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Users. + * @param {UserCreateManyArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Users and returns the data saved in the database. + * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Users and only return the `id` + * const userWithIdOnly = await prisma.user.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a User. + * @param {UserDeleteArgs} args - Arguments to delete one User. + * @example + * // Delete one User + * const User = await prisma.user.delete({ + * where: { + * // ... filter to delete one User + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one User. + * @param {UserUpdateArgs} args - Arguments to update one User. + * @example + * // Update one User + * const user = await prisma.user.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Users. + * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. + * @example + * // Delete a few Users + * const { count } = await prisma.user.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Users + * const user = await prisma.user.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users and returns the data updated in the database. + * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. + * @example + * // Update many Users + * const user = await prisma.user.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Users and only return the `id` + * const userWithIdOnly = await prisma.user.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one User. + * @param {UserUpsertArgs} args - Arguments to update or create a User. + * @example + * // Update or create a User + * const user = await prisma.user.upsert({ + * create: { + * // ... data to create a User + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the User we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserCountArgs} args - Arguments to filter Users to count. + * @example + * // Count the number of Users + * const count = await prisma.user.count({ + * where: { + * // ... the filter for the Users we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserGroupByArgs} 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 UserGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: UserGroupByArgs['orderBy'] } + : { orderBy?: UserGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the User model + */ +readonly fields: UserFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for User. + * 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 interface Prisma__UserClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + posts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the User model + */ +export interface UserFieldRefs { + readonly id: Prisma.FieldRef<"User", 'Int'> + readonly email: Prisma.FieldRef<"User", 'String'> + readonly name: Prisma.FieldRef<"User", 'String'> +} + + +// Custom InputTypes +/** + * User findUnique + */ +export type UserFindUniqueArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findUniqueOrThrow + */ +export type UserFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findFirst + */ +export type UserFindFirstArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findFirstOrThrow + */ +export type UserFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findMany + */ +export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which Users to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User create + */ +export type UserCreateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to create a User. + */ + data: Prisma.XOR +} + +/** + * User createMany + */ +export type UserCreateManyArgs = { + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User createManyAndReturn + */ +export type UserCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectCreateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User update + */ +export type UserUpdateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to update a User. + */ + data: Prisma.XOR + /** + * Choose, which User to update. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User updateMany + */ +export type UserUpdateManyArgs = { + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User updateManyAndReturn + */ +export type UserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User upsert + */ +export type UserUpsertArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The filter to search for the User to update in case it exists. + */ + where: Prisma.UserWhereUniqueInput + /** + * In case the User found by the `where` argument doesn't exist, create a new User with this data. + */ + create: Prisma.XOR + /** + * In case the User was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * User delete + */ +export type UserDeleteArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter which User to delete. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User deleteMany + */ +export type UserDeleteManyArgs = { + /** + * Filter which Users to delete + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to delete. + */ + limit?: number +} + +/** + * User.posts + */ +export type User$postsArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + where?: Prisma.PostWhereInput + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + cursor?: Prisma.PostWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * User without action + */ +export type UserDefaultArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null +} diff --git a/orm/nextjs/lib/prisma.ts b/orm/nextjs/lib/prisma.ts index 6997feb24a08..0a33f2a778f1 100644 --- a/orm/nextjs/lib/prisma.ts +++ b/orm/nextjs/lib/prisma.ts @@ -1,4 +1,4 @@ -import { PrismaClient } from '@prisma/client' +import { PrismaClient } from '../app/generated/prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' const prisma = new PrismaClient().$extends(withAccelerate()) diff --git a/orm/nextjs/package.json b/orm/nextjs/package.json index 9ced69147285..d4f741ec66ea 100644 --- a/orm/nextjs/package.json +++ b/orm/nextjs/package.json @@ -10,10 +10,11 @@ "postinstall": "prisma generate" }, "dependencies": { - "@prisma/client": "6.9.0", + "@prisma/client": "6.16.3", "next": "15.3.5", "react": "19.1.0", - "react-dom": "19.1.0" + "react-dom": "19.1.0", + "@prisma/extension-accelerate": "2.0.2" }, "devDependencies": { "@eslint/eslintrc": "3.3.1", @@ -23,11 +24,10 @@ "eslint": "9.30.1", "eslint-config-next": "15.3.5", "postcss": "8.5.6", - "prisma": "6.9.0", + "prisma": "6.16.3", "tailwindcss": "3.4.17", "tsx": "4.20.3", - "typescript": "5.8.2", - "@prisma/extension-accelerate": "2.0.2" + "typescript": "5.8.2" }, "prisma": { "seed": "tsx prisma/seed.ts" diff --git a/orm/nextjs/prisma/schema.prisma b/orm/nextjs/prisma/schema.prisma index bf4fc46a5f07..f427e6b15fdf 100644 --- a/orm/nextjs/prisma/schema.prisma +++ b/orm/nextjs/prisma/schema.prisma @@ -4,8 +4,11 @@ // Looking for ways to speed up your queries, or scale easily with your serverless or edge functions? // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init + generator client { - provider = "prisma-client-js" + provider = "prisma-client" + engineType = "client" + output = "../app/generated/prisma" } datasource db { diff --git a/orm/nextjs/prisma/seed.ts b/orm/nextjs/prisma/seed.ts index 25d97f708103..3b182cf6368c 100644 --- a/orm/nextjs/prisma/seed.ts +++ b/orm/nextjs/prisma/seed.ts @@ -1,4 +1,4 @@ -import { PrismaClient, Prisma } from '@prisma/client' +import { PrismaClient, Prisma } from '../app/generated/prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' const prisma = new PrismaClient().$extends(withAccelerate()) From 14a64e9c4cff5dc95630f1f4dcf2fd0af2767841 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Thu, 2 Oct 2025 06:13:25 +0530 Subject: [PATCH 04/13] update nuxt example --- orm/nuxt/README.md | 22 +- orm/nuxt/{ => app}/app.vue | 0 orm/nuxt/{ => app}/components/Header.vue | 0 orm/nuxt/{ => app}/components/Post.vue | 0 orm/nuxt/{ => app}/layouts/default.vue | 0 orm/nuxt/{ => app}/pages/create.vue | 0 orm/nuxt/{ => app}/pages/drafts.vue | 0 orm/nuxt/{ => app}/pages/index.vue | 0 orm/nuxt/{ => app}/pages/p/[id].vue | 0 orm/nuxt/{ => app}/pages/signup.vue | 0 orm/nuxt/eslint.config.mjs | 6 + orm/nuxt/nuxt.config.ts | 11 +- orm/nuxt/package.json | 34 +- orm/nuxt/prisma/db.ts | 2 +- orm/nuxt/prisma/generated/prisma/browser.ts | 28 + orm/nuxt/prisma/generated/prisma/client.ts | 52 + .../generated/prisma/commonInputTypes.ts | 355 ++++ orm/nuxt/prisma/generated/prisma/enums.ts | 14 + .../prisma/generated/prisma/internal/class.ts | 242 +++ .../prisma/internal/prismaNamespace.ts | 865 ++++++++++ .../prisma/internal/prismaNamespaceBrowser.ts | 116 ++ orm/nuxt/prisma/generated/prisma/models.ts | 12 + .../prisma/generated/prisma/models/Post.ts | 1530 +++++++++++++++++ .../prisma/generated/prisma/models/User.ts | 1314 ++++++++++++++ orm/nuxt/prisma/schema.prisma | 4 +- orm/nuxt/prisma/{seed.js => seed.ts} | 4 +- orm/nuxt/tsconfig.json | 23 +- 27 files changed, 4592 insertions(+), 42 deletions(-) rename orm/nuxt/{ => app}/app.vue (100%) rename orm/nuxt/{ => app}/components/Header.vue (100%) rename orm/nuxt/{ => app}/components/Post.vue (100%) rename orm/nuxt/{ => app}/layouts/default.vue (100%) rename orm/nuxt/{ => app}/pages/create.vue (100%) rename orm/nuxt/{ => app}/pages/drafts.vue (100%) rename orm/nuxt/{ => app}/pages/index.vue (100%) rename orm/nuxt/{ => app}/pages/p/[id].vue (100%) rename orm/nuxt/{ => app}/pages/signup.vue (100%) create mode 100644 orm/nuxt/eslint.config.mjs create mode 100644 orm/nuxt/prisma/generated/prisma/browser.ts create mode 100644 orm/nuxt/prisma/generated/prisma/client.ts create mode 100644 orm/nuxt/prisma/generated/prisma/commonInputTypes.ts create mode 100644 orm/nuxt/prisma/generated/prisma/enums.ts create mode 100644 orm/nuxt/prisma/generated/prisma/internal/class.ts create mode 100644 orm/nuxt/prisma/generated/prisma/internal/prismaNamespace.ts create mode 100644 orm/nuxt/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts create mode 100644 orm/nuxt/prisma/generated/prisma/models.ts create mode 100644 orm/nuxt/prisma/generated/prisma/models/Post.ts create mode 100644 orm/nuxt/prisma/generated/prisma/models/User.ts rename orm/nuxt/prisma/{seed.js => seed.ts} (91%) diff --git a/orm/nuxt/README.md b/orm/nuxt/README.md index e51419e46d48..19451de68dae 100644 --- a/orm/nuxt/README.md +++ b/orm/nuxt/README.md @@ -29,7 +29,7 @@ git clone git@github.com:prisma/prisma-examples.git --depth=1 Install npm dependencies: ``` -cd prisma-examples/orm/nuxtjs +cd prisma-examples/orm/nuxt npm install ``` @@ -115,13 +115,19 @@ Now, paste the URL into it as a value for the `DATABASE_URL` environment variabl DATABASE_URL=prisma+postgres://accelerate.prisma-data.net/?api_key=ey... ``` +Generate the Prisma client: + +```terminal +npx prisma generate +``` + Run the following command to create tables in your database. This creates the `User` and `Post` tables that are defined in [`prisma/schema.prisma`](./prisma/schema.prisma): ```terminal npx prisma migrate dev --name init ``` -Execute the seed file in [`prisma/seed.js`](./prisma/seed.js) to populate your database with some sample data, by running: +Execute the seed file in [`prisma/seed.ts`](./prisma/seed.ts) to populate your database with some sample data, by running: ```terminal npx prisma db seed @@ -139,23 +145,23 @@ The app is now running, navigate to [`http://localhost:3000/`](http://localhost:
-**Blog** (located in [`./pages/index.vue`](./pages/index.vue) +**Blog** (located in [`./app/pages/index.vue`](./app/pages/index.vue) ![](https://imgur.com/eepbOUO.png) -**Signup** (located in [`./pages/signup.vue`](./pages/signup.vue)) +**Signup** (located in [`./app/pages/signup.vue`](./app/pages/signup.vue)) ![](https://imgur.com/iE6OaBI.png) -**Create post (draft)** (located in [`./pages/create.vue`](./pages/create.vue)) +**Create post (draft)** (located in [`./app/pages/create.vue`](./app/pages/create.vue)) ![](https://imgur.com/olCWRNv.png) -**Drafts** (located in [`./pages/drafts.vue`](./pages/drafts.vue)) +**Drafts** (located in [`./app/pages/drafts.vue`](./app/pages/drafts.vue)) ![](https://imgur.com/PSMzhcd.png) -**View post** (located in [`./pages/p/_id.vue`](./pages/p/_id.vue)) (delete or publish here) +**View post** (located in [`./app/pages/p/[id].vue`](./app/pages/p/[id].vue)) (delete or publish here) ![](https://imgur.com/zS1B11O.png) @@ -193,7 +199,7 @@ You can also access the REST API of the API server directly. It is running on th ## Switch to another database (e.g. SQLite, MySQL, SQL Server, MongoDB) -If you want to try this example with another database than Postgres, you can adjust the the database connection in [`prisma/schema.prisma`](./prisma/schema.prisma) by reconfiguring the `datasource` block. +If you want to try this example with another database than PostgreSQL, you can adjust the database connection in [`prisma/schema.prisma`](./prisma/schema.prisma) by reconfiguring the `datasource` block. Learn more about the different connection configurations in the [docs](https://www.prisma.io/docs/reference/database-reference/connection-urls). diff --git a/orm/nuxt/app.vue b/orm/nuxt/app/app.vue similarity index 100% rename from orm/nuxt/app.vue rename to orm/nuxt/app/app.vue diff --git a/orm/nuxt/components/Header.vue b/orm/nuxt/app/components/Header.vue similarity index 100% rename from orm/nuxt/components/Header.vue rename to orm/nuxt/app/components/Header.vue diff --git a/orm/nuxt/components/Post.vue b/orm/nuxt/app/components/Post.vue similarity index 100% rename from orm/nuxt/components/Post.vue rename to orm/nuxt/app/components/Post.vue diff --git a/orm/nuxt/layouts/default.vue b/orm/nuxt/app/layouts/default.vue similarity index 100% rename from orm/nuxt/layouts/default.vue rename to orm/nuxt/app/layouts/default.vue diff --git a/orm/nuxt/pages/create.vue b/orm/nuxt/app/pages/create.vue similarity index 100% rename from orm/nuxt/pages/create.vue rename to orm/nuxt/app/pages/create.vue diff --git a/orm/nuxt/pages/drafts.vue b/orm/nuxt/app/pages/drafts.vue similarity index 100% rename from orm/nuxt/pages/drafts.vue rename to orm/nuxt/app/pages/drafts.vue diff --git a/orm/nuxt/pages/index.vue b/orm/nuxt/app/pages/index.vue similarity index 100% rename from orm/nuxt/pages/index.vue rename to orm/nuxt/app/pages/index.vue diff --git a/orm/nuxt/pages/p/[id].vue b/orm/nuxt/app/pages/p/[id].vue similarity index 100% rename from orm/nuxt/pages/p/[id].vue rename to orm/nuxt/app/pages/p/[id].vue diff --git a/orm/nuxt/pages/signup.vue b/orm/nuxt/app/pages/signup.vue similarity index 100% rename from orm/nuxt/pages/signup.vue rename to orm/nuxt/app/pages/signup.vue diff --git a/orm/nuxt/eslint.config.mjs b/orm/nuxt/eslint.config.mjs new file mode 100644 index 000000000000..934c3a1d5666 --- /dev/null +++ b/orm/nuxt/eslint.config.mjs @@ -0,0 +1,6 @@ +// @ts-check +import withNuxt from './.nuxt/eslint.config.mjs' + +export default withNuxt( + // Your custom configs here +) diff --git a/orm/nuxt/nuxt.config.ts b/orm/nuxt/nuxt.config.ts index de3ba72da8a5..0539dbbf8d93 100644 --- a/orm/nuxt/nuxt.config.ts +++ b/orm/nuxt/nuxt.config.ts @@ -1,15 +1,14 @@ -export default defineNuxtConfig ({ - // Disable strict - typescript: { - strict: false - }, +export default defineNuxtConfig({ + compatibilityDate: '2025-07-15', + devtools: { enabled: true }, + modules: ['@nuxt/eslint'], app: { head: { title: 'Nuxt-Prisma Example (TypeScript)', meta: [ { charset: 'utf-8' }, { name: 'viewport', content: 'width=device-width, initial-scale=1' }, - { hid: 'description', name: 'description', content: '' }, + { name: 'description', content: '' }, ], link: [{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }], } diff --git a/orm/nuxt/package.json b/orm/nuxt/package.json index c87384e78af2..7d18eeecec5a 100644 --- a/orm/nuxt/package.json +++ b/orm/nuxt/package.json @@ -3,29 +3,27 @@ "version": "2.0.0", "private": true, "scripts": { - "dev": "nuxt dev", "build": "nuxt build", - "start": "node .output/server/index.mjs", - "generate": "nuxt generate" + "dev": "nuxt dev", + "generate": "nuxt generate", + "preview": "nuxt preview", + "postinstall": "nuxt prepare" }, "dependencies": { - "@prisma/client": "6.9.0", - "@prisma/extension-accelerate": "2.0.2", - "nuxt": "3.17.6" + "@prisma/client": "^6.16.3", + "@prisma/extension-accelerate": "^2.0.2", + "@nuxt/eslint": "1.9.0", + "eslint": "^9.0.0", + "nuxt": "^4.1.2", + "vue": "^3.5.22", + "vue-router": "^4.5.1" }, "devDependencies": { - "@babel/eslint-parser": "7.27.5", - "@nuxtjs/eslint-config": "12.0.0", - "@nuxtjs/eslint-module": "4.1.0", - "@babel/eslint-parser": "7.28.0", - "eslint": "8.57.1", - "eslint-config-prettier": "10.1.8", - "eslint-plugin-nuxt": "4.0.0", - "eslint-plugin-prettier": "5.5.4", - "prettier": "3.6.2", - "prisma": "6.9.0" + "@types/node": "^24.6.1", + "prisma": "^6.16.3", + "tsx": "^4.20.6" }, "prisma": { - "seed": "node prisma/seed.js" + "seed": "tsx prisma/seed.ts" } -} +} \ No newline at end of file diff --git a/orm/nuxt/prisma/db.ts b/orm/nuxt/prisma/db.ts index e23a9934ab8b..2c82fa5126bd 100644 --- a/orm/nuxt/prisma/db.ts +++ b/orm/nuxt/prisma/db.ts @@ -1,5 +1,5 @@ // https://www.prisma.io/docs/guides/database/troubleshooting-orm/help-articles/nextjs-prisma-client-dev-practices -import { PrismaClient } from '@prisma/client' +import { PrismaClient } from '../prisma/generated/prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' const prismaClientSingleton = () => { diff --git a/orm/nuxt/prisma/generated/prisma/browser.ts b/orm/nuxt/prisma/generated/prisma/browser.ts new file mode 100644 index 000000000000..6c7c4f7a8fb5 --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/browser.ts @@ -0,0 +1,28 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma-related types and utilities in a browser. + * Use it to get access to models, enums, and input types. + * + * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only. + * See `client.ts` for the standard, server-side entry point. + * + * 🟢 You can import this file directly. + */ + +import * as Prisma from './internal/prismaNamespaceBrowser.js' +export { Prisma } +export * as $Enums from './enums.js' +export * from './enums.js'; +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Post + * + */ +export type Post = Prisma.PostModel diff --git a/orm/nuxt/prisma/generated/prisma/client.ts b/orm/nuxt/prisma/generated/prisma/client.ts new file mode 100644 index 000000000000..3c19fca40914 --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/client.ts @@ -0,0 +1,52 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types. + * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead. + * + * 🟢 You can import this file directly. + */ + +import * as process from 'node:process' +import * as path from 'node:path' +import { fileURLToPath } from 'node:url' +globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url)) + +import * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums.js" +import * as $Class from "./internal/class.js" +import * as Prisma from "./internal/prismaNamespace.js" + +export * as $Enums from './enums.js' +export * from "./enums.js" +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export const PrismaClient = $Class.getPrismaClientClass(__dirname) +export type PrismaClient = $Class.PrismaClient +export { Prisma } + + + +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Post + * + */ +export type Post = Prisma.PostModel diff --git a/orm/nuxt/prisma/generated/prisma/commonInputTypes.ts b/orm/nuxt/prisma/generated/prisma/commonInputTypes.ts new file mode 100644 index 000000000000..a0847567d21a --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/commonInputTypes.ts @@ -0,0 +1,355 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports various common sort, input & filter types that are not directly linked to a particular model. + * + * 🟢 You can import this file directly. + */ + +import type * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums.js" +import type * as Prisma from "./internal/prismaNamespace.js" + + +export type IntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type StringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type StringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + +export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type DateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type IntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + +export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeFilter<$PrismaModel> +} + +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> + _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedIntNullableFilter<$PrismaModel> + _max?: Prisma.NestedIntNullableFilter<$PrismaModel> +} + +export type NestedIntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type NestedStringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatFilter<$PrismaModel> | number +} + +export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + +export type NestedDateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeWithAggregatesFilter<$PrismaModel> | Date | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedDateTimeFilter<$PrismaModel> + _max?: Prisma.NestedDateTimeFilter<$PrismaModel> +} + +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableWithAggregatesFilter<$PrismaModel> | number | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _avg?: Prisma.NestedFloatNullableFilter<$PrismaModel> + _sum?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedIntNullableFilter<$PrismaModel> + _max?: Prisma.NestedIntNullableFilter<$PrismaModel> +} + +export type NestedFloatNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatNullableFilter<$PrismaModel> | number | null +} + + diff --git a/orm/nuxt/prisma/generated/prisma/enums.ts b/orm/nuxt/prisma/generated/prisma/enums.ts new file mode 100644 index 000000000000..0189a3446d4f --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/enums.ts @@ -0,0 +1,14 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* +* This file exports all enum related types from the schema. +* +* 🟢 You can import this file directly. +*/ + + + +// This file is empty because there are no enums in the schema. +export {} diff --git a/orm/nuxt/prisma/generated/prisma/internal/class.ts b/orm/nuxt/prisma/generated/prisma/internal/class.ts new file mode 100644 index 000000000000..b92f0981869b --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/internal/class.ts @@ -0,0 +1,242 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * Please import the `PrismaClient` class from the `client.ts` file instead. + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "./prismaNamespace.js" + + +const config: runtime.GetPrismaClientConfig = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client" + }, + "output": { + "value": "/home/aman/dev/work/prisma-examples/orm/nuxt/prisma/generated/prisma", + "fromEnvVar": null + }, + "config": { + "engineType": "client" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "debian-openssl-3.0.x", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "/home/aman/dev/work/prisma-examples/orm/nuxt/prisma/schema.prisma", + "isCustomOutput": true + }, + "relativePath": "../..", + "clientVersion": "6.16.3", + "engineVersion": "bb420e667c1820a8c05a38023385f6cc7ef8e83a", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "postinstall": true, + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "generator client {\n provider = \"prisma-client\"\n engineType = \"client\"\n output = \"./generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n posts Post[]\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n createdAt DateTime @default(now())\n updatedAt DateTime @updatedAt\n title String\n content String?\n published Boolean @default(false)\n viewCount Int @default(0)\n author User? @relation(fields: [authorId], references: [id])\n authorId Int?\n}\n", + "inlineSchemaHash": "41266151beee6141190e68a0a5bfed3066b242dff17f0c0e67b73f6e83d44da5", + "copyEngine": true, + "runtimeDataModel": { + "models": {}, + "enums": {}, + "types": {} + }, + "dirname": "" +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"posts\",\"kind\":\"object\",\"type\":\"Post\",\"relationName\":\"PostToUser\"}],\"dbName\":null},\"Post\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"createdAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updatedAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"content\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"published\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"viewCount\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"author\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"PostToUser\"},{\"name\":\"authorId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.engineWasm = undefined + +async function decodeBase64AsWasm(wasmBase64: string): Promise { + const { Buffer } = await import('node:buffer') + const wasmArray = Buffer.from(wasmBase64, 'base64') + return new WebAssembly.Module(wasmArray) +} + +config.compilerWasm = { + getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"), + + getQueryCompilerWasmModule: async () => { + const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.postgresql.wasm-base64.mjs") + return await decodeBase64AsWasm(wasm) + } +} + + + + +export type LogOptions = + 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never + +export interface PrismaClientConstructor { + /** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + + new < + Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + LogOpts extends LogOptions = LogOptions, + OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'], + ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs + >(options?: Prisma.Subset ): PrismaClient +} + +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + +export interface PrismaClient< + in LogOpts extends Prisma.LogLevel = never, + in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'], + in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs +> { + [K: symbol]: { types: Prisma.TypeMap['other'] } + + $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient; + + /** + * Connect with the database + */ + $connect(): runtime.Types.Utils.JsPromise; + + /** + * Disconnect from the database + */ + $disconnect(): runtime.Types.Utils.JsPromise; + +/** + * 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 }): runtime.Types.Utils.JsPromise> + + $transaction(fn: (prisma: Omit) => runtime.Types.Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise + + + $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs, runtime.Types.Utils.Call, { + extArgs: ExtArgs + }>> + + /** + * `prisma.user`: Exposes CRUD operations for the **User** model. + * Example usage: + * ```ts + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + */ + get user(): Prisma.UserDelegate; + + /** + * `prisma.post`: Exposes CRUD operations for the **Post** model. + * Example usage: + * ```ts + * // Fetch zero or more Posts + * const posts = await prisma.post.findMany() + * ``` + */ + get post(): Prisma.PostDelegate; +} + +export function getPrismaClientClass(dirname: string): PrismaClientConstructor { + config.dirname = dirname + return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor +} diff --git a/orm/nuxt/prisma/generated/prisma/internal/prismaNamespace.ts b/orm/nuxt/prisma/generated/prisma/internal/prismaNamespace.ts new file mode 100644 index 000000000000..58a54f383549 --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/internal/prismaNamespace.ts @@ -0,0 +1,865 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the client.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "../models.js" +import { type PrismaClient } from "./class.js" + +export type * from '../models.js' + +export type DMMF = typeof runtime.DMMF + +export type PrismaPromise = runtime.Types.Public.PrismaPromise + +/** + * Prisma Errors + */ + +export const PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError +export type PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + +export const PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError +export type PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + +export const PrismaClientRustPanicError = runtime.PrismaClientRustPanicError +export type PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + +export const PrismaClientInitializationError = runtime.PrismaClientInitializationError +export type PrismaClientInitializationError = runtime.PrismaClientInitializationError + +export const PrismaClientValidationError = runtime.PrismaClientValidationError +export type PrismaClientValidationError = runtime.PrismaClientValidationError + +/** + * Re-export of sql-template-tag + */ +export const sql = runtime.sqltag +export const empty = runtime.empty +export const join = runtime.join +export const raw = runtime.raw +export const Sql = runtime.Sql +export type Sql = runtime.Sql + + + +/** + * Decimal.js + */ +export const Decimal = runtime.Decimal +export type 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 + +/** +* Extensions +*/ +export type Extension = runtime.Types.Extensions.UserArgs +export const getExtensionContext = runtime.Extensions.getExtensionContext +export type Args = runtime.Types.Public.Args +export type Payload = runtime.Types.Public.Payload +export type Result = runtime.Types.Public.Result +export type Exact = runtime.Types.Public.Exact + +export type PrismaVersion = { + client: string + engine: string +} + +/** + * Prisma Client JS version: 6.16.3 + * Query Engine version: bb420e667c1820a8c05a38023385f6cc7ef8e83a + */ +export const prismaVersion: PrismaVersion = { + client: "6.16.3", + engine: "bb420e667c1820a8c05a38023385f6cc7ef8e83a" +} + +/** + * Utility Types + */ + +export type JsonObject = runtime.JsonObject +export type JsonArray = runtime.JsonArray +export type JsonValue = runtime.JsonValue +export type InputJsonObject = runtime.InputJsonObject +export type InputJsonArray = runtime.InputJsonArray +export type InputJsonValue = runtime.InputJsonValue + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +type SelectAndInclude = { + select: any + include: any +} + +type SelectAndOmit = { + select: any + omit: any +} + +/** + * 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; + +/** + * 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`.' + : T extends SelectAndOmit + ? 'Please either choose `select` or `omit`.' + : {}) + +/** + * 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 + */ +export 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] + +export type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 +> = O extends unknown ? _Either : never + +export type Union = any + +export 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 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 +export 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 ? P : 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>>; + +export type Boolean = True | False + +export type True = 1 + +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 + +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 + +export 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 +export type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + +/** + * Like `Pick`, but additionally can also accept an array of keys + */ +export type PickEnumerable | keyof T> = Prisma__Pick> + +/** + * Exclude all keys with underscores + */ +export type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + +export type FieldRef = runtime.FieldRef + +type FieldRefInputType = Model extends never ? never : FieldRef + + +export const ModelName = { + User: 'User', + Post: 'Post' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + +export interface TypeMapCb extends runtime.Types.Utils.Fn<{extArgs: runtime.Types.Extensions.InternalArgs }, runtime.Types.Utils.Record> { + returns: TypeMap +} + +export type TypeMap = { + globalOmitOptions: { + omit: GlobalOmitOptions + } + meta: { + modelProps: "user" | "post" + txIsolationLevel: TransactionIsolationLevel + } + model: { + User: { + payload: Prisma.$UserPayload + fields: Prisma.UserFieldRefs + operations: { + findUnique: { + args: Prisma.UserFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.UserFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.UserCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.UserCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UserCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.UserDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.UserUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.UserUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.UserUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.UserGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.UserCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Post: { + payload: Prisma.$PostPayload + fields: Prisma.PostFieldRefs + operations: { + findUnique: { + args: Prisma.PostFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PostFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PostFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PostFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PostFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PostCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PostCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PostCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.PostDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PostUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PostDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PostUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.PostUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.PostUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PostAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PostGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PostCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + } +} & { + other: { + payload: any + operations: { + $executeRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + } + } +} + +/** + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + email: 'email', + name: 'name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const PostScalarFieldEnum = { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + title: 'title', + content: 'content', + published: 'published', + viewCount: 'viewCount', + authorId: 'authorId' +} as const + +export type PostScalarFieldEnum = (typeof PostScalarFieldEnum)[keyof typeof PostScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + + +/** + * Field references + */ + + +/** + * Reference to a field of type 'Int' + */ +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + +/** + * Reference to a field of type 'Int[]' + */ +export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + + + +/** + * Reference to a field of type 'String' + */ +export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> + + + +/** + * Reference to a field of type 'String[]' + */ +export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> + + + +/** + * Reference to a field of type 'DateTime' + */ +export type DateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime'> + + + +/** + * Reference to a field of type 'DateTime[]' + */ +export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'DateTime[]'> + + + +/** + * Reference to a field of type 'Boolean' + */ +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + +/** + * Reference to a field of type 'Float' + */ +export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> + + + +/** + * Reference to a field of type 'Float[]' + */ +export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> + + +/** + * Batch Payload for updateMany & deleteMany & createMany + */ +export type BatchPayload = { + count: number +} + + +export type Datasource = { + url?: string +} +export type Datasources = { + db?: Datasource +} + +export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs> +export type DefaultPrismaClient = PrismaClient +export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' +export interface PrismaClientOptions { + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasourceUrl?: string + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + /** + * @example + * ``` + * // Shorthand for `emit: 'stdout'` + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events only + * log: [ + * { emit: 'event', level: 'query' }, + * { emit: 'event', level: 'info' }, + * { emit: 'event', level: 'warn' } + * { emit: 'event', level: 'error' } + * ] + * + * / Emit as events and log to stdout + * og: [ + * { 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?: (LogLevel | LogDefinition)[] + /** + * The default values for transactionOptions + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: { + maxWait?: number + timeout?: number + isolationLevel?: TransactionIsolationLevel + } + /** + * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale` + */ + adapter?: runtime.SqlDriverAdapterFactory | null + /** + * Global configuration for omitting model fields by default. + * + * @example + * ``` + * const prisma = new PrismaClient({ + * omit: { + * user: { + * password: true + * } + * } + * }) + * ``` + */ + omit?: GlobalOmitConfig +} +export type GlobalOmitConfig = { + user?: Prisma.UserOmit + post?: Prisma.PostOmit +} + +/* Types for Logging */ +export type LogLevel = 'info' | 'query' | 'warn' | 'error' +export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' +} + +export type CheckIsLogLevel = T extends LogLevel ? T : never; + +export type GetLogType = CheckIsLogLevel< + T extends LogDefinition ? T['level'] : T +>; + +export type GetEvents = T extends Array + ? 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' + | 'findUniqueOrThrow' + | 'findMany' + | 'findFirst' + | 'findFirstOrThrow' + | 'create' + | 'createMany' + | 'createManyAndReturn' + | 'update' + | 'updateMany' + | 'updateManyAndReturn' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + | 'groupBy' + +/** + * `PrismaClient` proxy available in interactive transactions. + */ +export type TransactionClient = Omit + diff --git a/orm/nuxt/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts b/orm/nuxt/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts new file mode 100644 index 000000000000..1be5d32dc754 --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -0,0 +1,116 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/index-browser" + +export type * from '../models.js' +export type * from './prismaNamespace.js' + +export const Decimal = runtime.Decimal + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +export const ModelName = { + User: 'User', + Post: 'Post' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + +/* + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + email: 'email', + name: 'name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const PostScalarFieldEnum = { + id: 'id', + createdAt: 'createdAt', + updatedAt: 'updatedAt', + title: 'title', + content: 'content', + published: 'published', + viewCount: 'viewCount', + authorId: 'authorId' +} as const + +export type PostScalarFieldEnum = (typeof PostScalarFieldEnum)[keyof typeof PostScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + diff --git a/orm/nuxt/prisma/generated/prisma/models.ts b/orm/nuxt/prisma/generated/prisma/models.ts new file mode 100644 index 000000000000..4cb0b9b1a8cb --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/models.ts @@ -0,0 +1,12 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This is a barrel export file for all models and their related types. + * + * 🟢 You can import this file directly. + */ +export type * from './models/User.js' +export type * from './models/Post.js' +export type * from './commonInputTypes.js' \ No newline at end of file diff --git a/orm/nuxt/prisma/generated/prisma/models/Post.ts b/orm/nuxt/prisma/generated/prisma/models/Post.ts new file mode 100644 index 000000000000..fbffbd7b356a --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/models/Post.ts @@ -0,0 +1,1530 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `Post` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Post + * + */ +export type PostModel = runtime.Types.Result.DefaultSelection + +export type AggregatePost = { + _count: PostCountAggregateOutputType | null + _avg: PostAvgAggregateOutputType | null + _sum: PostSumAggregateOutputType | null + _min: PostMinAggregateOutputType | null + _max: PostMaxAggregateOutputType | null +} + +export type PostAvgAggregateOutputType = { + id: number | null + viewCount: number | null + authorId: number | null +} + +export type PostSumAggregateOutputType = { + id: number | null + viewCount: number | null + authorId: number | null +} + +export type PostMinAggregateOutputType = { + id: number | null + createdAt: Date | null + updatedAt: Date | null + title: string | null + content: string | null + published: boolean | null + viewCount: number | null + authorId: number | null +} + +export type PostMaxAggregateOutputType = { + id: number | null + createdAt: Date | null + updatedAt: Date | null + title: string | null + content: string | null + published: boolean | null + viewCount: number | null + authorId: number | null +} + +export type PostCountAggregateOutputType = { + id: number + createdAt: number + updatedAt: number + title: number + content: number + published: number + viewCount: number + authorId: number + _all: number +} + + +export type PostAvgAggregateInputType = { + id?: true + viewCount?: true + authorId?: true +} + +export type PostSumAggregateInputType = { + id?: true + viewCount?: true + authorId?: true +} + +export type PostMinAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + title?: true + content?: true + published?: true + viewCount?: true + authorId?: true +} + +export type PostMaxAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + title?: true + content?: true + published?: true + viewCount?: true + authorId?: true +} + +export type PostCountAggregateInputType = { + id?: true + createdAt?: true + updatedAt?: true + title?: true + content?: true + published?: true + viewCount?: true + authorId?: true + _all?: true +} + +export type PostAggregateArgs = { + /** + * Filter which Post to aggregate. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Posts + **/ + _count?: true | PostCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PostAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PostSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PostMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PostMaxAggregateInputType +} + +export type GetPostAggregateType = { + [P in keyof T & keyof AggregatePost]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PostGroupByArgs = { + where?: Prisma.PostWhereInput + orderBy?: Prisma.PostOrderByWithAggregationInput | Prisma.PostOrderByWithAggregationInput[] + by: Prisma.PostScalarFieldEnum[] | Prisma.PostScalarFieldEnum + having?: Prisma.PostScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PostCountAggregateInputType | true + _avg?: PostAvgAggregateInputType + _sum?: PostSumAggregateInputType + _min?: PostMinAggregateInputType + _max?: PostMaxAggregateInputType +} + +export type PostGroupByOutputType = { + id: number + createdAt: Date + updatedAt: Date + title: string + content: string | null + published: boolean + viewCount: number + authorId: number | null + _count: PostCountAggregateOutputType | null + _avg: PostAvgAggregateOutputType | null + _sum: PostSumAggregateOutputType | null + _min: PostMinAggregateOutputType | null + _max: PostMaxAggregateOutputType | null +} + +type GetPostGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PostGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PostWhereInput = { + AND?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + OR?: Prisma.PostWhereInput[] + NOT?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + id?: Prisma.IntFilter<"Post"> | number + createdAt?: Prisma.DateTimeFilter<"Post"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Post"> | Date | string + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + viewCount?: Prisma.IntFilter<"Post"> | number + authorId?: Prisma.IntNullableFilter<"Post"> | number | null + author?: Prisma.XOR | null +} + +export type PostOrderByWithRelationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrderInput | Prisma.SortOrder + published?: Prisma.SortOrder + viewCount?: Prisma.SortOrder + authorId?: Prisma.SortOrderInput | Prisma.SortOrder + author?: Prisma.UserOrderByWithRelationInput +} + +export type PostWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + OR?: Prisma.PostWhereInput[] + NOT?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + createdAt?: Prisma.DateTimeFilter<"Post"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Post"> | Date | string + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + viewCount?: Prisma.IntFilter<"Post"> | number + authorId?: Prisma.IntNullableFilter<"Post"> | number | null + author?: Prisma.XOR | null +}, "id"> + +export type PostOrderByWithAggregationInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrderInput | Prisma.SortOrder + published?: Prisma.SortOrder + viewCount?: Prisma.SortOrder + authorId?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.PostCountOrderByAggregateInput + _avg?: Prisma.PostAvgOrderByAggregateInput + _max?: Prisma.PostMaxOrderByAggregateInput + _min?: Prisma.PostMinOrderByAggregateInput + _sum?: Prisma.PostSumOrderByAggregateInput +} + +export type PostScalarWhereWithAggregatesInput = { + AND?: Prisma.PostScalarWhereWithAggregatesInput | Prisma.PostScalarWhereWithAggregatesInput[] + OR?: Prisma.PostScalarWhereWithAggregatesInput[] + NOT?: Prisma.PostScalarWhereWithAggregatesInput | Prisma.PostScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"Post"> | number + createdAt?: Prisma.DateTimeWithAggregatesFilter<"Post"> | Date | string + updatedAt?: Prisma.DateTimeWithAggregatesFilter<"Post"> | Date | string + title?: Prisma.StringWithAggregatesFilter<"Post"> | string + content?: Prisma.StringNullableWithAggregatesFilter<"Post"> | string | null + published?: Prisma.BoolWithAggregatesFilter<"Post"> | boolean + viewCount?: Prisma.IntWithAggregatesFilter<"Post"> | number + authorId?: Prisma.IntNullableWithAggregatesFilter<"Post"> | number | null +} + +export type PostCreateInput = { + createdAt?: Date | string + updatedAt?: Date | string + title: string + content?: string | null + published?: boolean + viewCount?: number + author?: Prisma.UserCreateNestedOneWithoutPostsInput +} + +export type PostUncheckedCreateInput = { + id?: number + createdAt?: Date | string + updatedAt?: Date | string + title: string + content?: string | null + published?: boolean + viewCount?: number + authorId?: number | null +} + +export type PostUpdateInput = { + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + viewCount?: Prisma.IntFieldUpdateOperationsInput | number + author?: Prisma.UserUpdateOneWithoutPostsNestedInput +} + +export type PostUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + viewCount?: Prisma.IntFieldUpdateOperationsInput | number + authorId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null +} + +export type PostCreateManyInput = { + id?: number + createdAt?: Date | string + updatedAt?: Date | string + title: string + content?: string | null + published?: boolean + viewCount?: number + authorId?: number | null +} + +export type PostUpdateManyMutationInput = { + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + viewCount?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + viewCount?: Prisma.IntFieldUpdateOperationsInput | number + authorId?: Prisma.NullableIntFieldUpdateOperationsInput | number | null +} + +export type PostListRelationFilter = { + every?: Prisma.PostWhereInput + some?: Prisma.PostWhereInput + none?: Prisma.PostWhereInput +} + +export type PostOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type PostCountOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + viewCount?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + viewCount?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + viewCount?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostMinOrderByAggregateInput = { + id?: Prisma.SortOrder + createdAt?: Prisma.SortOrder + updatedAt?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + viewCount?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostSumOrderByAggregateInput = { + id?: Prisma.SortOrder + viewCount?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostCreateNestedManyWithoutAuthorInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] +} + +export type PostUncheckedCreateNestedManyWithoutAuthorInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] +} + +export type PostUpdateManyWithoutAuthorNestedInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + upsert?: Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput | Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + set?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + disconnect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + delete?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + update?: Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput | Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput[] + updateMany?: Prisma.PostUpdateManyWithWhereWithoutAuthorInput | Prisma.PostUpdateManyWithWhereWithoutAuthorInput[] + deleteMany?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] +} + +export type PostUncheckedUpdateManyWithoutAuthorNestedInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + upsert?: Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput | Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + set?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + disconnect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + delete?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + update?: Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput | Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput[] + updateMany?: Prisma.PostUpdateManyWithWhereWithoutAuthorInput | Prisma.PostUpdateManyWithWhereWithoutAuthorInput[] + deleteMany?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] +} + +export type DateTimeFieldUpdateOperationsInput = { + set?: Date | string +} + +export type BoolFieldUpdateOperationsInput = { + set?: boolean +} + +export type NullableIntFieldUpdateOperationsInput = { + set?: number | null + increment?: number + decrement?: number + multiply?: number + divide?: number +} + +export type PostCreateWithoutAuthorInput = { + createdAt?: Date | string + updatedAt?: Date | string + title: string + content?: string | null + published?: boolean + viewCount?: number +} + +export type PostUncheckedCreateWithoutAuthorInput = { + id?: number + createdAt?: Date | string + updatedAt?: Date | string + title: string + content?: string | null + published?: boolean + viewCount?: number +} + +export type PostCreateOrConnectWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + create: Prisma.XOR +} + +export type PostCreateManyAuthorInputEnvelope = { + data: Prisma.PostCreateManyAuthorInput | Prisma.PostCreateManyAuthorInput[] + skipDuplicates?: boolean +} + +export type PostUpsertWithWhereUniqueWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PostUpdateWithWhereUniqueWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + data: Prisma.XOR +} + +export type PostUpdateManyWithWhereWithoutAuthorInput = { + where: Prisma.PostScalarWhereInput + data: Prisma.XOR +} + +export type PostScalarWhereInput = { + AND?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] + OR?: Prisma.PostScalarWhereInput[] + NOT?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] + id?: Prisma.IntFilter<"Post"> | number + createdAt?: Prisma.DateTimeFilter<"Post"> | Date | string + updatedAt?: Prisma.DateTimeFilter<"Post"> | Date | string + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + viewCount?: Prisma.IntFilter<"Post"> | number + authorId?: Prisma.IntNullableFilter<"Post"> | number | null +} + +export type PostCreateManyAuthorInput = { + id?: number + createdAt?: Date | string + updatedAt?: Date | string + title: string + content?: string | null + published?: boolean + viewCount?: number +} + +export type PostUpdateWithoutAuthorInput = { + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + viewCount?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostUncheckedUpdateWithoutAuthorInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + viewCount?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostUncheckedUpdateManyWithoutAuthorInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + createdAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + updatedAt?: Prisma.DateTimeFieldUpdateOperationsInput | Date | string + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + viewCount?: Prisma.IntFieldUpdateOperationsInput | number +} + + + +export type PostSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + title?: boolean + content?: boolean + published?: boolean + viewCount?: boolean + authorId?: boolean + author?: boolean | Prisma.Post$authorArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + title?: boolean + content?: boolean + published?: boolean + viewCount?: boolean + authorId?: boolean + author?: boolean | Prisma.Post$authorArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + createdAt?: boolean + updatedAt?: boolean + title?: boolean + content?: boolean + published?: boolean + viewCount?: boolean + authorId?: boolean + author?: boolean | Prisma.Post$authorArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectScalar = { + id?: boolean + createdAt?: boolean + updatedAt?: boolean + title?: boolean + content?: boolean + published?: boolean + viewCount?: boolean + authorId?: boolean +} + +export type PostOmit = runtime.Types.Extensions.GetOmit<"id" | "createdAt" | "updatedAt" | "title" | "content" | "published" | "viewCount" | "authorId", ExtArgs["result"]["post"]> +export type PostInclude = { + author?: boolean | Prisma.Post$authorArgs +} +export type PostIncludeCreateManyAndReturn = { + author?: boolean | Prisma.Post$authorArgs +} +export type PostIncludeUpdateManyAndReturn = { + author?: boolean | Prisma.Post$authorArgs +} + +export type $PostPayload = { + name: "Post" + objects: { + author: Prisma.$UserPayload | null + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + createdAt: Date + updatedAt: Date + title: string + content: string | null + published: boolean + viewCount: number + authorId: number | null + }, ExtArgs["result"]["post"]> + composites: {} +} + +export type PostGetPayload = runtime.Types.Result.GetResult + +export type PostCountArgs = + Omit & { + select?: PostCountAggregateInputType | true + } + +export interface PostDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Post'], meta: { name: 'Post' } } + /** + * Find zero or one Post that matches the filter. + * @param {PostFindUniqueArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Post that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PostFindUniqueOrThrowArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Post 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 {PostFindFirstArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Post that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {PostFindFirstOrThrowArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Posts 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 {PostFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Posts + * const posts = await prisma.post.findMany() + * + * // Get first 10 Posts + * const posts = await prisma.post.findMany({ take: 10 }) + * + * // Only select the `id` + * const postWithIdOnly = await prisma.post.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Post. + * @param {PostCreateArgs} args - Arguments to create a Post. + * @example + * // Create one Post + * const Post = await prisma.post.create({ + * data: { + * // ... data to create a Post + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Posts. + * @param {PostCreateManyArgs} args - Arguments to create many Posts. + * @example + * // Create many Posts + * const post = await prisma.post.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Posts and returns the data saved in the database. + * @param {PostCreateManyAndReturnArgs} args - Arguments to create many Posts. + * @example + * // Create many Posts + * const post = await prisma.post.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Posts and only return the `id` + * const postWithIdOnly = await prisma.post.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Post. + * @param {PostDeleteArgs} args - Arguments to delete one Post. + * @example + * // Delete one Post + * const Post = await prisma.post.delete({ + * where: { + * // ... filter to delete one Post + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Post. + * @param {PostUpdateArgs} args - Arguments to update one Post. + * @example + * // Update one Post + * const post = await prisma.post.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Posts. + * @param {PostDeleteManyArgs} args - Arguments to filter Posts to delete. + * @example + * // Delete a few Posts + * const { count } = await prisma.post.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Posts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Posts + * const post = await prisma.post.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Posts and returns the data updated in the database. + * @param {PostUpdateManyAndReturnArgs} args - Arguments to update many Posts. + * @example + * // Update many Posts + * const post = await prisma.post.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Posts and only return the `id` + * const postWithIdOnly = await prisma.post.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Post. + * @param {PostUpsertArgs} args - Arguments to update or create a Post. + * @example + * // Update or create a Post + * const post = await prisma.post.upsert({ + * create: { + * // ... data to create a Post + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Post we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Posts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostCountArgs} args - Arguments to filter Posts to count. + * @example + * // Count the number of Posts + * const count = await prisma.post.count({ + * where: { + * // ... the filter for the Posts we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Post. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Post. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostGroupByArgs} 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 PostGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PostGroupByArgs['orderBy'] } + : { orderBy?: PostGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetPostGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Post model + */ +readonly fields: PostFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Post. + * 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 interface Prisma__PostClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + author = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Post model + */ +export interface PostFieldRefs { + readonly id: Prisma.FieldRef<"Post", 'Int'> + readonly createdAt: Prisma.FieldRef<"Post", 'DateTime'> + readonly updatedAt: Prisma.FieldRef<"Post", 'DateTime'> + readonly title: Prisma.FieldRef<"Post", 'String'> + readonly content: Prisma.FieldRef<"Post", 'String'> + readonly published: Prisma.FieldRef<"Post", 'Boolean'> + readonly viewCount: Prisma.FieldRef<"Post", 'Int'> + readonly authorId: Prisma.FieldRef<"Post", 'Int'> +} + + +// Custom InputTypes +/** + * Post findUnique + */ +export type PostFindUniqueArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post findUniqueOrThrow + */ +export type PostFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post findFirst + */ +export type PostFindFirstArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Posts. + */ + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post findFirstOrThrow + */ +export type PostFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Posts. + */ + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post findMany + */ +export type PostFindManyArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Posts to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post create + */ +export type PostCreateArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The data needed to create a Post. + */ + data: Prisma.XOR +} + +/** + * Post createMany + */ +export type PostCreateManyArgs = { + /** + * The data used to create many Posts. + */ + data: Prisma.PostCreateManyInput | Prisma.PostCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Post createManyAndReturn + */ +export type PostCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * The data used to create many Posts. + */ + data: Prisma.PostCreateManyInput | Prisma.PostCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostIncludeCreateManyAndReturn | null +} + +/** + * Post update + */ +export type PostUpdateArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The data needed to update a Post. + */ + data: Prisma.XOR + /** + * Choose, which Post to update. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post updateMany + */ +export type PostUpdateManyArgs = { + /** + * The data used to update Posts. + */ + data: Prisma.XOR + /** + * Filter which Posts to update + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to update. + */ + limit?: number +} + +/** + * Post updateManyAndReturn + */ +export type PostUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * The data used to update Posts. + */ + data: Prisma.XOR + /** + * Filter which Posts to update + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostIncludeUpdateManyAndReturn | null +} + +/** + * Post upsert + */ +export type PostUpsertArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The filter to search for the Post to update in case it exists. + */ + where: Prisma.PostWhereUniqueInput + /** + * In case the Post found by the `where` argument doesn't exist, create a new Post with this data. + */ + create: Prisma.XOR + /** + * In case the Post was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Post delete + */ +export type PostDeleteArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter which Post to delete. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post deleteMany + */ +export type PostDeleteManyArgs = { + /** + * Filter which Posts to delete + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to delete. + */ + limit?: number +} + +/** + * Post.author + */ +export type Post$authorArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + where?: Prisma.UserWhereInput +} + +/** + * Post without action + */ +export type PostDefaultArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null +} diff --git a/orm/nuxt/prisma/generated/prisma/models/User.ts b/orm/nuxt/prisma/generated/prisma/models/User.ts new file mode 100644 index 000000000000..0fa4cd3e04b3 --- /dev/null +++ b/orm/nuxt/prisma/generated/prisma/models/User.ts @@ -0,0 +1,1314 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `User` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model User + * + */ +export type UserModel = runtime.Types.Result.DefaultSelection + +export type AggregateUser = { + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +export type UserAvgAggregateOutputType = { + id: number | null +} + +export type UserSumAggregateOutputType = { + id: number | null +} + +export type UserMinAggregateOutputType = { + id: number | null + email: string | null + name: string | null +} + +export type UserMaxAggregateOutputType = { + id: number | null + email: string | null + name: string | null +} + +export type UserCountAggregateOutputType = { + id: number + email: number + name: number + _all: number +} + + +export type UserAvgAggregateInputType = { + id?: true +} + +export type UserSumAggregateInputType = { + id?: true +} + +export type UserMinAggregateInputType = { + id?: true + email?: true + name?: true +} + +export type UserMaxAggregateInputType = { + id?: true + email?: true + name?: true +} + +export type UserCountAggregateInputType = { + id?: true + email?: true + name?: true + _all?: true +} + +export type UserAggregateArgs = { + /** + * Filter which User to aggregate. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Users + **/ + _count?: true | UserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: UserAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: UserSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserMaxAggregateInputType +} + +export type GetUserAggregateType = { + [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type UserGroupByArgs = { + where?: Prisma.UserWhereInput + orderBy?: Prisma.UserOrderByWithAggregationInput | Prisma.UserOrderByWithAggregationInput[] + by: Prisma.UserScalarFieldEnum[] | Prisma.UserScalarFieldEnum + having?: Prisma.UserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserCountAggregateInputType | true + _avg?: UserAvgAggregateInputType + _sum?: UserSumAggregateInputType + _min?: UserMinAggregateInputType + _max?: UserMaxAggregateInputType +} + +export type UserGroupByOutputType = { + id: number + email: string + name: string | null + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserWhereInput = { + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + id?: Prisma.IntFilter<"User"> | number + email?: Prisma.StringFilter<"User"> | string + name?: Prisma.StringNullableFilter<"User"> | string | null + posts?: Prisma.PostListRelationFilter +} + +export type UserOrderByWithRelationInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + posts?: Prisma.PostOrderByRelationAggregateInput +} + +export type UserWhereUniqueInput = Prisma.AtLeast<{ + id?: number + email?: string + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + name?: Prisma.StringNullableFilter<"User"> | string | null + posts?: Prisma.PostListRelationFilter +}, "id" | "email"> + +export type UserOrderByWithAggregationInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.UserCountOrderByAggregateInput + _avg?: Prisma.UserAvgOrderByAggregateInput + _max?: Prisma.UserMaxOrderByAggregateInput + _min?: Prisma.UserMinOrderByAggregateInput + _sum?: Prisma.UserSumOrderByAggregateInput +} + +export type UserScalarWhereWithAggregatesInput = { + AND?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + OR?: Prisma.UserScalarWhereWithAggregatesInput[] + NOT?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"User"> | number + email?: Prisma.StringWithAggregatesFilter<"User"> | string + name?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null +} + +export type UserCreateInput = { + email: string + name?: string | null + posts?: Prisma.PostCreateNestedManyWithoutAuthorInput +} + +export type UserUncheckedCreateInput = { + id?: number + email: string + name?: string | null + posts?: Prisma.PostUncheckedCreateNestedManyWithoutAuthorInput +} + +export type UserUpdateInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + posts?: Prisma.PostUpdateManyWithoutAuthorNestedInput +} + +export type UserUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + posts?: Prisma.PostUncheckedUpdateManyWithoutAuthorNestedInput +} + +export type UserCreateManyInput = { + id?: number + email: string + name?: string | null +} + +export type UserUpdateManyMutationInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserCountOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserAvgOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type UserMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserMinOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserSumOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type UserNullableScalarRelationFilter = { + is?: Prisma.UserWhereInput | null + isNot?: Prisma.UserWhereInput | null +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + +export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number +} + +export type UserCreateNestedOneWithoutPostsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutPostsInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneWithoutPostsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutPostsInput + upsert?: Prisma.UserUpsertWithoutPostsInput + disconnect?: Prisma.UserWhereInput | boolean + delete?: Prisma.UserWhereInput | boolean + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutPostsInput> +} + +export type UserCreateWithoutPostsInput = { + email: string + name?: string | null +} + +export type UserUncheckedCreateWithoutPostsInput = { + id?: number + email: string + name?: string | null +} + +export type UserCreateOrConnectWithoutPostsInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutPostsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutPostsInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutPostsInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateWithoutPostsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type UserCountOutputType + */ + +export type UserCountOutputType = { + posts: number +} + +export type UserCountOutputTypeSelect = { + posts?: boolean | UserCountOutputTypeCountPostsArgs +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: Prisma.UserCountOutputTypeSelect | null +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountPostsArgs = { + where?: Prisma.PostWhereInput +} + + +export type UserSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean + posts?: boolean | Prisma.User$postsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +}, ExtArgs["result"]["user"]> + +export type UserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectScalar = { + id?: boolean + email?: boolean + name?: boolean +} + +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "email" | "name", ExtArgs["result"]["user"]> +export type UserInclude = { + posts?: boolean | Prisma.User$postsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +} +export type UserIncludeCreateManyAndReturn = {} +export type UserIncludeUpdateManyAndReturn = {} + +export type $UserPayload = { + name: "User" + objects: { + posts: Prisma.$PostPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + email: string + name: string | null + }, ExtArgs["result"]["user"]> + composites: {} +} + +export type UserGetPayload = runtime.Types.Result.GetResult + +export type UserCountArgs = + Omit & { + select?: UserCountAggregateInputType | true + } + +export interface UserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } + /** + * Find zero or one User that matches the filter. + * @param {UserFindUniqueArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one User that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User 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 {UserFindFirstArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {UserFindFirstOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Users 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 {UserFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Users + * const users = await prisma.user.findMany() + * + * // Get first 10 Users + * const users = await prisma.user.findMany({ take: 10 }) + * + * // Only select the `id` + * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a User. + * @param {UserCreateArgs} args - Arguments to create a User. + * @example + * // Create one User + * const User = await prisma.user.create({ + * data: { + * // ... data to create a User + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Users. + * @param {UserCreateManyArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Users and returns the data saved in the database. + * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Users and only return the `id` + * const userWithIdOnly = await prisma.user.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a User. + * @param {UserDeleteArgs} args - Arguments to delete one User. + * @example + * // Delete one User + * const User = await prisma.user.delete({ + * where: { + * // ... filter to delete one User + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one User. + * @param {UserUpdateArgs} args - Arguments to update one User. + * @example + * // Update one User + * const user = await prisma.user.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Users. + * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. + * @example + * // Delete a few Users + * const { count } = await prisma.user.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Users + * const user = await prisma.user.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users and returns the data updated in the database. + * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. + * @example + * // Update many Users + * const user = await prisma.user.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Users and only return the `id` + * const userWithIdOnly = await prisma.user.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one User. + * @param {UserUpsertArgs} args - Arguments to update or create a User. + * @example + * // Update or create a User + * const user = await prisma.user.upsert({ + * create: { + * // ... data to create a User + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the User we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserCountArgs} args - Arguments to filter Users to count. + * @example + * // Count the number of Users + * const count = await prisma.user.count({ + * where: { + * // ... the filter for the Users we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserGroupByArgs} 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 UserGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: UserGroupByArgs['orderBy'] } + : { orderBy?: UserGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the User model + */ +readonly fields: UserFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for User. + * 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 interface Prisma__UserClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + posts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the User model + */ +export interface UserFieldRefs { + readonly id: Prisma.FieldRef<"User", 'Int'> + readonly email: Prisma.FieldRef<"User", 'String'> + readonly name: Prisma.FieldRef<"User", 'String'> +} + + +// Custom InputTypes +/** + * User findUnique + */ +export type UserFindUniqueArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findUniqueOrThrow + */ +export type UserFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findFirst + */ +export type UserFindFirstArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findFirstOrThrow + */ +export type UserFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findMany + */ +export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which Users to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User create + */ +export type UserCreateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to create a User. + */ + data: Prisma.XOR +} + +/** + * User createMany + */ +export type UserCreateManyArgs = { + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User createManyAndReturn + */ +export type UserCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectCreateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User update + */ +export type UserUpdateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to update a User. + */ + data: Prisma.XOR + /** + * Choose, which User to update. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User updateMany + */ +export type UserUpdateManyArgs = { + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User updateManyAndReturn + */ +export type UserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User upsert + */ +export type UserUpsertArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The filter to search for the User to update in case it exists. + */ + where: Prisma.UserWhereUniqueInput + /** + * In case the User found by the `where` argument doesn't exist, create a new User with this data. + */ + create: Prisma.XOR + /** + * In case the User was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * User delete + */ +export type UserDeleteArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter which User to delete. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User deleteMany + */ +export type UserDeleteManyArgs = { + /** + * Filter which Users to delete + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to delete. + */ + limit?: number +} + +/** + * User.posts + */ +export type User$postsArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + where?: Prisma.PostWhereInput + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + cursor?: Prisma.PostWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * User without action + */ +export type UserDefaultArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null +} diff --git a/orm/nuxt/prisma/schema.prisma b/orm/nuxt/prisma/schema.prisma index 67b48f9c0616..56b3dc48e7e6 100644 --- a/orm/nuxt/prisma/schema.prisma +++ b/orm/nuxt/prisma/schema.prisma @@ -1,5 +1,7 @@ generator client { - provider = "prisma-client-js" + provider = "prisma-client" + engineType = "client" + output = "./generated/prisma" } datasource db { diff --git a/orm/nuxt/prisma/seed.js b/orm/nuxt/prisma/seed.ts similarity index 91% rename from orm/nuxt/prisma/seed.js rename to orm/nuxt/prisma/seed.ts index c2d4ab5cd2c4..7fd34e049066 100644 --- a/orm/nuxt/prisma/seed.js +++ b/orm/nuxt/prisma/seed.ts @@ -1,5 +1,5 @@ -const { PrismaClient } = require('@prisma/client') -const { withAccelerate } = require('@prisma/extension-accelerate') +import { PrismaClient } from '../prisma/generated/prisma/client' +import { withAccelerate } from '@prisma/extension-accelerate' const prisma = new PrismaClient().$extends(withAccelerate()) diff --git a/orm/nuxt/tsconfig.json b/orm/nuxt/tsconfig.json index 69cd45d8efea..01c1320c78db 100644 --- a/orm/nuxt/tsconfig.json +++ b/orm/nuxt/tsconfig.json @@ -1,7 +1,18 @@ { - // https://v3.nuxtjs.org/concepts/typescript - "extends": "./.nuxt/tsconfig.json", - "compilerOptions": { - "jsx": "preserve" - }, -} + // https://nuxt.com/docs/guide/concepts/typescript + "files": [], + "references": [ + { + "path": "./.nuxt/tsconfig.app.json" + }, + { + "path": "./.nuxt/tsconfig.server.json" + }, + { + "path": "./.nuxt/tsconfig.shared.json" + }, + { + "path": "./.nuxt/tsconfig.node.json" + } + ] +} \ No newline at end of file From 70806d107f227ade249b965981e6e32e6b0a4387 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Thu, 2 Oct 2025 08:08:23 +0530 Subject: [PATCH 05/13] update betterauth-nextjs example --- orm/betterauth-nextjs/.env.example | 3 +- orm/betterauth-nextjs/package.json | 35 +++++++++++----------- orm/betterauth-nextjs/prisma/schema.prisma | 5 ++-- orm/betterauth-nextjs/src/lib/prisma.ts | 2 +- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/orm/betterauth-nextjs/.env.example b/orm/betterauth-nextjs/.env.example index 62cd468cde7f..840931a987df 100644 --- a/orm/betterauth-nextjs/.env.example +++ b/orm/betterauth-nextjs/.env.example @@ -1,2 +1,3 @@ -BETTER_AUTH_SECRET= +DATABASE_URL= +BETTER_AUTH_SECRET=change-me BETTER_AUTH_URL=http://localhost:3000 diff --git a/orm/betterauth-nextjs/package.json b/orm/betterauth-nextjs/package.json index 12aea88affeb..90b73e5a27e7 100644 --- a/orm/betterauth-nextjs/package.json +++ b/orm/betterauth-nextjs/package.json @@ -5,27 +5,26 @@ "scripts": { "dev": "next dev --turbopack", "build": "next build", - "start": "next start", - "lint": "next lint" + "start": "next start" }, "dependencies": { - "@prisma/client": "6.10.1", - "@prisma/extension-accelerate": "2.0.2", - "better-auth": "1.2.12", - "next": "15.3.5", - "react": "19.1.0", - "react-dom": "19.1.0" + "@prisma/client": "^6.16.3", + "@prisma/extension-accelerate": "^2.0.2", + "better-auth": "1.3.24", + "next": "15.5.4", + "react": "19.2.0", + "react-dom": "19.2.0" }, "devDependencies": { "@eslint/eslintrc": "3.3.1", - "@tailwindcss/postcss": "4.1.11", - "@types/node": "20.19.11", - "@types/react": "19.1.8", - "@types/react-dom": "19.1.6", - "eslint": "9.30.1", - "eslint-config-next": "15.3.5", - "prisma": "6.10.1", - "tailwindcss": "4.1.11", - "typescript": "5.8.3" + "@tailwindcss/postcss": "4.1.14", + "@types/node": "24.6.2", + "@types/react": "19.2.0", + "@types/react-dom": "19.2.0", + "eslint": "9.36.0", + "eslint-config-next": "15.5.4", + "prisma": "^6.16.3", + "tailwindcss": "4.1.14", + "typescript": "5.9.3" } -} +} \ No newline at end of file diff --git a/orm/betterauth-nextjs/prisma/schema.prisma b/orm/betterauth-nextjs/prisma/schema.prisma index fe3e9fd11d2a..be03fee67e4c 100644 --- a/orm/betterauth-nextjs/prisma/schema.prisma +++ b/orm/betterauth-nextjs/prisma/schema.prisma @@ -5,8 +5,9 @@ // Try Prisma Accelerate: https://pris.ly/cli/accelerate-init generator client { - provider = "prisma-client-js" - output = "../src/generated/prisma" + provider = "prisma-client" + engineType = "client" + output = "../src/generated/prisma" } datasource db { diff --git a/orm/betterauth-nextjs/src/lib/prisma.ts b/orm/betterauth-nextjs/src/lib/prisma.ts index 071f397851a9..97fea83ad3ca 100644 --- a/orm/betterauth-nextjs/src/lib/prisma.ts +++ b/orm/betterauth-nextjs/src/lib/prisma.ts @@ -1,4 +1,4 @@ -import { PrismaClient } from '@/generated/prisma' +import { PrismaClient } from '@/generated/prisma/client' import { withAccelerate } from '@prisma/extension-accelerate' const prisma = new PrismaClient().$extends(withAccelerate()) From accb59d8c2d5dc4c63a82c5333039d6746a53f92 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Thu, 2 Oct 2025 10:48:14 +0530 Subject: [PATCH 06/13] update nuxt-prisma-module example --- orm/nuxt-prisma-module/.env.example | 1 + orm/nuxt-prisma-module/README.md | 50 +- orm/nuxt-prisma-module/{ => app}/app.vue | 0 .../{ => app}/components/FirstUser.server.vue | 0 orm/nuxt-prisma-module/lib/prisma.ts | 6 +- orm/nuxt-prisma-module/nuxt.config.ts | 5 +- orm/nuxt-prisma-module/package.json | 23 +- .../prisma/generated/prisma/browser.ts | 28 + .../prisma/generated/prisma/client.ts | 52 + .../generated/prisma/commonInputTypes.ts | 251 +++ .../prisma/generated/prisma/enums.ts | 14 + .../prisma/generated/prisma/internal/class.ts | 242 +++ .../prisma/internal/prismaNamespace.ts | 848 ++++++++++ .../prisma/internal/prismaNamespaceBrowser.ts | 113 ++ .../prisma/generated/prisma/models.ts | 12 + .../prisma/generated/prisma/models/Post.ts | 1388 +++++++++++++++++ .../prisma/generated/prisma/models/User.ts | 1312 ++++++++++++++++ orm/nuxt-prisma-module/prisma/schema.prisma | 6 +- .../prisma/{seed.js => seed.ts} | 14 +- .../server/api/user-exists.ts | 3 +- orm/nuxt-prisma-module/tsconfig.json | 18 +- orm/nuxt/.env.example | 1 + 22 files changed, 4355 insertions(+), 32 deletions(-) create mode 100644 orm/nuxt-prisma-module/.env.example rename orm/nuxt-prisma-module/{ => app}/app.vue (100%) rename orm/nuxt-prisma-module/{ => app}/components/FirstUser.server.vue (100%) create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/browser.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/client.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/commonInputTypes.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/enums.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/internal/class.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/internal/prismaNamespace.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/models.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/models/Post.ts create mode 100644 orm/nuxt-prisma-module/prisma/generated/prisma/models/User.ts rename orm/nuxt-prisma-module/prisma/{seed.js => seed.ts} (82%) create mode 100644 orm/nuxt/.env.example diff --git a/orm/nuxt-prisma-module/.env.example b/orm/nuxt-prisma-module/.env.example new file mode 100644 index 000000000000..4cc714a24dc5 --- /dev/null +++ b/orm/nuxt-prisma-module/.env.example @@ -0,0 +1 @@ +DATABASE_URL= \ No newline at end of file diff --git a/orm/nuxt-prisma-module/README.md b/orm/nuxt-prisma-module/README.md index f8711d9470e6..bd5143cd0f3f 100644 --- a/orm/nuxt-prisma-module/README.md +++ b/orm/nuxt-prisma-module/README.md @@ -21,19 +21,61 @@ The app demonstrates: cd nuxt-prisma-module ``` -3. Create a `.env` file: +3. Install dependencies: ```terminal - DATABASE_URL="file:./dev.db" + npm install ``` -4. Start the development server: +4. Set up your Prisma Postgres database: + + ```terminal + npx prisma init --db + ``` + + This will prompt you to: + - Select a region (e.g., `ap-southeast-1`) + - Enter a project name + - Copy the provided database URL to your `.env` file + +5. Create a `.env` file with your Prisma Postgres database URL: + + ```bash + # .env + DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=..." + ``` + +6. Apply database migrations: + + ```terminal + npx prisma migrate dev + ``` + +7. Seed the database with sample data: + + ```terminal + npx prisma db seed + ``` + +8. Start the development server: ```terminal npm run dev ``` -5. Follow the instructions in the terminal to launch Prisma Studio integrated in the Nuxt devtools within your browser. +9. Follow the instructions in the terminal to launch Prisma Studio integrated in the Nuxt devtools within your browser. + +## Prisma Postgres Setup + +This example uses Prisma Postgres, which requires the Prisma Accelerate extension. The extension is already included in the project dependencies and configured in [`lib/prisma.ts`](./lib/prisma.ts). + +The Prisma Client is extended with the Accelerate extension to enable querying against your Prisma Postgres database: + +```typescript +import { withAccelerate } from '@prisma/extension-accelerate' + +const prisma = new PrismaClient().$extends(withAccelerate()) +``` ## Resources diff --git a/orm/nuxt-prisma-module/app.vue b/orm/nuxt-prisma-module/app/app.vue similarity index 100% rename from orm/nuxt-prisma-module/app.vue rename to orm/nuxt-prisma-module/app/app.vue diff --git a/orm/nuxt-prisma-module/components/FirstUser.server.vue b/orm/nuxt-prisma-module/app/components/FirstUser.server.vue similarity index 100% rename from orm/nuxt-prisma-module/components/FirstUser.server.vue rename to orm/nuxt-prisma-module/app/components/FirstUser.server.vue diff --git a/orm/nuxt-prisma-module/lib/prisma.ts b/orm/nuxt-prisma-module/lib/prisma.ts index 90d8c49a2cf4..95c2c14cc70d 100644 --- a/orm/nuxt-prisma-module/lib/prisma.ts +++ b/orm/nuxt-prisma-module/lib/prisma.ts @@ -1,8 +1,10 @@ -import { Prisma, PrismaClient } from '@prisma/client' +import { Prisma, PrismaClient } from "../prisma/generated/prisma/client" +import { withAccelerate } from '@prisma/extension-accelerate' const prismaClientSingleton = () => { + // Custom extended Prisma ORM instance with client extensions, adding a method to verify the existence of a database entry. - return new PrismaClient().$extends({ + return new PrismaClient().$extends(withAccelerate()).$extends({ model: { $allModels: { async exists( diff --git a/orm/nuxt-prisma-module/nuxt.config.ts b/orm/nuxt-prisma-module/nuxt.config.ts index e40d5af11c20..46b4f4d90e27 100644 --- a/orm/nuxt-prisma-module/nuxt.config.ts +++ b/orm/nuxt-prisma-module/nuxt.config.ts @@ -2,8 +2,7 @@ export default defineNuxtConfig({ modules: ['@prisma/nuxt'], // You can learn more about the `@prisma/nuxt` module configuration options [here](https://pris.ly/configure-prisma-nuxt) - prisma: { - autoSetupPrisma: true, - }, + prisma: {}, devtools: { enabled: true }, + compatibilityDate: '2025-07-15', }) diff --git a/orm/nuxt-prisma-module/package.json b/orm/nuxt-prisma-module/package.json index 952561c20e1d..91ee4748fe38 100644 --- a/orm/nuxt-prisma-module/package.json +++ b/orm/nuxt-prisma-module/package.json @@ -7,20 +7,23 @@ "dev": "nuxt dev", "generate": "nuxt generate", "preview": "nuxt preview", - "postinstall": "nuxt prepare", - "test": "" + "postinstall": "nuxt prepare" }, "dependencies": { - "@prisma/nuxt": "0.3.0", - "nuxt": "3.17.6", - "vue": "3.5.17", - "vue-router": "4.5.1" + "@prisma/adapter-better-sqlite3": "^6.16.3", + "@prisma/nuxt": "^0.3.0", + "@prisma/client": "^6.16.3", + "@prisma/extension-accelerate": "^2.0.2", + "nuxt": "^4.1.2", + "vue": "^3.5.22", + "vue-router": "^4.5.1" }, "devDependencies": { - "@prisma/client": "6.9.0", - "prisma": "6.9.0" + "@types/node": "^24.6.1", + "prisma": "^6.16.3", + "tsx": "^4.20.6" }, "prisma": { - "seed": "node prisma/seed.js" + "seed": "tsx prisma/seed.ts" } -} +} \ No newline at end of file diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/browser.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/browser.ts new file mode 100644 index 000000000000..6c7c4f7a8fb5 --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/browser.ts @@ -0,0 +1,28 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma-related types and utilities in a browser. + * Use it to get access to models, enums, and input types. + * + * This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only. + * See `client.ts` for the standard, server-side entry point. + * + * 🟢 You can import this file directly. + */ + +import * as Prisma from './internal/prismaNamespaceBrowser.js' +export { Prisma } +export * as $Enums from './enums.js' +export * from './enums.js'; +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Post + * + */ +export type Post = Prisma.PostModel diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/client.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/client.ts new file mode 100644 index 000000000000..3c19fca40914 --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/client.ts @@ -0,0 +1,52 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types. + * If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead. + * + * 🟢 You can import this file directly. + */ + +import * as process from 'node:process' +import * as path from 'node:path' +import { fileURLToPath } from 'node:url' +globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url)) + +import * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums.js" +import * as $Class from "./internal/class.js" +import * as Prisma from "./internal/prismaNamespace.js" + +export * as $Enums from './enums.js' +export * from "./enums.js" +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ +export const PrismaClient = $Class.getPrismaClientClass(__dirname) +export type PrismaClient = $Class.PrismaClient +export { Prisma } + + + +/** + * Model User + * + */ +export type User = Prisma.UserModel +/** + * Model Post + * + */ +export type Post = Prisma.PostModel diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/commonInputTypes.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/commonInputTypes.ts new file mode 100644 index 000000000000..755b2027b046 --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/commonInputTypes.ts @@ -0,0 +1,251 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports various common sort, input & filter types that are not directly linked to a particular model. + * + * 🟢 You can import this file directly. + */ + +import type * as runtime from "@prisma/client/runtime/client" +import * as $Enums from "./enums.js" +import type * as Prisma from "./internal/prismaNamespace.js" + + +export type IntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type StringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type StringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type SortOrderInput = { + sort: Prisma.SortOrder + nulls?: Prisma.NullsOrder +} + +export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type StringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type StringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + mode?: Prisma.QueryMode + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type NestedIntFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntFilter<$PrismaModel> | number +} + +export type NestedStringFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringFilter<$PrismaModel> | string +} + +export type NestedStringNullableFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableFilter<$PrismaModel> | string | null +} + +export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type NestedFloatFilter<$PrismaModel = never> = { + equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListFloatFieldRefInput<$PrismaModel> + lt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + lte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gt?: number | Prisma.FloatFieldRefInput<$PrismaModel> + gte?: number | Prisma.FloatFieldRefInput<$PrismaModel> + not?: Prisma.NestedFloatFilter<$PrismaModel> | number +} + +export type NestedStringWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringWithAggregatesFilter<$PrismaModel> | string + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedStringFilter<$PrismaModel> + _max?: Prisma.NestedStringFilter<$PrismaModel> +} + +export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = { + equals?: string | Prisma.StringFieldRefInput<$PrismaModel> | null + in?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + notIn?: string[] | Prisma.ListStringFieldRefInput<$PrismaModel> | null + lt?: string | Prisma.StringFieldRefInput<$PrismaModel> + lte?: string | Prisma.StringFieldRefInput<$PrismaModel> + gt?: string | Prisma.StringFieldRefInput<$PrismaModel> + gte?: string | Prisma.StringFieldRefInput<$PrismaModel> + contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + startsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + endsWith?: string | Prisma.StringFieldRefInput<$PrismaModel> + not?: Prisma.NestedStringNullableWithAggregatesFilter<$PrismaModel> | string | null + _count?: Prisma.NestedIntNullableFilter<$PrismaModel> + _min?: Prisma.NestedStringNullableFilter<$PrismaModel> + _max?: Prisma.NestedStringNullableFilter<$PrismaModel> +} + +export type NestedIntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + + diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/enums.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/enums.ts new file mode 100644 index 000000000000..0189a3446d4f --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/enums.ts @@ -0,0 +1,14 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* +* This file exports all enum related types from the schema. +* +* 🟢 You can import this file directly. +*/ + + + +// This file is empty because there are no enums in the schema. +export {} diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/internal/class.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/internal/class.ts new file mode 100644 index 000000000000..a566852c4205 --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/internal/class.ts @@ -0,0 +1,242 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * Please import the `PrismaClient` class from the `client.ts` file instead. + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "./prismaNamespace.js" + + +const config: runtime.GetPrismaClientConfig = { + "generator": { + "name": "client", + "provider": { + "fromEnvVar": null, + "value": "prisma-client" + }, + "output": { + "value": "/home/aman/dev/work/prisma-examples/orm/nuxt-prisma-module/prisma/generated/prisma", + "fromEnvVar": null + }, + "config": { + "engineType": "client" + }, + "binaryTargets": [ + { + "fromEnvVar": null, + "value": "debian-openssl-3.0.x", + "native": true + } + ], + "previewFeatures": [], + "sourceFilePath": "/home/aman/dev/work/prisma-examples/orm/nuxt-prisma-module/prisma/schema.prisma", + "isCustomOutput": true + }, + "relativePath": "../..", + "clientVersion": "6.16.3", + "engineVersion": "bb420e667c1820a8c05a38023385f6cc7ef8e83a", + "datasourceNames": [ + "db" + ], + "activeProvider": "postgresql", + "postinstall": false, + "inlineDatasources": { + "db": { + "url": { + "fromEnvVar": "DATABASE_URL", + "value": null + } + } + }, + "inlineSchema": "// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n provider = \"prisma-client\"\n engineType = \"client\"\n output = \"./generated/prisma\"\n}\n\ndatasource db {\n provider = \"postgresql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel User {\n id Int @id @default(autoincrement())\n email String @unique\n name String?\n posts Post[]\n}\n\nmodel Post {\n id Int @id @default(autoincrement())\n title String\n content String?\n published Boolean @default(false)\n author User @relation(fields: [authorId], references: [id])\n authorId Int\n}\n", + "inlineSchemaHash": "96d06ce053348e0c1f70981a2267a21a7f3ccd2ce3cac6993668bd788a3e5eea", + "copyEngine": true, + "runtimeDataModel": { + "models": {}, + "enums": {}, + "types": {} + }, + "dirname": "" +} + +config.runtimeDataModel = JSON.parse("{\"models\":{\"User\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"posts\",\"kind\":\"object\",\"type\":\"Post\",\"relationName\":\"PostToUser\"}],\"dbName\":null},\"Post\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"content\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"published\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"author\",\"kind\":\"object\",\"type\":\"User\",\"relationName\":\"PostToUser\"},{\"name\":\"authorId\",\"kind\":\"scalar\",\"type\":\"Int\"}],\"dbName\":null}},\"enums\":{},\"types\":{}}") +config.engineWasm = undefined + +async function decodeBase64AsWasm(wasmBase64: string): Promise { + const { Buffer } = await import('node:buffer') + const wasmArray = Buffer.from(wasmBase64, 'base64') + return new WebAssembly.Module(wasmArray) +} + +config.compilerWasm = { + getRuntime: async () => await import("@prisma/client/runtime/query_compiler_bg.postgresql.mjs"), + + getQueryCompilerWasmModule: async () => { + const { wasm } = await import("@prisma/client/runtime/query_compiler_bg.postgresql.wasm-base64.mjs") + return await decodeBase64AsWasm(wasm) + } +} + + + + +export type LogOptions = + 'log' extends keyof ClientOptions ? ClientOptions['log'] extends Array ? Prisma.GetEvents : never : never + +export interface PrismaClientConstructor { + /** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + + new < + Options extends Prisma.PrismaClientOptions = Prisma.PrismaClientOptions, + LogOpts extends LogOptions = LogOptions, + OmitOpts extends Prisma.PrismaClientOptions['omit'] = Options extends { omit: infer U } ? U : Prisma.PrismaClientOptions['omit'], + ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs + >(options?: Prisma.Subset ): PrismaClient +} + +/** + * ## Prisma Client + * + * Type-safe database client for TypeScript + * @example + * ``` + * const prisma = new PrismaClient() + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + * + * Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client). + */ + +export interface PrismaClient< + in LogOpts extends Prisma.LogLevel = never, + in out OmitOpts extends Prisma.PrismaClientOptions['omit'] = Prisma.PrismaClientOptions['omit'], + in out ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs +> { + [K: symbol]: { types: Prisma.TypeMap['other'] } + + $on(eventType: V, callback: (event: V extends 'query' ? Prisma.QueryEvent : Prisma.LogEvent) => void): PrismaClient; + + /** + * Connect with the database + */ + $connect(): runtime.Types.Utils.JsPromise; + + /** + * Disconnect from the database + */ + $disconnect(): runtime.Types.Utils.JsPromise; + +/** + * 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 }): runtime.Types.Utils.JsPromise> + + $transaction(fn: (prisma: Omit) => runtime.Types.Utils.JsPromise, options?: { maxWait?: number, timeout?: number, isolationLevel?: Prisma.TransactionIsolationLevel }): runtime.Types.Utils.JsPromise + + + $extends: runtime.Types.Extensions.ExtendsHook<"extends", Prisma.TypeMapCb, ExtArgs, runtime.Types.Utils.Call, { + extArgs: ExtArgs + }>> + + /** + * `prisma.user`: Exposes CRUD operations for the **User** model. + * Example usage: + * ```ts + * // Fetch zero or more Users + * const users = await prisma.user.findMany() + * ``` + */ + get user(): Prisma.UserDelegate; + + /** + * `prisma.post`: Exposes CRUD operations for the **Post** model. + * Example usage: + * ```ts + * // Fetch zero or more Posts + * const posts = await prisma.post.findMany() + * ``` + */ + get post(): Prisma.PostDelegate; +} + +export function getPrismaClientClass(dirname: string): PrismaClientConstructor { + config.dirname = dirname + return runtime.getPrismaClient(config) as unknown as PrismaClientConstructor +} diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/internal/prismaNamespace.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/internal/prismaNamespace.ts new file mode 100644 index 000000000000..68768568ae5d --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/internal/prismaNamespace.ts @@ -0,0 +1,848 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the client.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/client" +import type * as Prisma from "../models.js" +import { type PrismaClient } from "./class.js" + +export type * from '../models.js' + +export type DMMF = typeof runtime.DMMF + +export type PrismaPromise = runtime.Types.Public.PrismaPromise + +/** + * Prisma Errors + */ + +export const PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError +export type PrismaClientKnownRequestError = runtime.PrismaClientKnownRequestError + +export const PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError +export type PrismaClientUnknownRequestError = runtime.PrismaClientUnknownRequestError + +export const PrismaClientRustPanicError = runtime.PrismaClientRustPanicError +export type PrismaClientRustPanicError = runtime.PrismaClientRustPanicError + +export const PrismaClientInitializationError = runtime.PrismaClientInitializationError +export type PrismaClientInitializationError = runtime.PrismaClientInitializationError + +export const PrismaClientValidationError = runtime.PrismaClientValidationError +export type PrismaClientValidationError = runtime.PrismaClientValidationError + +/** + * Re-export of sql-template-tag + */ +export const sql = runtime.sqltag +export const empty = runtime.empty +export const join = runtime.join +export const raw = runtime.raw +export const Sql = runtime.Sql +export type Sql = runtime.Sql + + + +/** + * Decimal.js + */ +export const Decimal = runtime.Decimal +export type 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 + +/** +* Extensions +*/ +export type Extension = runtime.Types.Extensions.UserArgs +export const getExtensionContext = runtime.Extensions.getExtensionContext +export type Args = runtime.Types.Public.Args +export type Payload = runtime.Types.Public.Payload +export type Result = runtime.Types.Public.Result +export type Exact = runtime.Types.Public.Exact + +export type PrismaVersion = { + client: string + engine: string +} + +/** + * Prisma Client JS version: 6.16.3 + * Query Engine version: bb420e667c1820a8c05a38023385f6cc7ef8e83a + */ +export const prismaVersion: PrismaVersion = { + client: "6.16.3", + engine: "bb420e667c1820a8c05a38023385f6cc7ef8e83a" +} + +/** + * Utility Types + */ + +export type JsonObject = runtime.JsonObject +export type JsonArray = runtime.JsonArray +export type JsonValue = runtime.JsonValue +export type InputJsonObject = runtime.InputJsonObject +export type InputJsonArray = runtime.InputJsonArray +export type InputJsonValue = runtime.InputJsonValue + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +type SelectAndInclude = { + select: any + include: any +} + +type SelectAndOmit = { + select: any + omit: any +} + +/** + * 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; + +/** + * 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`.' + : T extends SelectAndOmit + ? 'Please either choose `select` or `omit`.' + : {}) + +/** + * 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 + */ +export 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] + +export type Either< + O extends object, + K extends Key, + strict extends Boolean = 1 +> = O extends unknown ? _Either : never + +export type Union = any + +export 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 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 +export 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 ? P : 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>>; + +export type Boolean = True | False + +export type True = 1 + +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 + +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 + +export 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 +export type MaybeTupleToUnion = T extends any[] ? TupleToUnion : T + +/** + * Like `Pick`, but additionally can also accept an array of keys + */ +export type PickEnumerable | keyof T> = Prisma__Pick> + +/** + * Exclude all keys with underscores + */ +export type ExcludeUnderscoreKeys = T extends `_${string}` ? never : T + + +export type FieldRef = runtime.FieldRef + +type FieldRefInputType = Model extends never ? never : FieldRef + + +export const ModelName = { + User: 'User', + Post: 'Post' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + + + +export interface TypeMapCb extends runtime.Types.Utils.Fn<{extArgs: runtime.Types.Extensions.InternalArgs }, runtime.Types.Utils.Record> { + returns: TypeMap +} + +export type TypeMap = { + globalOmitOptions: { + omit: GlobalOmitOptions + } + meta: { + modelProps: "user" | "post" + txIsolationLevel: TransactionIsolationLevel + } + model: { + User: { + payload: Prisma.$UserPayload + fields: Prisma.UserFieldRefs + operations: { + findUnique: { + args: Prisma.UserFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.UserFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.UserFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.UserFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.UserFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.UserCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.UserCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.UserCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.UserDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.UserUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.UserDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.UserUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.UserUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.UserUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.UserAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.UserGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.UserCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + Post: { + payload: Prisma.$PostPayload + fields: Prisma.PostFieldRefs + operations: { + findUnique: { + args: Prisma.PostFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.PostFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.PostFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.PostFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.PostFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.PostCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.PostCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.PostCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.PostDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.PostUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.PostDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.PostUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.PostUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.PostUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.PostAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.PostGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.PostCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } + } +} & { + other: { + payload: any + operations: { + $executeRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $executeRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + $queryRaw: { + args: [query: TemplateStringsArray | Sql, ...values: any[]], + result: any + } + $queryRawUnsafe: { + args: [query: string, ...values: any[]], + result: any + } + } + } +} + +/** + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + email: 'email', + name: 'name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const PostScalarFieldEnum = { + id: 'id', + title: 'title', + content: 'content', + published: 'published', + authorId: 'authorId' +} as const + +export type PostScalarFieldEnum = (typeof PostScalarFieldEnum)[keyof typeof PostScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + + + +/** + * Field references + */ + + +/** + * Reference to a field of type 'Int' + */ +export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'> + + + +/** + * Reference to a field of type 'Int[]' + */ +export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int[]'> + + + +/** + * Reference to a field of type 'String' + */ +export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String'> + + + +/** + * Reference to a field of type 'String[]' + */ +export type ListStringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'String[]'> + + + +/** + * Reference to a field of type 'Boolean' + */ +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + +/** + * Reference to a field of type 'Float' + */ +export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float'> + + + +/** + * Reference to a field of type 'Float[]' + */ +export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> + + +/** + * Batch Payload for updateMany & deleteMany & createMany + */ +export type BatchPayload = { + count: number +} + + +export type Datasource = { + url?: string +} +export type Datasources = { + db?: Datasource +} + +export const defineExtension = runtime.Extensions.defineExtension as unknown as runtime.Types.Extensions.ExtendsHook<"define", TypeMapCb, runtime.Types.Extensions.DefaultArgs> +export type DefaultPrismaClient = PrismaClient +export type ErrorFormat = 'pretty' | 'colorless' | 'minimal' +export interface PrismaClientOptions { + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasources?: Datasources + /** + * Overwrites the datasource url from your schema.prisma file + */ + datasourceUrl?: string + /** + * @default "colorless" + */ + errorFormat?: ErrorFormat + /** + * @example + * ``` + * // Shorthand for `emit: 'stdout'` + * log: ['query', 'info', 'warn', 'error'] + * + * // Emit as events only + * log: [ + * { emit: 'event', level: 'query' }, + * { emit: 'event', level: 'info' }, + * { emit: 'event', level: 'warn' } + * { emit: 'event', level: 'error' } + * ] + * + * / Emit as events and log to stdout + * og: [ + * { 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?: (LogLevel | LogDefinition)[] + /** + * The default values for transactionOptions + * maxWait ?= 2000 + * timeout ?= 5000 + */ + transactionOptions?: { + maxWait?: number + timeout?: number + isolationLevel?: TransactionIsolationLevel + } + /** + * Instance of a Driver Adapter, e.g., like one provided by `@prisma/adapter-planetscale` + */ + adapter?: runtime.SqlDriverAdapterFactory | null + /** + * Global configuration for omitting model fields by default. + * + * @example + * ``` + * const prisma = new PrismaClient({ + * omit: { + * user: { + * password: true + * } + * } + * }) + * ``` + */ + omit?: GlobalOmitConfig +} +export type GlobalOmitConfig = { + user?: Prisma.UserOmit + post?: Prisma.PostOmit +} + +/* Types for Logging */ +export type LogLevel = 'info' | 'query' | 'warn' | 'error' +export type LogDefinition = { + level: LogLevel + emit: 'stdout' | 'event' +} + +export type CheckIsLogLevel = T extends LogLevel ? T : never; + +export type GetLogType = CheckIsLogLevel< + T extends LogDefinition ? T['level'] : T +>; + +export type GetEvents = T extends Array + ? 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' + | 'findUniqueOrThrow' + | 'findMany' + | 'findFirst' + | 'findFirstOrThrow' + | 'create' + | 'createMany' + | 'createManyAndReturn' + | 'update' + | 'updateMany' + | 'updateManyAndReturn' + | 'upsert' + | 'delete' + | 'deleteMany' + | 'executeRaw' + | 'queryRaw' + | 'aggregate' + | 'count' + | 'runCommandRaw' + | 'findRaw' + | 'groupBy' + +/** + * `PrismaClient` proxy available in interactive transactions. + */ +export type TransactionClient = Omit + diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts new file mode 100644 index 000000000000..aa632505bcf3 --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/internal/prismaNamespaceBrowser.ts @@ -0,0 +1,113 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * WARNING: This is an internal file that is subject to change! + * + * 🛑 Under no circumstances should you import this file directly! 🛑 + * + * All exports from this file are wrapped under a `Prisma` namespace object in the browser.ts file. + * While this enables partial backward compatibility, it is not part of the stable public API. + * + * If you are looking for your Models, Enums, and Input Types, please import them from the respective + * model files in the `model` directory! + */ + +import * as runtime from "@prisma/client/runtime/index-browser" + +export type * from '../models.js' +export type * from './prismaNamespace.js' + +export const Decimal = runtime.Decimal + + +export const NullTypes = { + DbNull: runtime.objectEnumValues.classes.DbNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.DbNull), + JsonNull: runtime.objectEnumValues.classes.JsonNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.JsonNull), + AnyNull: runtime.objectEnumValues.classes.AnyNull as (new (secret: never) => typeof runtime.objectEnumValues.instances.AnyNull), +} +/** + * 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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.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 = runtime.objectEnumValues.instances.AnyNull + + +export const ModelName = { + User: 'User', + Post: 'Post' +} as const + +export type ModelName = (typeof ModelName)[keyof typeof ModelName] + +/* + * Enums + */ + +export const TransactionIsolationLevel = runtime.makeStrictEnum({ + ReadUncommitted: 'ReadUncommitted', + ReadCommitted: 'ReadCommitted', + RepeatableRead: 'RepeatableRead', + Serializable: 'Serializable' +} as const) + +export type TransactionIsolationLevel = (typeof TransactionIsolationLevel)[keyof typeof TransactionIsolationLevel] + + +export const UserScalarFieldEnum = { + id: 'id', + email: 'email', + name: 'name' +} as const + +export type UserScalarFieldEnum = (typeof UserScalarFieldEnum)[keyof typeof UserScalarFieldEnum] + + +export const PostScalarFieldEnum = { + id: 'id', + title: 'title', + content: 'content', + published: 'published', + authorId: 'authorId' +} as const + +export type PostScalarFieldEnum = (typeof PostScalarFieldEnum)[keyof typeof PostScalarFieldEnum] + + +export const SortOrder = { + asc: 'asc', + desc: 'desc' +} as const + +export type SortOrder = (typeof SortOrder)[keyof typeof SortOrder] + + +export const QueryMode = { + default: 'default', + insensitive: 'insensitive' +} as const + +export type QueryMode = (typeof QueryMode)[keyof typeof QueryMode] + + +export const NullsOrder = { + first: 'first', + last: 'last' +} as const + +export type NullsOrder = (typeof NullsOrder)[keyof typeof NullsOrder] + diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/models.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/models.ts new file mode 100644 index 000000000000..4cb0b9b1a8cb --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/models.ts @@ -0,0 +1,12 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This is a barrel export file for all models and their related types. + * + * 🟢 You can import this file directly. + */ +export type * from './models/User.js' +export type * from './models/Post.js' +export type * from './commonInputTypes.js' \ No newline at end of file diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/models/Post.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/models/Post.ts new file mode 100644 index 000000000000..45f6cdbd3d10 --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/models/Post.ts @@ -0,0 +1,1388 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `Post` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model Post + * + */ +export type PostModel = runtime.Types.Result.DefaultSelection + +export type AggregatePost = { + _count: PostCountAggregateOutputType | null + _avg: PostAvgAggregateOutputType | null + _sum: PostSumAggregateOutputType | null + _min: PostMinAggregateOutputType | null + _max: PostMaxAggregateOutputType | null +} + +export type PostAvgAggregateOutputType = { + id: number | null + authorId: number | null +} + +export type PostSumAggregateOutputType = { + id: number | null + authorId: number | null +} + +export type PostMinAggregateOutputType = { + id: number | null + title: string | null + content: string | null + published: boolean | null + authorId: number | null +} + +export type PostMaxAggregateOutputType = { + id: number | null + title: string | null + content: string | null + published: boolean | null + authorId: number | null +} + +export type PostCountAggregateOutputType = { + id: number + title: number + content: number + published: number + authorId: number + _all: number +} + + +export type PostAvgAggregateInputType = { + id?: true + authorId?: true +} + +export type PostSumAggregateInputType = { + id?: true + authorId?: true +} + +export type PostMinAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true +} + +export type PostMaxAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true +} + +export type PostCountAggregateInputType = { + id?: true + title?: true + content?: true + published?: true + authorId?: true + _all?: true +} + +export type PostAggregateArgs = { + /** + * Filter which Post to aggregate. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Posts + **/ + _count?: true | PostCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: PostAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: PostSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: PostMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: PostMaxAggregateInputType +} + +export type GetPostAggregateType = { + [P in keyof T & keyof AggregatePost]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type PostGroupByArgs = { + where?: Prisma.PostWhereInput + orderBy?: Prisma.PostOrderByWithAggregationInput | Prisma.PostOrderByWithAggregationInput[] + by: Prisma.PostScalarFieldEnum[] | Prisma.PostScalarFieldEnum + having?: Prisma.PostScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: PostCountAggregateInputType | true + _avg?: PostAvgAggregateInputType + _sum?: PostSumAggregateInputType + _min?: PostMinAggregateInputType + _max?: PostMaxAggregateInputType +} + +export type PostGroupByOutputType = { + id: number + title: string + content: string | null + published: boolean + authorId: number + _count: PostCountAggregateOutputType | null + _avg: PostAvgAggregateOutputType | null + _sum: PostSumAggregateOutputType | null + _min: PostMinAggregateOutputType | null + _max: PostMaxAggregateOutputType | null +} + +type GetPostGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof PostGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type PostWhereInput = { + AND?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + OR?: Prisma.PostWhereInput[] + NOT?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + id?: Prisma.IntFilter<"Post"> | number + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number + author?: Prisma.XOR +} + +export type PostOrderByWithRelationInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrderInput | Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder + author?: Prisma.UserOrderByWithRelationInput +} + +export type PostWhereUniqueInput = Prisma.AtLeast<{ + id?: number + AND?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + OR?: Prisma.PostWhereInput[] + NOT?: Prisma.PostWhereInput | Prisma.PostWhereInput[] + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number + author?: Prisma.XOR +}, "id"> + +export type PostOrderByWithAggregationInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrderInput | Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder + _count?: Prisma.PostCountOrderByAggregateInput + _avg?: Prisma.PostAvgOrderByAggregateInput + _max?: Prisma.PostMaxOrderByAggregateInput + _min?: Prisma.PostMinOrderByAggregateInput + _sum?: Prisma.PostSumOrderByAggregateInput +} + +export type PostScalarWhereWithAggregatesInput = { + AND?: Prisma.PostScalarWhereWithAggregatesInput | Prisma.PostScalarWhereWithAggregatesInput[] + OR?: Prisma.PostScalarWhereWithAggregatesInput[] + NOT?: Prisma.PostScalarWhereWithAggregatesInput | Prisma.PostScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"Post"> | number + title?: Prisma.StringWithAggregatesFilter<"Post"> | string + content?: Prisma.StringNullableWithAggregatesFilter<"Post"> | string | null + published?: Prisma.BoolWithAggregatesFilter<"Post"> | boolean + authorId?: Prisma.IntWithAggregatesFilter<"Post"> | number +} + +export type PostCreateInput = { + title: string + content?: string | null + published?: boolean + author: Prisma.UserCreateNestedOneWithoutPostsInput +} + +export type PostUncheckedCreateInput = { + id?: number + title: string + content?: string | null + published?: boolean + authorId: number +} + +export type PostUpdateInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + author?: Prisma.UserUpdateOneRequiredWithoutPostsNestedInput +} + +export type PostUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + authorId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostCreateManyInput = { + id?: number + title: string + content?: string | null + published?: boolean + authorId: number +} + +export type PostUpdateManyMutationInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean + authorId?: Prisma.IntFieldUpdateOperationsInput | number +} + +export type PostListRelationFilter = { + every?: Prisma.PostWhereInput + some?: Prisma.PostWhereInput + none?: Prisma.PostWhereInput +} + +export type PostOrderByRelationAggregateInput = { + _count?: Prisma.SortOrder +} + +export type PostCountOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostAvgOrderByAggregateInput = { + id?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostMinOrderByAggregateInput = { + id?: Prisma.SortOrder + title?: Prisma.SortOrder + content?: Prisma.SortOrder + published?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostSumOrderByAggregateInput = { + id?: Prisma.SortOrder + authorId?: Prisma.SortOrder +} + +export type PostCreateNestedManyWithoutAuthorInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] +} + +export type PostUncheckedCreateNestedManyWithoutAuthorInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] +} + +export type PostUpdateManyWithoutAuthorNestedInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + upsert?: Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput | Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + set?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + disconnect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + delete?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + update?: Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput | Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput[] + updateMany?: Prisma.PostUpdateManyWithWhereWithoutAuthorInput | Prisma.PostUpdateManyWithWhereWithoutAuthorInput[] + deleteMany?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] +} + +export type PostUncheckedUpdateManyWithoutAuthorNestedInput = { + create?: Prisma.XOR | Prisma.PostCreateWithoutAuthorInput[] | Prisma.PostUncheckedCreateWithoutAuthorInput[] + connectOrCreate?: Prisma.PostCreateOrConnectWithoutAuthorInput | Prisma.PostCreateOrConnectWithoutAuthorInput[] + upsert?: Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput | Prisma.PostUpsertWithWhereUniqueWithoutAuthorInput[] + createMany?: Prisma.PostCreateManyAuthorInputEnvelope + set?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + disconnect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + delete?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + connect?: Prisma.PostWhereUniqueInput | Prisma.PostWhereUniqueInput[] + update?: Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput | Prisma.PostUpdateWithWhereUniqueWithoutAuthorInput[] + updateMany?: Prisma.PostUpdateManyWithWhereWithoutAuthorInput | Prisma.PostUpdateManyWithWhereWithoutAuthorInput[] + deleteMany?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] +} + +export type BoolFieldUpdateOperationsInput = { + set?: boolean +} + +export type PostCreateWithoutAuthorInput = { + title: string + content?: string | null + published?: boolean +} + +export type PostUncheckedCreateWithoutAuthorInput = { + id?: number + title: string + content?: string | null + published?: boolean +} + +export type PostCreateOrConnectWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + create: Prisma.XOR +} + +export type PostCreateManyAuthorInputEnvelope = { + data: Prisma.PostCreateManyAuthorInput | Prisma.PostCreateManyAuthorInput[] + skipDuplicates?: boolean +} + +export type PostUpsertWithWhereUniqueWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + update: Prisma.XOR + create: Prisma.XOR +} + +export type PostUpdateWithWhereUniqueWithoutAuthorInput = { + where: Prisma.PostWhereUniqueInput + data: Prisma.XOR +} + +export type PostUpdateManyWithWhereWithoutAuthorInput = { + where: Prisma.PostScalarWhereInput + data: Prisma.XOR +} + +export type PostScalarWhereInput = { + AND?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] + OR?: Prisma.PostScalarWhereInput[] + NOT?: Prisma.PostScalarWhereInput | Prisma.PostScalarWhereInput[] + id?: Prisma.IntFilter<"Post"> | number + title?: Prisma.StringFilter<"Post"> | string + content?: Prisma.StringNullableFilter<"Post"> | string | null + published?: Prisma.BoolFilter<"Post"> | boolean + authorId?: Prisma.IntFilter<"Post"> | number +} + +export type PostCreateManyAuthorInput = { + id?: number + title: string + content?: string | null + published?: boolean +} + +export type PostUpdateWithoutAuthorInput = { + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateWithoutAuthorInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + +export type PostUncheckedUpdateManyWithoutAuthorInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + title?: Prisma.StringFieldUpdateOperationsInput | string + content?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + published?: Prisma.BoolFieldUpdateOperationsInput | boolean +} + + + +export type PostSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean + author?: boolean | Prisma.UserDefaultArgs +}, ExtArgs["result"]["post"]> + +export type PostSelectScalar = { + id?: boolean + title?: boolean + content?: boolean + published?: boolean + authorId?: boolean +} + +export type PostOmit = runtime.Types.Extensions.GetOmit<"id" | "title" | "content" | "published" | "authorId", ExtArgs["result"]["post"]> +export type PostInclude = { + author?: boolean | Prisma.UserDefaultArgs +} +export type PostIncludeCreateManyAndReturn = { + author?: boolean | Prisma.UserDefaultArgs +} +export type PostIncludeUpdateManyAndReturn = { + author?: boolean | Prisma.UserDefaultArgs +} + +export type $PostPayload = { + name: "Post" + objects: { + author: Prisma.$UserPayload + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + title: string + content: string | null + published: boolean + authorId: number + }, ExtArgs["result"]["post"]> + composites: {} +} + +export type PostGetPayload = runtime.Types.Result.GetResult + +export type PostCountArgs = + Omit & { + select?: PostCountAggregateInputType | true + } + +export interface PostDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['Post'], meta: { name: 'Post' } } + /** + * Find zero or one Post that matches the filter. + * @param {PostFindUniqueArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one Post that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {PostFindUniqueOrThrowArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Post 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 {PostFindFirstArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first Post that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {PostFindFirstOrThrowArgs} args - Arguments to find a Post + * @example + * // Get one Post + * const post = await prisma.post.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Posts 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 {PostFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Posts + * const posts = await prisma.post.findMany() + * + * // Get first 10 Posts + * const posts = await prisma.post.findMany({ take: 10 }) + * + * // Only select the `id` + * const postWithIdOnly = await prisma.post.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a Post. + * @param {PostCreateArgs} args - Arguments to create a Post. + * @example + * // Create one Post + * const Post = await prisma.post.create({ + * data: { + * // ... data to create a Post + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Posts. + * @param {PostCreateManyArgs} args - Arguments to create many Posts. + * @example + * // Create many Posts + * const post = await prisma.post.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Posts and returns the data saved in the database. + * @param {PostCreateManyAndReturnArgs} args - Arguments to create many Posts. + * @example + * // Create many Posts + * const post = await prisma.post.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Posts and only return the `id` + * const postWithIdOnly = await prisma.post.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a Post. + * @param {PostDeleteArgs} args - Arguments to delete one Post. + * @example + * // Delete one Post + * const Post = await prisma.post.delete({ + * where: { + * // ... filter to delete one Post + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one Post. + * @param {PostUpdateArgs} args - Arguments to update one Post. + * @example + * // Update one Post + * const post = await prisma.post.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Posts. + * @param {PostDeleteManyArgs} args - Arguments to filter Posts to delete. + * @example + * // Delete a few Posts + * const { count } = await prisma.post.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Posts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Posts + * const post = await prisma.post.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Posts and returns the data updated in the database. + * @param {PostUpdateManyAndReturnArgs} args - Arguments to update many Posts. + * @example + * // Update many Posts + * const post = await prisma.post.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Posts and only return the `id` + * const postWithIdOnly = await prisma.post.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one Post. + * @param {PostUpsertArgs} args - Arguments to update or create a Post. + * @example + * // Update or create a Post + * const post = await prisma.post.upsert({ + * create: { + * // ... data to create a Post + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the Post we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__PostClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Posts. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostCountArgs} args - Arguments to filter Posts to count. + * @example + * // Count the number of Posts + * const count = await prisma.post.count({ + * where: { + * // ... the filter for the Posts we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a Post. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by Post. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {PostGroupByArgs} 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 PostGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: PostGroupByArgs['orderBy'] } + : { orderBy?: PostGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetPostGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the Post model + */ +readonly fields: PostFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for Post. + * 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 interface Prisma__PostClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + author = {}>(args?: Prisma.Subset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions> | Null, Null, ExtArgs, GlobalOmitOptions> + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the Post model + */ +export interface PostFieldRefs { + readonly id: Prisma.FieldRef<"Post", 'Int'> + readonly title: Prisma.FieldRef<"Post", 'String'> + readonly content: Prisma.FieldRef<"Post", 'String'> + readonly published: Prisma.FieldRef<"Post", 'Boolean'> + readonly authorId: Prisma.FieldRef<"Post", 'Int'> +} + + +// Custom InputTypes +/** + * Post findUnique + */ +export type PostFindUniqueArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post findUniqueOrThrow + */ +export type PostFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post findFirst + */ +export type PostFindFirstArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Posts. + */ + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post findFirstOrThrow + */ +export type PostFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Post to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Posts. + */ + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post findMany + */ +export type PostFindManyArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter, which Posts to fetch. + */ + where?: Prisma.PostWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Posts to fetch. + */ + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Posts. + */ + cursor?: Prisma.PostWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Posts 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` Posts. + */ + skip?: number + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * Post create + */ +export type PostCreateArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The data needed to create a Post. + */ + data: Prisma.XOR +} + +/** + * Post createMany + */ +export type PostCreateManyArgs = { + /** + * The data used to create many Posts. + */ + data: Prisma.PostCreateManyInput | Prisma.PostCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * Post createManyAndReturn + */ +export type PostCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelectCreateManyAndReturn | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * The data used to create many Posts. + */ + data: Prisma.PostCreateManyInput | Prisma.PostCreateManyInput[] + skipDuplicates?: boolean + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostIncludeCreateManyAndReturn | null +} + +/** + * Post update + */ +export type PostUpdateArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The data needed to update a Post. + */ + data: Prisma.XOR + /** + * Choose, which Post to update. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post updateMany + */ +export type PostUpdateManyArgs = { + /** + * The data used to update Posts. + */ + data: Prisma.XOR + /** + * Filter which Posts to update + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to update. + */ + limit?: number +} + +/** + * Post updateManyAndReturn + */ +export type PostUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * The data used to update Posts. + */ + data: Prisma.XOR + /** + * Filter which Posts to update + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to update. + */ + limit?: number + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostIncludeUpdateManyAndReturn | null +} + +/** + * Post upsert + */ +export type PostUpsertArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * The filter to search for the Post to update in case it exists. + */ + where: Prisma.PostWhereUniqueInput + /** + * In case the Post found by the `where` argument doesn't exist, create a new Post with this data. + */ + create: Prisma.XOR + /** + * In case the Post was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * Post delete + */ +export type PostDeleteArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + /** + * Filter which Post to delete. + */ + where: Prisma.PostWhereUniqueInput +} + +/** + * Post deleteMany + */ +export type PostDeleteManyArgs = { + /** + * Filter which Posts to delete + */ + where?: Prisma.PostWhereInput + /** + * Limit how many Posts to delete. + */ + limit?: number +} + +/** + * Post without action + */ +export type PostDefaultArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null +} diff --git a/orm/nuxt-prisma-module/prisma/generated/prisma/models/User.ts b/orm/nuxt-prisma-module/prisma/generated/prisma/models/User.ts new file mode 100644 index 000000000000..4dcf102ace3e --- /dev/null +++ b/orm/nuxt-prisma-module/prisma/generated/prisma/models/User.ts @@ -0,0 +1,1312 @@ + +/* !!! This is code generated by Prisma. Do not edit directly. !!! */ +/* eslint-disable */ +// @ts-nocheck +/* + * This file exports the `User` model and its related types. + * + * 🟢 You can import this file directly. + */ +import type * as runtime from "@prisma/client/runtime/client" +import type * as $Enums from "../enums.js" +import type * as Prisma from "../internal/prismaNamespace.js" + +/** + * Model User + * + */ +export type UserModel = runtime.Types.Result.DefaultSelection + +export type AggregateUser = { + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +export type UserAvgAggregateOutputType = { + id: number | null +} + +export type UserSumAggregateOutputType = { + id: number | null +} + +export type UserMinAggregateOutputType = { + id: number | null + email: string | null + name: string | null +} + +export type UserMaxAggregateOutputType = { + id: number | null + email: string | null + name: string | null +} + +export type UserCountAggregateOutputType = { + id: number + email: number + name: number + _all: number +} + + +export type UserAvgAggregateInputType = { + id?: true +} + +export type UserSumAggregateInputType = { + id?: true +} + +export type UserMinAggregateInputType = { + id?: true + email?: true + name?: true +} + +export type UserMaxAggregateInputType = { + id?: true + email?: true + name?: true +} + +export type UserCountAggregateInputType = { + id?: true + email?: true + name?: true + _all?: true +} + +export type UserAggregateArgs = { + /** + * Filter which User to aggregate. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the start position + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Count returned Users + **/ + _count?: true | UserCountAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to average + **/ + _avg?: UserAvgAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to sum + **/ + _sum?: UserSumAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the minimum value + **/ + _min?: UserMinAggregateInputType + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/aggregations Aggregation Docs} + * + * Select which fields to find the maximum value + **/ + _max?: UserMaxAggregateInputType +} + +export type GetUserAggregateType = { + [P in keyof T & keyof AggregateUser]: P extends '_count' | 'count' + ? T[P] extends true + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType +} + + + + +export type UserGroupByArgs = { + where?: Prisma.UserWhereInput + orderBy?: Prisma.UserOrderByWithAggregationInput | Prisma.UserOrderByWithAggregationInput[] + by: Prisma.UserScalarFieldEnum[] | Prisma.UserScalarFieldEnum + having?: Prisma.UserScalarWhereWithAggregatesInput + take?: number + skip?: number + _count?: UserCountAggregateInputType | true + _avg?: UserAvgAggregateInputType + _sum?: UserSumAggregateInputType + _min?: UserMinAggregateInputType + _max?: UserMaxAggregateInputType +} + +export type UserGroupByOutputType = { + id: number + email: string + name: string | null + _count: UserCountAggregateOutputType | null + _avg: UserAvgAggregateOutputType | null + _sum: UserSumAggregateOutputType | null + _min: UserMinAggregateOutputType | null + _max: UserMaxAggregateOutputType | null +} + +type GetUserGroupByPayload = Prisma.PrismaPromise< + Array< + Prisma.PickEnumerable & + { + [P in ((keyof T) & (keyof UserGroupByOutputType))]: P extends '_count' + ? T[P] extends boolean + ? number + : Prisma.GetScalarType + : Prisma.GetScalarType + } + > + > + + + +export type UserWhereInput = { + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + id?: Prisma.IntFilter<"User"> | number + email?: Prisma.StringFilter<"User"> | string + name?: Prisma.StringNullableFilter<"User"> | string | null + posts?: Prisma.PostListRelationFilter +} + +export type UserOrderByWithRelationInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + posts?: Prisma.PostOrderByRelationAggregateInput +} + +export type UserWhereUniqueInput = Prisma.AtLeast<{ + id?: number + email?: string + AND?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + OR?: Prisma.UserWhereInput[] + NOT?: Prisma.UserWhereInput | Prisma.UserWhereInput[] + name?: Prisma.StringNullableFilter<"User"> | string | null + posts?: Prisma.PostListRelationFilter +}, "id" | "email"> + +export type UserOrderByWithAggregationInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrderInput | Prisma.SortOrder + _count?: Prisma.UserCountOrderByAggregateInput + _avg?: Prisma.UserAvgOrderByAggregateInput + _max?: Prisma.UserMaxOrderByAggregateInput + _min?: Prisma.UserMinOrderByAggregateInput + _sum?: Prisma.UserSumOrderByAggregateInput +} + +export type UserScalarWhereWithAggregatesInput = { + AND?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + OR?: Prisma.UserScalarWhereWithAggregatesInput[] + NOT?: Prisma.UserScalarWhereWithAggregatesInput | Prisma.UserScalarWhereWithAggregatesInput[] + id?: Prisma.IntWithAggregatesFilter<"User"> | number + email?: Prisma.StringWithAggregatesFilter<"User"> | string + name?: Prisma.StringNullableWithAggregatesFilter<"User"> | string | null +} + +export type UserCreateInput = { + email: string + name?: string | null + posts?: Prisma.PostCreateNestedManyWithoutAuthorInput +} + +export type UserUncheckedCreateInput = { + id?: number + email: string + name?: string | null + posts?: Prisma.PostUncheckedCreateNestedManyWithoutAuthorInput +} + +export type UserUpdateInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + posts?: Prisma.PostUpdateManyWithoutAuthorNestedInput +} + +export type UserUncheckedUpdateInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + posts?: Prisma.PostUncheckedUpdateManyWithoutAuthorNestedInput +} + +export type UserCreateManyInput = { + id?: number + email: string + name?: string | null +} + +export type UserUpdateManyMutationInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateManyInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserCountOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserAvgOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type UserMaxOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserMinOrderByAggregateInput = { + id?: Prisma.SortOrder + email?: Prisma.SortOrder + name?: Prisma.SortOrder +} + +export type UserSumOrderByAggregateInput = { + id?: Prisma.SortOrder +} + +export type UserScalarRelationFilter = { + is?: Prisma.UserWhereInput + isNot?: Prisma.UserWhereInput +} + +export type StringFieldUpdateOperationsInput = { + set?: string +} + +export type NullableStringFieldUpdateOperationsInput = { + set?: string | null +} + +export type IntFieldUpdateOperationsInput = { + set?: number + increment?: number + decrement?: number + multiply?: number + divide?: number +} + +export type UserCreateNestedOneWithoutPostsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutPostsInput + connect?: Prisma.UserWhereUniqueInput +} + +export type UserUpdateOneRequiredWithoutPostsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UserCreateOrConnectWithoutPostsInput + upsert?: Prisma.UserUpsertWithoutPostsInput + connect?: Prisma.UserWhereUniqueInput + update?: Prisma.XOR, Prisma.UserUncheckedUpdateWithoutPostsInput> +} + +export type UserCreateWithoutPostsInput = { + email: string + name?: string | null +} + +export type UserUncheckedCreateWithoutPostsInput = { + id?: number + email: string + name?: string | null +} + +export type UserCreateOrConnectWithoutPostsInput = { + where: Prisma.UserWhereUniqueInput + create: Prisma.XOR +} + +export type UserUpsertWithoutPostsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UserWhereInput +} + +export type UserUpdateToOneWithWhereWithoutPostsInput = { + where?: Prisma.UserWhereInput + data: Prisma.XOR +} + +export type UserUpdateWithoutPostsInput = { + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + +export type UserUncheckedUpdateWithoutPostsInput = { + id?: Prisma.IntFieldUpdateOperationsInput | number + email?: Prisma.StringFieldUpdateOperationsInput | string + name?: Prisma.NullableStringFieldUpdateOperationsInput | string | null +} + + +/** + * Count Type UserCountOutputType + */ + +export type UserCountOutputType = { + posts: number +} + +export type UserCountOutputTypeSelect = { + posts?: boolean | UserCountOutputTypeCountPostsArgs +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeDefaultArgs = { + /** + * Select specific fields to fetch from the UserCountOutputType + */ + select?: Prisma.UserCountOutputTypeSelect | null +} + +/** + * UserCountOutputType without action + */ +export type UserCountOutputTypeCountPostsArgs = { + where?: Prisma.PostWhereInput +} + + +export type UserSelect = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean + posts?: boolean | Prisma.User$postsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +}, ExtArgs["result"]["user"]> + +export type UserSelectCreateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectUpdateManyAndReturn = runtime.Types.Extensions.GetSelect<{ + id?: boolean + email?: boolean + name?: boolean +}, ExtArgs["result"]["user"]> + +export type UserSelectScalar = { + id?: boolean + email?: boolean + name?: boolean +} + +export type UserOmit = runtime.Types.Extensions.GetOmit<"id" | "email" | "name", ExtArgs["result"]["user"]> +export type UserInclude = { + posts?: boolean | Prisma.User$postsArgs + _count?: boolean | Prisma.UserCountOutputTypeDefaultArgs +} +export type UserIncludeCreateManyAndReturn = {} +export type UserIncludeUpdateManyAndReturn = {} + +export type $UserPayload = { + name: "User" + objects: { + posts: Prisma.$PostPayload[] + } + scalars: runtime.Types.Extensions.GetPayloadResult<{ + id: number + email: string + name: string | null + }, ExtArgs["result"]["user"]> + composites: {} +} + +export type UserGetPayload = runtime.Types.Result.GetResult + +export type UserCountArgs = + Omit & { + select?: UserCountAggregateInputType | true + } + +export interface UserDelegate { + [K: symbol]: { types: Prisma.TypeMap['model']['User'], meta: { name: 'User' } } + /** + * Find zero or one User that matches the filter. + * @param {UserFindUniqueArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUnique({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUnique(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUnique", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find one User that matches the filter or throw an error with `error.code='P2025'` + * if no matches were found. + * @param {UserFindUniqueOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findUniqueOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findUniqueOrThrow(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findUniqueOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User 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 {UserFindFirstArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirst({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirst(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirst", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> + + /** + * Find the first User that matches the filter or + * throw `PrismaKnownClientError` with `P2025` code 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 {UserFindFirstOrThrowArgs} args - Arguments to find a User + * @example + * // Get one User + * const user = await prisma.user.findFirstOrThrow({ + * where: { + * // ... provide filter here + * } + * }) + */ + findFirstOrThrow(args?: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "findFirstOrThrow", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Find zero or more Users 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 {UserFindManyArgs} args - Arguments to filter and select certain fields only. + * @example + * // Get all Users + * const users = await prisma.user.findMany() + * + * // Get first 10 Users + * const users = await prisma.user.findMany({ take: 10 }) + * + * // Only select the `id` + * const userWithIdOnly = await prisma.user.findMany({ select: { id: true } }) + * + */ + findMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions>> + + /** + * Create a User. + * @param {UserCreateArgs} args - Arguments to create a User. + * @example + * // Create one User + * const User = await prisma.user.create({ + * data: { + * // ... data to create a User + * } + * }) + * + */ + create(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "create", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Create many Users. + * @param {UserCreateManyArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createMany({ + * data: [ + * // ... provide data here + * ] + * }) + * + */ + createMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Create many Users and returns the data saved in the database. + * @param {UserCreateManyAndReturnArgs} args - Arguments to create many Users. + * @example + * // Create many Users + * const user = await prisma.user.createManyAndReturn({ + * data: [ + * // ... provide data here + * ] + * }) + * + * // Create many Users and only return the `id` + * const userWithIdOnly = await prisma.user.createManyAndReturn({ + * select: { id: true }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + createManyAndReturn(args?: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "createManyAndReturn", GlobalOmitOptions>> + + /** + * Delete a User. + * @param {UserDeleteArgs} args - Arguments to delete one User. + * @example + * // Delete one User + * const User = await prisma.user.delete({ + * where: { + * // ... filter to delete one User + * } + * }) + * + */ + delete(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "delete", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Update one User. + * @param {UserUpdateArgs} args - Arguments to update one User. + * @example + * // Update one User + * const user = await prisma.user.update({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + update(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "update", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + /** + * Delete zero or more Users. + * @param {UserDeleteManyArgs} args - Arguments to filter Users to delete. + * @example + * // Delete a few Users + * const { count } = await prisma.user.deleteMany({ + * where: { + * // ... provide filter here + * } + * }) + * + */ + deleteMany(args?: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserUpdateManyArgs} args - Arguments to update one or more rows. + * @example + * // Update many Users + * const user = await prisma.user.updateMany({ + * where: { + * // ... provide filter here + * }, + * data: { + * // ... provide data here + * } + * }) + * + */ + updateMany(args: Prisma.SelectSubset>): Prisma.PrismaPromise + + /** + * Update zero or more Users and returns the data updated in the database. + * @param {UserUpdateManyAndReturnArgs} args - Arguments to update many Users. + * @example + * // Update many Users + * const user = await prisma.user.updateManyAndReturn({ + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * + * // Update zero or more Users and only return the `id` + * const userWithIdOnly = await prisma.user.updateManyAndReturn({ + * select: { id: true }, + * where: { + * // ... provide filter here + * }, + * data: [ + * // ... provide data here + * ] + * }) + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * + */ + updateManyAndReturn(args: Prisma.SelectSubset>): Prisma.PrismaPromise, T, "updateManyAndReturn", GlobalOmitOptions>> + + /** + * Create or update one User. + * @param {UserUpsertArgs} args - Arguments to update or create a User. + * @example + * // Update or create a User + * const user = await prisma.user.upsert({ + * create: { + * // ... data to create a User + * }, + * update: { + * // ... in case it already exists, update + * }, + * where: { + * // ... the filter for the User we want to update + * } + * }) + */ + upsert(args: Prisma.SelectSubset>): Prisma.Prisma__UserClient, T, "upsert", GlobalOmitOptions>, never, ExtArgs, GlobalOmitOptions> + + + /** + * Count the number of Users. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserCountArgs} args - Arguments to filter Users to count. + * @example + * // Count the number of Users + * const count = await prisma.user.count({ + * where: { + * // ... the filter for the Users we want to count + * } + * }) + **/ + count( + args?: Prisma.Subset, + ): Prisma.PrismaPromise< + T extends runtime.Types.Utils.Record<'select', any> + ? T['select'] extends true + ? number + : Prisma.GetScalarType + : number + > + + /** + * Allows you to perform aggregations operations on a User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserAggregateArgs} 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: Prisma.Subset): Prisma.PrismaPromise> + + /** + * Group by User. + * Note, that providing `undefined` is treated as the value not being there. + * Read more here: https://pris.ly/d/null-undefined + * @param {UserGroupByArgs} 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 UserGroupByArgs, + HasSelectOrTake extends Prisma.Or< + Prisma.Extends<'skip', Prisma.Keys>, + Prisma.Extends<'take', Prisma.Keys> + >, + OrderByArg extends Prisma.True extends HasSelectOrTake + ? { orderBy: UserGroupByArgs['orderBy'] } + : { orderBy?: UserGroupByArgs['orderBy'] }, + OrderFields extends Prisma.ExcludeUnderscoreKeys>>, + ByFields extends Prisma.MaybeTupleToUnion, + ByValid extends Prisma.Has, + HavingFields extends Prisma.GetHavingFields, + HavingValid extends Prisma.Has, + ByEmpty extends T['by'] extends never[] ? Prisma.True : Prisma.False, + InputErrors extends ByEmpty extends Prisma.True + ? `Error: "by" must not be empty.` + : HavingValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.Keys + ? 'orderBy' extends Prisma.Keys + ? ByValid extends Prisma.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 Prisma.True + ? {} + : { + [P in OrderFields]: P extends ByFields + ? never + : `Error: Field "${P}" in "orderBy" needs to be provided in "by"` + }[OrderFields] + >(args: Prisma.SubsetIntersection & InputErrors): {} extends InputErrors ? GetUserGroupByPayload : Prisma.PrismaPromise +/** + * Fields of the User model + */ +readonly fields: UserFieldRefs; +} + +/** + * The delegate class that acts as a "Promise-like" for User. + * 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 interface Prisma__UserClient extends Prisma.PrismaPromise { + readonly [Symbol.toStringTag]: "PrismaPromise" + posts = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise + /** + * 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): runtime.Types.Utils.JsPromise +} + + + + +/** + * Fields of the User model + */ +export interface UserFieldRefs { + readonly id: Prisma.FieldRef<"User", 'Int'> + readonly email: Prisma.FieldRef<"User", 'String'> + readonly name: Prisma.FieldRef<"User", 'String'> +} + + +// Custom InputTypes +/** + * User findUnique + */ +export type UserFindUniqueArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findUniqueOrThrow + */ +export type UserFindUniqueOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User findFirst + */ +export type UserFindFirstArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findFirstOrThrow + */ +export type UserFindFirstOrThrowArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which User to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for searching for Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/distinct Distinct Docs} + * + * Filter by unique combinations of Users. + */ + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User findMany + */ +export type UserFindManyArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter, which Users to fetch. + */ + where?: Prisma.UserWhereInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/sorting Sorting Docs} + * + * Determine the order of Users to fetch. + */ + orderBy?: Prisma.UserOrderByWithRelationInput | Prisma.UserOrderByWithRelationInput[] + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination#cursor-based-pagination Cursor Docs} + * + * Sets the position for listing Users. + */ + cursor?: Prisma.UserWhereUniqueInput + /** + * {@link https://www.prisma.io/docs/concepts/components/prisma-client/pagination Pagination Docs} + * + * Take `±n` Users 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` Users. + */ + skip?: number + distinct?: Prisma.UserScalarFieldEnum | Prisma.UserScalarFieldEnum[] +} + +/** + * User create + */ +export type UserCreateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to create a User. + */ + data: Prisma.XOR +} + +/** + * User createMany + */ +export type UserCreateManyArgs = { + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User createManyAndReturn + */ +export type UserCreateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectCreateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to create many Users. + */ + data: Prisma.UserCreateManyInput | Prisma.UserCreateManyInput[] + skipDuplicates?: boolean +} + +/** + * User update + */ +export type UserUpdateArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The data needed to update a User. + */ + data: Prisma.XOR + /** + * Choose, which User to update. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User updateMany + */ +export type UserUpdateManyArgs = { + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User updateManyAndReturn + */ +export type UserUpdateManyAndReturnArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelectUpdateManyAndReturn | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * The data used to update Users. + */ + data: Prisma.XOR + /** + * Filter which Users to update + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to update. + */ + limit?: number +} + +/** + * User upsert + */ +export type UserUpsertArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * The filter to search for the User to update in case it exists. + */ + where: Prisma.UserWhereUniqueInput + /** + * In case the User found by the `where` argument doesn't exist, create a new User with this data. + */ + create: Prisma.XOR + /** + * In case the User was found with the provided `where` argument, update it with this data. + */ + update: Prisma.XOR +} + +/** + * User delete + */ +export type UserDeleteArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null + /** + * Filter which User to delete. + */ + where: Prisma.UserWhereUniqueInput +} + +/** + * User deleteMany + */ +export type UserDeleteManyArgs = { + /** + * Filter which Users to delete + */ + where?: Prisma.UserWhereInput + /** + * Limit how many Users to delete. + */ + limit?: number +} + +/** + * User.posts + */ +export type User$postsArgs = { + /** + * Select specific fields to fetch from the Post + */ + select?: Prisma.PostSelect | null + /** + * Omit specific fields from the Post + */ + omit?: Prisma.PostOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.PostInclude | null + where?: Prisma.PostWhereInput + orderBy?: Prisma.PostOrderByWithRelationInput | Prisma.PostOrderByWithRelationInput[] + cursor?: Prisma.PostWhereUniqueInput + take?: number + skip?: number + distinct?: Prisma.PostScalarFieldEnum | Prisma.PostScalarFieldEnum[] +} + +/** + * User without action + */ +export type UserDefaultArgs = { + /** + * Select specific fields to fetch from the User + */ + select?: Prisma.UserSelect | null + /** + * Omit specific fields from the User + */ + omit?: Prisma.UserOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.UserInclude | null +} diff --git a/orm/nuxt-prisma-module/prisma/schema.prisma b/orm/nuxt-prisma-module/prisma/schema.prisma index df12926df86d..6d824945fd81 100644 --- a/orm/nuxt-prisma-module/prisma/schema.prisma +++ b/orm/nuxt-prisma-module/prisma/schema.prisma @@ -2,11 +2,13 @@ // learn more about it in the docs: https://pris.ly/d/prisma-schema generator client { - provider = "prisma-client-js" + provider = "prisma-client" + engineType = "client" + output = "./generated/prisma" } datasource db { - provider = "sqlite" + provider = "postgresql" url = env("DATABASE_URL") } diff --git a/orm/nuxt-prisma-module/prisma/seed.js b/orm/nuxt-prisma-module/prisma/seed.ts similarity index 82% rename from orm/nuxt-prisma-module/prisma/seed.js rename to orm/nuxt-prisma-module/prisma/seed.ts index 2368fbbe3e7a..743d0485d9fb 100644 --- a/orm/nuxt-prisma-module/prisma/seed.js +++ b/orm/nuxt-prisma-module/prisma/seed.ts @@ -1,6 +1,4 @@ -const { PrismaClient } = require('@prisma/client') - -const prisma = new PrismaClient() +import prisma from "../lib/prisma" const userData = [ { @@ -25,7 +23,6 @@ const userData = [ title: 'Follow Prisma on Twitter', content: 'https://www.twitter.com/prisma', published: true, - viewCount: 42, }, ], }, @@ -39,7 +36,6 @@ const userData = [ title: 'Ask a question about Prisma on GitHub', content: 'https://www.github.com/prisma/prisma/discussions', published: true, - viewCount: 128, }, { title: 'Prisma on YouTube', @@ -53,10 +49,12 @@ const userData = [ async function main() { console.log(`Start seeding ...`) for (const u of userData) { - const user = await prisma.user.create({ - data: u, + const user = await prisma.user.upsert({ + where: { email: u.email }, + update: {}, + create: u, }) - console.log(`Created user with id: ${user.id}`) + console.log(`Created/updated user with id: ${user.id}`) } console.log(`Seeding finished.`) } diff --git a/orm/nuxt-prisma-module/server/api/user-exists.ts b/orm/nuxt-prisma-module/server/api/user-exists.ts index 06e9e9b2609e..bbf3b5b914a2 100644 --- a/orm/nuxt-prisma-module/server/api/user-exists.ts +++ b/orm/nuxt-prisma-module/server/api/user-exists.ts @@ -1,4 +1,5 @@ -import prisma from '~/lib/prisma' +import prisma from "../../lib/prisma" + export default eventHandler(async () => { const user = await prisma.user.exists({ diff --git a/orm/nuxt-prisma-module/tsconfig.json b/orm/nuxt-prisma-module/tsconfig.json index a746f2a70c28..01c1320c78db 100644 --- a/orm/nuxt-prisma-module/tsconfig.json +++ b/orm/nuxt-prisma-module/tsconfig.json @@ -1,4 +1,18 @@ { // https://nuxt.com/docs/guide/concepts/typescript - "extends": "./.nuxt/tsconfig.json" -} + "files": [], + "references": [ + { + "path": "./.nuxt/tsconfig.app.json" + }, + { + "path": "./.nuxt/tsconfig.server.json" + }, + { + "path": "./.nuxt/tsconfig.shared.json" + }, + { + "path": "./.nuxt/tsconfig.node.json" + } + ] +} \ No newline at end of file diff --git a/orm/nuxt/.env.example b/orm/nuxt/.env.example new file mode 100644 index 000000000000..4cc714a24dc5 --- /dev/null +++ b/orm/nuxt/.env.example @@ -0,0 +1 @@ +DATABASE_URL= \ No newline at end of file From 5763c56fec8e3168d4619942091a6023f16b9a68 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Tue, 7 Oct 2025 21:23:36 +0530 Subject: [PATCH 07/13] test with lts --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index a77793ecc520..a24992d1ca61 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/hydrogen +lts From e255e7476a45226719f047b6c066b02b8462a44e Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Tue, 7 Oct 2025 21:26:36 +0530 Subject: [PATCH 08/13] Revert "test with lts" This reverts commit 5763c56fec8e3168d4619942091a6023f16b9a68. --- .nvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nvmrc b/.nvmrc index a24992d1ca61..a77793ecc520 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts +lts/hydrogen From f3c51c1c423a6bb17e55d14572657e5a8f4fe93b Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 8 Oct 2025 09:50:30 +0530 Subject: [PATCH 09/13] test: comment seed command --- .github/tests/orm/nuxt/run.sh | 2 +- .nvmrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/tests/orm/nuxt/run.sh b/.github/tests/orm/nuxt/run.sh index ae5fbe2f90d5..97957c962dba 100644 --- a/.github/tests/orm/nuxt/run.sh +++ b/.github/tests/orm/nuxt/run.sh @@ -54,7 +54,7 @@ popd > /dev/null # Back to orm/nuxt # Run migration + seed npx prisma migrate dev --name init -npx prisma db seed +# npx prisma db seed temporary disabled # Start the app echo "🧪 Starting Nuxt app..." diff --git a/.nvmrc b/.nvmrc index a77793ecc520..209e3ef4b624 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -lts/hydrogen +20 From 3206fcb6f9422513520eabf8058e0e9c9e20f03b Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 8 Oct 2025 09:56:22 +0530 Subject: [PATCH 10/13] Revert "test: comment seed command" This reverts commit f3c51c1c423a6bb17e55d14572657e5a8f4fe93b. --- .github/tests/orm/nuxt/run.sh | 2 +- .nvmrc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/tests/orm/nuxt/run.sh b/.github/tests/orm/nuxt/run.sh index 97957c962dba..ae5fbe2f90d5 100644 --- a/.github/tests/orm/nuxt/run.sh +++ b/.github/tests/orm/nuxt/run.sh @@ -54,7 +54,7 @@ popd > /dev/null # Back to orm/nuxt # Run migration + seed npx prisma migrate dev --name init -# npx prisma db seed temporary disabled +npx prisma db seed # Start the app echo "🧪 Starting Nuxt app..." diff --git a/.nvmrc b/.nvmrc index 209e3ef4b624..a77793ecc520 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 +lts/hydrogen From e9ef7471fa3298b0de8ed4d9c7d9bb9e11a4cb76 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 8 Oct 2025 09:57:45 +0530 Subject: [PATCH 11/13] test: add prisma generate command --- .github/tests/orm/nuxt/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/tests/orm/nuxt/run.sh b/.github/tests/orm/nuxt/run.sh index ae5fbe2f90d5..65034f2408b0 100644 --- a/.github/tests/orm/nuxt/run.sh +++ b/.github/tests/orm/nuxt/run.sh @@ -54,6 +54,7 @@ popd > /dev/null # Back to orm/nuxt # Run migration + seed npx prisma migrate dev --name init +npx prisma generate npx prisma db seed # Start the app From 09bc17d8fa987126f4be7e93ea62f34945becf64 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 8 Oct 2025 10:04:27 +0530 Subject: [PATCH 12/13] test: remove accelerate in seed.ts --- orm/nuxt/prisma/seed.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/orm/nuxt/prisma/seed.ts b/orm/nuxt/prisma/seed.ts index 7fd34e049066..a10f485a460a 100644 --- a/orm/nuxt/prisma/seed.ts +++ b/orm/nuxt/prisma/seed.ts @@ -1,7 +1,6 @@ import { PrismaClient } from '../prisma/generated/prisma/client' -import { withAccelerate } from '@prisma/extension-accelerate' -const prisma = new PrismaClient().$extends(withAccelerate()) +const prisma = new PrismaClient() const userData = [ { From 88075c07c3718ed77103ed8ea78cbda9475c73a5 Mon Sep 17 00:00:00 2001 From: Aman Varshney Date: Wed, 8 Oct 2025 10:10:06 +0530 Subject: [PATCH 13/13] Revert This reverts commit 09bc17d8fa987126f4be7e93ea62f34945becf64. --- .github/tests/orm/nuxt/run.sh | 1 - orm/nuxt/prisma/seed.ts | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/tests/orm/nuxt/run.sh b/.github/tests/orm/nuxt/run.sh index 65034f2408b0..ae5fbe2f90d5 100644 --- a/.github/tests/orm/nuxt/run.sh +++ b/.github/tests/orm/nuxt/run.sh @@ -54,7 +54,6 @@ popd > /dev/null # Back to orm/nuxt # Run migration + seed npx prisma migrate dev --name init -npx prisma generate npx prisma db seed # Start the app diff --git a/orm/nuxt/prisma/seed.ts b/orm/nuxt/prisma/seed.ts index a10f485a460a..7fd34e049066 100644 --- a/orm/nuxt/prisma/seed.ts +++ b/orm/nuxt/prisma/seed.ts @@ -1,6 +1,7 @@ import { PrismaClient } from '../prisma/generated/prisma/client' +import { withAccelerate } from '@prisma/extension-accelerate' -const prisma = new PrismaClient() +const prisma = new PrismaClient().$extends(withAccelerate()) const userData = [ {