import { type FumaDB } from "@executor-js/fumadb";
import { type DrizzleRuntimeProvider } from "@executor-js/fumadb/adapters/drizzle";
import { schema as fumaSchema, type RelationsMap } from "@executor-js/fumadb/schema";
import type { BlobStore } from "./blob";
import type { FumaDb, FumaTables } from "./fuma-runtime";
export type ExecutorDbProvider = DrizzleRuntimeProvider;
export type ExecutorFumaSchema<TTables extends FumaTables> = ReturnType<typeof fumaSchema<string, TTables, RelationsMap<TTables>>>;
export interface ExecutorFumaDb<TTables extends FumaTables = FumaTables> {
    readonly db: FumaDb<ExecutorFumaSchema<TTables>>;
    readonly fuma: FumaDB<ExecutorFumaSchema<TTables>[]>;
}
export interface CreateExecutorFumaDbOptions<TTables extends FumaTables = FumaTables> {
    readonly tables: TTables;
    readonly namespace: string;
    readonly version: string;
    readonly provider: ExecutorDbProvider;
    /**
     * Whether the engine supports interactive transactions (BEGIN/COMMIT).
     * Defaults to `true`. Cloudflare D1 must pass `false` — it rejects
     * interactive transactions, so the adapter runs transaction callbacks
     * directly (auto-commit per statement). libSQL/Postgres keep real
     * transactions.
     */
    readonly interactiveTransactions?: boolean;
    /**
     * Maximum bound parameters per query (Cloudflare D1: 100). When set,
     * `createMany` batches so `rows * columns` stays within it. Unset for
     * libSQL/Postgres (no tight cap).
     */
    readonly maxBoundParameters?: number;
}
/**
 * Driver-agnostic FumaDB assembly. The caller passes an already-opened drizzle
 * handle (it owns the driver, PRAGMAs, and schema bring-up); this wires the
 * fumadb client over it and returns the `{ db, fuma }` query surface.
 *
 * NOTE: the drizzle `db` must already have its runtime schema attached (via
 * `createDrizzleRuntimeSchemaFromTables`) for SQLite/Postgres relational
 * queries to resolve — that schema generation stays caller-side because it is
 * coupled to the caller's drizzle() construction.
 */
export declare const createExecutorFumaDb: <const TTables extends FumaTables>(drizzleDb: unknown, options: CreateExecutorFumaDbOptions<TTables>) => ExecutorFumaDb<TTables>;
export interface ExecutorDbHandle<TTables extends FumaTables = FumaTables> extends ExecutorFumaDb<TTables> {
    readonly close: () => Promise<void>;
    /**
     * Optional blob backend assembled alongside the driver (an R2 bucket on the
     * Cloudflare hosts). `makeScopedExecutor` threads it into
     * `createExecutor({ blobs })`; absent, the executor defaults to the FumaDB
     * `blob` table over `db`.
     */
    readonly blobs?: BlobStore;
}
//# sourceMappingURL=executor-fuma-db.d.ts.map