libsql / sqld

LibSQL with extended capabilities like HTTP protocol, replication, and more.
https://libsql.org
902 stars 38 forks source link

HTTP API refuses "true" and "false" bool literals #146

Closed psarna closed 1 year ago

psarna commented 1 year ago

... while libSQL allows them in queries (and so does SQLite). true and false are just syntactic sugar over 1 and 0 respectively, and they have the INTEGER type.

curl -X POST -d '{"statements": [{"q": "select ?", "params": [true]}]}' https://psarna:XXXXXXXX@iku-turso-fb23ee23-a168-11ed-b49c-22877fad227e-primary.fly.dev
{"error":"invalid type: boolean `true`, expected a valid SQLite value at line 1 column 49"}

/cc @MarinPostma

psarna commented 1 year ago

(oh and it only happens for bound parameters - that's a deserialization issue)

MarinPostma commented 1 year ago

Yup this was discussed in #106 but not implemented yet