ws4sqlite
ws4sqlite copied to clipboard
Confusing results if duplicate fields names in map results
If you have a query with a join and the field names aren't unique, you get confusing results:
For example:
select foo.id, bar.id from foo inner join bar on (foo.id = bar.foo_id)
results in:
"resultHeaders": ["id", "id"],
"resultSet": [{ "id": 2 }]
The solution is to make sure you alias fields with unique names, or use "resultFormat": "list". But if you do use map and have duplicate fields, the result isn't very usable since there is lost data and ambiguous field names, so perhaps it should raise an error?
Agreed, as discussed on Discord. Thanks for the report.
This will be done in ws4sql, that will be released as soon as I complete the documentation.