mirror of
https://github.com/allankoechke/turso.git
synced 2026-12-01 09:34:05 +00:00
Rows from the cursor endpoint are built as arrays with one extra
property per column name, so the compat ResultSet rows can be read by
index and by name. Defining a column-name property that the array
already owns throws, so a query returning such a column fails outright
("Cannot redefine property", or "Cannot convert a BigInt value to a
number" with safeIntegers()).
Never overwrite a property the row already has. This is the rule
@libsql/hrana-client and libsql-client use for their rows. As a side
effect, compat rows with duplicate column names now keep the first value
by name instead of the last, matching libsql-client.
Tests: new "Statement.all() [column names that are JavaScript object
properties]" conformance test in testing/conformance/javascript covering
length, map, toString and hasOwnProperty. Run with PROVIDER=serverless
against a local `turso dev` server it fails on the unfixed driver and
passes with the fix.