TypeError: Cannot redefine property: 1
at Function.defineProperty (<anonymous>)
at rowFromProto (/Users/doug/work/chiselstrike/codingdoug/libsql-client-ts/node_modules/@libsql/hrana-client/lib-cjs/result.js:45:16)
at /Users/doug/work/chiselstrike/codingdoug/libsql-client-ts/node_modules/@libsql/hrana-client/lib-cjs/result.js:17:41
at Array.map (<anonymous>)
at rowsResultFromProto (/Users/doug/work/chiselstrike/codingdoug/libsql-client-ts/node_modules/@libsql/hrana-client/lib-cjs/result.js:17:30)
at /Users/doug/work/chiselstrike/codingdoug/libsql-client-ts/node_modules/@libsql/hrana-client/lib-cjs/stream.js:33:48
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async HttpClient.execute (/Users/doug/work/chiselstrike/codingdoug/libsql-client-ts/lib-cjs/http.js:81:55)
This does not happen with:
select 1
select 0.1
select 0
select 2, 'asdf'
select 'asdf'
select 'asdf', 1
It does happen with:
select 99, 2, 'asdf'
This SQL yields a result set that contains a single row value which contains an empty object (instead of {'0': 'asdf'}:
select 'asdf' as '0'
The problem I believe is this: since ResultSet rows are populated and can be used as both an array and an object (using both integer column index and string column names on the object), there can be a collision when the name of a column happens to match one of the used integer indexes for array usage.
I don't see that there is a fix or workaround as long as rows are populated this way.
Working against current main.
This does not happen with:
select 1
select 0.1
select 0
select 2, 'asdf'
select 'asdf'
select 'asdf', 1
It does happen with:
select 99, 2, 'asdf'
This SQL yields a result set that contains a single row value which contains an empty object (instead of
{'0': 'asdf'}
:select 'asdf' as '0'
The problem I believe is this: since ResultSet rows are populated and can be used as both an array and an object (using both integer column index and string column names on the object), there can be a collision when the name of a column happens to match one of the used integer indexes for array usage.
I don't see that there is a fix or workaround as long as rows are populated this way.