import { ConnectorType, IDMMF, IPrismaClientRequestRPC } from "@prisma/studio-common"; import type { DriverAdapter } from "@prisma/driver-adapter-utils"; declare class PCW { private schema; schemaPath: string; private adapter?; /** Additional env vars to inject into process.env */ private env; private resolveOverrides; /** Disregard schema, env vars etc. and use the QE Binary */ private forcePrismaBinary; /** Disregard schema, env vars etc. and use the QE Library */ private forcePrismaLibrary; /** Disallow write operations on the generated Prisma Client */ private readOnly; /** Cached stuff */ private resolvedPrismaEngines?; private dmmf?; private datasourceProvider?; private datasources?; private previewFeatures?; private directUrl?; private prismaClient?; private versions?; /** * Initializes PCW * * @param schema The Prisma schema string * @param schemaPath Location of the Prisma Schema on disk (required temporarily for in-memory Client) * @param config The PrismaConfig loaded from the prisma.config.js file * @param env KV-pair of environment variables used in the Prisma Schema * @param options * @param options.resolve Path to a custom prisma client / engines module to use * @param options.readOnly Controls if this PCW instance should block mutating requests */ constructor(schema: string, schemaPath: string, env?: Record, options?: { /** * Data sources to pass to the Prisma Client constructor. */ datasources?: Record; resolve?: { "@prisma/engines"?: string; "@prisma/client"?: string; ".prisma/client"?: string; }; forcePrismaBinary?: boolean; forcePrismaLibrary?: boolean; readOnly?: boolean; directUrl?: string; }, adapter?: DriverAdapter, versions?: { prisma?: string; queryEngine?: string; }); get schemaHash(): string; /** * Returns path to Prisma binaries, taking `resolve`s into account, and defaulting to a hard-coded path */ private resolvePrismaEngines; /** * Returns a path to a Prisma Client package, taking `resolve`s into account, and defaulting to a hard-coded path */ private resolvePrismaClient; /** * Parse the given Prisma schema string as an AST (DMMF) * * @param options * @param options.binaryPathsOverride Override the paths of the Prisma binaries used * @param options.binaryPathsOverride.queryEngine Path to the query engine binary */ getDMMF: () => Promise<{ dmmf: IDMMF; datasourceProvider: ConnectorType; previewFeatures: string[]; }>; /** * Get an in-memory instance of Prisma Client */ getPrismaClient(): Promise<{ prisma: any; PrismaClient: any; PrismaClientKnownRequestError: any; PrismaClientRustPanicError: any; PrismaClientInitializationError: any; PrismaClientValidationError: any; }>; /** * Send a Prisma query to the binary. Resolves with the response. * * @param options.query */ request: (query: IPrismaClientRequestRPC["request"]["payload"]["data"], { prisma }?: { prisma?: any; }) => Promise; private _request; } export default PCW;