assertReadOnlyBudget (sql/read-only-budget.ts)

libredb-studio · src/lib/db/providers/sql/read-only-budget.ts · typescript · MIT
database

* Read-only execution budget validation (#328). Shared by every provider that implements `queryReadOnly`, so the agent execution profile cannot end up with one provider validating its budget and another trusting it. The check is fail-closed: the whole call is refused unless every

// Source: https://github.com/libredb/libredb-studio | License: MIT | Copyright 2025 SEKOYA GRUP BİLİŞİM VE TEKNOLOJİ LİMİTED ŞİRKETİ
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Read-only execution budget validation (#328).
 *
 * Shared by every provider that implements `queryReadOnly`, so the agent
 * execution profile cannot end up with one provider validating its budget and
 * another trusting it. The check is fail-closed: the whole call is refused
 * unless every field is a positive integer in range.
 *
 * The upper bound matters doubly on PostgreSQL, where the timeout is
 * interpolated into `SET LOCAL statement_timeout = N` (SET takes no bind
 * parameters), so nothing that is not a positive integer may reach it.
 */

import type { DatabaseType, ReadOnlySt

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key