# sqlite/query-cols Return a query's result-set column names in SELECT order, without executing the statement. Result rows are maps (hash-ordered), so `keys` of a row is unreliable for headers — use this to render them in the right order. ## Syntax
[sqlite/query-cols $db $sql ?params...]
## Parameters - `$db` — database handle (must not be in async mode) - `$sql` — SQL query - `?params...` — optional bind values, as separate args or a single `@{}` vector ## Examples
set db [sqlite/open ":memory:"]
[sqlite/exec $db "CREATE TABLE t (zebra INTEGER, alpha TEXT, mid REAL)"]
[sqlite/query-cols $db "SELECT zebra, alpha, mid FROM t"]              # → @{zebra alpha mid}
[sqlite/query-cols $db "SELECT zebra AS z FROM t WHERE zebra = ?" 1]   # → @{z}
## Returns Vector of column-name strings in SELECT order. The statement is prepared (and params bound) but never stepped, so no rows are read. `%Err{:message}` for a bad handle — including one switched to async mode by any `sqlite/*-async` call — non-string SQL, or a prepare/bind failure such as an unknown table. ## See Also `sqlite/query-cols-async`, `sqlite/query`