import type { SqlClient } from "./types.js"; /** * True only for a statement that can't write when run on its own: it starts * with SELECT/WITH and mentions no write-capable keyword or side-effecting * function. Deliberately over-broad: a read it misclassifies just keeps the * read-only transaction, so the check can only cost speed, never safety. * Read-only instances run statements that pass it as one implicit * transaction instead of BEGIN / SET TRANSACTION READ ONLY / query / COMMIT. * * Sound only for the library's own SQL, which is all that reaches it: a * deny-list can't see a volatile user/extension function that writes, so it * must never classify caller-supplied statement text. */ export declare function isPlainRead(text: string): boolean; /** * Wraps a `SqlClient` so that every transaction is marked `READ ONLY`. * PostgreSQL will reject any INSERT / UPDATE / DELETE / DDL automatically. * * Bare `query()` calls are also wrapped in a read-only transaction as a safety net. * * **Note:** `PgFileSystem.init()` performs an INSERT to create the root node, * so the workspace must be initialized with a writable client first. * * @example * ```ts * const roClient = readonlySqlClient(client); * const fs = new PgFileSystem({ db: roClient, workspaceId }); * // fs.readFile() works; fs.writeFile() throws SqlError (code 25006) * ``` */ export declare function readonlySqlClient(client: SqlClient): SqlClient; //# sourceMappingURL=readonly.d.ts.map