Governed Read-Only Query Workspace
The Yearning v4 Query Workspace (/query) delivers audited, read-only database access without distributing plaintext database credentials.

Access Grants & Realtime Revocation
- Grant-Based Access: Query approvals authorize datasource scope, validity duration (up to 525,600 minutes), and optional export capability (
can_export), rather than approving individual SELECT queries. When query approval is disabled in/admin/settings/query, authorized users open governed sessions directly. - Instant SSE Revocation: Any frozen approver or admin can revoke an active Query Grant at any time;
GET /api/v4/events/streampushes the state change immediately to lock the frontend workspace and display the revocation reason, actor, and timestamp.
Strict Read-Only AST & Exact Quotas
- Allowed:
SELECT, read-onlyWITH ... SELECT,SHOW,DESCRIBE/DESC,EXPLAIN. - Rejected (
4007/4011): Locking reads (SELECT ... FOR UPDATE), DML/DDL statements, and unsafe multi-statement injections.
Server-Side Masking & Controlled Export
Configured sensitive columns are masked on the server before rows leave the backend, keeping raw PII out of browser responses. When can_export = true is granted for a datasource, users can stream CSV, JSONL, or browser-incremental XLSX exports with per-page authorization checks and full audit trails (no export files are stored on the server).