# sqlite/exec-async Async twin of `sqlite/exec` — run DDL/DML off-thread on the handle's dedicated executor. Returns a Future. ## Syntax
[sqlite/exec-async $db $sql ?params...]
## Parameters - `$db` — database handle - `$sql` — SQL statement (CREATE/INSERT/UPDATE/DELETE) - `?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)"]
[await [sqlite/exec-async $db "INSERT INTO t VALUES (1)"]]   # → 1
## Returns Future; `[await ...]` yields the rows-changed count, the same value as `sqlite/exec`. Errors from the worker resolve the Future 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`. Jobs run FIFO, preserving begin/exec/commit order; `sqlite/close` drains queued jobs before closing the database. ## See Also `sqlite/exec`, `sqlite/begin-async`, `sqlite/commit-async`