Skip to main content

query

Function query 

Source
pub fn query(sql: &str, params: &[Parameter]) -> Result<Rows, DactylError>
Expand description

Execute any SQL statement against the active datastore and return its rows. Reads return the matched rows; writes return any returned rows (Neon/RETURNING) or an empty Rows when the adapter surfaces no rows.

Parameters are bound by the adapter — never interpolated into the SQL. The statement is executed against the datastore selected by the ambient DATASTORE / DATASTORE_ROUTE / optional DATASTORE_TOKEN env vars.