Expand description
Read-only access to the databases a user has registered.
The read-safe half of the database layer, and the one an agent reaches. It
can list connections, read a catalog, and sample rows; it cannot change
anything. Everything that can is in nomoreide-actions, behind a per
connection unlock and an affected-rows preview a human has to look at.
Two things here are load-bearing rather than cosmetic. A connection URL is masked before it leaves this module, because a registered database’s URL carries its password and the agent asking for the list has no business reading it. And a column whose name suggests a secret is replaced with bullets in a sample, so a peek at a users table does not hand back everyone’s password hash.
Moved out of the Tauri command module; the desktop app now calls in here.
Structs§
- Catalog
Capabilities - Catalog
Object - Column
Info - Detected
Connection - One connection string found in a service’s
.env. - Export
Writer - Builds an export a chunk at a time.
- Named
Definition - Object
Details - Object
Rows - Query
Result - RowBrowse
Query - RowFilter
- RowSort
- Table
Ref - A table or view as the tool listing spells it.
Enums§
- Export
Format - The two formats the route offers, matched exactly –
CSVis notcsv. - Query
Outcome - What
querycame back with.
Constants§
- DEFAULT_
ROW_ LIMIT - The default row cap. Both
sampleandqueryshare it.
Functions§
- capabilities
- Which object kinds and table details this engine can be asked about.
- columns_
for - connection
- The connection a name refers to, or a refusal naming it.
- content_
disposition - The header that makes a browser save the file rather than show it.
- csv_
cell - One CSV cell.
- detect_
from_ env - Scan registered services’
.envfiles for anything that looks like a connection string. - driver_
message - What the database itself said, without sqlx’s framing around it.
- engine_
from_ url - Guess an engine from a connection string or a bare file path.
- export_
filename - What the downloaded file is called.
- export_
sql - The statement that reads an object for export, ordered so the file is the same file twice.
- first_
statement - The first statement in a caller’s text, with anything after the first
top-level
;dropped. - hex_
bytes - is_
read_ statement - Whether a statement is one this connection would have run.
- is_
sensitive_ connection_ parameter - Query-string fields that must never leave the machine in the clear.
- is_
sensitive_ preview_ column - list_
connections - Every registered connection, with its URL masked.
- list_
db_ tables - lossless_
json_ integer - mask_
url - A connection URL with its password removed.
- merge_
stored_ password - Put the stored password back into an edited connection string.
- object_
details - Columns, indexes, constraints, triggers, and a capped create script for one object named by the opaque key a listing handed out.
- objects_
for - peek_
connection - The connection a name refers to, refused in the reference’s own words.
- peek_
details - peek_
objects - The objects in one schema, or nothing when the schema is not one of this connection’s. An unknown schema is empty rather than an error: the agent asked what is in a place, and the answer is that nothing is.
- peek_
query - The same statement, answered the way an agent is answered.
- peek_
sample - Rows from one named table, with the column schema that explains them.
- peek_
schemas - peek_
tables - Every table and view this connection holds, in one flat list ordered the way a schema listing would be.
- public_
connection - One connection as every surface reports it: no raw URL, and no key at all for a project path the connection does not have. An absent field and a null one read differently to whatever is on the other end.
- quote_
identifier - redact_
database_ error - Take the connection string, and any password inside it, out of an error.
- resolve_
object - The object an opaque key names, resolved only by equality against a freshly read catalog.
- row_
browse_ clauses - run_
capped_ query - One caller-written statement, capped and wrapped.
- run_
query - sample_
object - Rows from one object, with the browser’s filters and sort applied and any column that looks like a secret bulleted out.
- schemas_
for - test_
connection - Check that a connection can be reached, without saying anything about it.
- write_
staging_ guidance - What to say instead of running a write.