-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
User admin API returns integers instead of booleans on SQLite, or the documentation is incorrect #13519
Comments
IMO, in this case, it has not the reason in SQLite, but the database layout: synapse/synapse/storage/schema/main/full_schemas/54/full.sql.postgres Lines 1091 to 1102 in d4d3249
For some reason most of them are not As a result, it is not consistent that rooms use |
I'd guess we chose |
Thats right, sqlite does not have a
and (
And SQLite uses CREATE TABLE person(
person_id INTEGER PRIMARY KEY,
team_id INTEGER REFERENCES team,
is_team_leader BOOLEAN,
-- other fields elided
); Presumably the inconsistent and non boolean values are then part of the past. Is it a task to convert all these columns to boolean? But |
I believe old SQLites didn't support booleans and there might still be some issues using them directly in queries (if you pass them in as parameters than it works OK though). Not sure how hard it would be to convert, but is likely doable. |
My understanding, reading https://www.sqlite.org/datatype3.html#boolean_datatype and the preceeding section is:
Given the last bullet above, I would guess that a) this is just a hint to the reader and b) BOOLEAN treated as a synonym for INTEGER by SQLite. (But I really am just guessing.) |
Similar to #13505.
Originally reported by @jplatte in #13509 (comment):
Description
The first example on https://matrix-org.github.io/synapse/develop/admin_api/user_admin_api.html shows this:
but some of these fields are mentioned as being
bool
further down.The text was updated successfully, but these errors were encountered: