/** * Database admin operations. * * Pure, dialect-agnostic, RAW/UNSCOPED helpers backing the Supabase-Studio-like * DB admin. These run the FULL database with no per-user `accessFilter` * scoping. Callers MUST gate access before invoking them. The built-in core * route gates this to dev + localhost; production-reachable surfaces must pass * an explicit runtime for the target database and enforce their own admin-only * checks before reading or mutating. * * All access goes through the unified `getDbExec()` client, which uses `?` * placeholders (auto-converted to `$1,$2,…` for Postgres) and returns rows * keyed by column name. Identifiers are validated against a strict pattern and * always double-quoted; values are ALWAYS parameterized — never interpolated. */ import { type DbExec, type Dialect } from "../db/client.js"; import type { DbAdminDialect, DbAdminMutation, DbAdminMutationResult, DbAdminQueryResult, DbAdminRowsRequest, DbAdminRowsResult, DbAdminTableSchema, DbAdminTableSummary } from "./types.js"; export interface DbAdminRuntime { db?: DbExec; dialect?: Dialect; notifyChange?: () => Promise; } export declare function listTables(runtime?: DbAdminRuntime): Promise<{ dialect: DbAdminDialect; tables: DbAdminTableSummary[]; }>; export declare function getTableSchema(table: string, runtime?: DbAdminRuntime): Promise; export declare function getRows(table: string, req: DbAdminRowsRequest, runtime?: DbAdminRuntime): Promise; export declare function applyMutations(table: string, m: DbAdminMutation, runtime?: DbAdminRuntime): Promise; /** Error thrown when a destructive statement is run without confirmation. */ export declare class DbAdminConfirmRequiredError extends Error { readonly needsConfirm = true; constructor(message: string); } export declare function runSql(sql: string, params: unknown[] | undefined, opts?: { confirmDestructive?: boolean; }, runtime?: DbAdminRuntime): Promise; //# sourceMappingURL=operations.d.ts.map