CoolFace
Apppublic

AK-21/Graphite-Industrial-Intelligence

sourceHugging Faceupdated 3mo agoView on Hugging Face
0likes
driver.d.ts42 linesDownload Raw Back to vercel-postgres
1import { sql } from '@vercel/postgres';2import type { Cache } from "../cache/core/cache.js";3import { entityKind } from "../entity.js";4import type { Logger } from "../logger.js";5import { PgDatabase } from "../pg-core/db.js";6import { PgDialect } from "../pg-core/index.js";7import { type RelationalSchemaConfig, type TablesRelationalConfig } from "../relations.js";8import { type DrizzleConfig } from "../utils.js";9import { type VercelPgClient, type VercelPgQueryResultHKT, VercelPgSession } from "./session.js";10export interface VercelPgDriverOptions {11    logger?: Logger;12    cache?: Cache;13}14export declare class VercelPgDriver {15    private client;16    private dialect;17    private options;18    static readonly [entityKind]: string;19    constructor(client: VercelPgClient, dialect: PgDialect, options?: VercelPgDriverOptions);20    createSession(schema: RelationalSchemaConfig<TablesRelationalConfig> | undefined): VercelPgSession<Record<string, unknown>, TablesRelationalConfig>;21}22export declare class VercelPgDatabase<TSchema extends Record<string, unknown> = Record<string, never>> extends PgDatabase<VercelPgQueryResultHKT, TSchema> {23    static readonly [entityKind]: string;24}25export declare function drizzle<TSchema extends Record<string, unknown> = Record<string, never>, TClient extends VercelPgClient = typeof sql>(...params: [] | [26    TClient27] | [28    TClient,29    DrizzleConfig<TSchema>30] | [31    (DrizzleConfig<TSchema> & ({32        client?: TClient;33    }))34]): VercelPgDatabase<TSchema> & {35    $client: VercelPgClient extends TClient ? typeof sql : TClient;36};37export declare namespace drizzle {38    function mock<TSchema extends Record<string, unknown> = Record<string, never>>(config?: DrizzleConfig<TSchema>): VercelPgDatabase<TSchema> & {39        $client: '$client is not available on drizzle.mock()';40    };41}42