# sqlite/query-async Async twin of `sqlite/query` — run a SELECT off-thread on the handle's executor. Returns a Future of materialized row maps. ## Syntax
[sqlite/query-async $db $sql ?params...]
## Parameters - `$db` — database handle - `$sql` — SELECT query - `?params...` — optional bind values, as separate args or a single `@{}` vector ## Examples
def db [sqlite/open ":memory:"]
[sqlite/exec $db "CREATE TABLE t (id INTEGER, name TEXT)"]
[sqlite/exec $db "INSERT INTO t VALUES (1, 'alice'), (2, 'bob')"]
[await [sqlite/query-async $db "SELECT * FROM t ORDER BY id"]]
# → @{%{:id 1 :name alice} %{:id 2 :name bob}}
## Returns Future; `[await ...]` yields a vector of `%{:col value}` maps. All rows are fetched on the worker and materialized before the Future resolves — the result is a plain vector, not a live cursor. NULL cells are `nil`. Worker errors resolve as `%Err{:message}`; submit-time errors (bad handle, non-string SQL) return `%Err` directly. The first async call switches the handle to async-only, so later sync `sqlite/*` calls on it return `%Err`. `sqlite/close` drains queued jobs before closing. ## See Also `sqlite/query`, `sqlite/query-one-async`, `sqlite/scalar-async`