Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/store-postgres / PostgresQuotaLimiterOptions

Interface: PostgresQuotaLimiterOptions

Defined in: packages/store-postgres/src/quota.ts:204

Properties

PropertyTypeDescriptionDefined in
acceptRulesUpdate?booleanRules rotation opt-in: rewrite the schema's recorded rules fingerprint with this instance's own at boot instead of refusing on a mismatch. Procedure: enable on the NEW deployment, roll every host to the new rule set, then remove the flag so drift is refused again. Default false.packages/store-postgres/src/quota.ts:243
admissionDeadlineMs?numberBound on one whole admission path (bootstrap, pool checkout, and the admission transaction together); default QUOTA_ADMISSION_DEADLINE_MS (5000). Must be an integer strictly greater than QUOTA_LOCK_TIMEOUT_MS, which bounds only the lock-wait stage inside it. Expiry throws QuotaDeadlineError into the engine's onLimiterError policy and destroys the connection the refused call held.packages/store-postgres/src/quota.ts:235
max?numberPool size ceiling; default 10. Admissions are short transactions.packages/store-postgres/src/quota.ts:225
now?() => numberInjectable clock for window tests.packages/store-postgres/src/quota.ts:245
rulesreadonly QuotaRule[]The shared rule set; must be identical across hosts. Enforced: the schema records quotaRulesFingerprint(rules) on first boot, and an instance whose fingerprint differs is refused with a typed ConfigError naming both hashes.packages/store-postgres/src/quota.ts:223
schema?stringSchema holding the two quota tables; default public. A non-public schema is created on boot. Must be a plain SQL identifier.packages/store-postgres/src/quota.ts:216
urlstringA postgres connection string shared by every coordinating process and host (the database may also hold a PostgresStore; the tables do not collide).packages/store-postgres/src/quota.ts:210