You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On sqlite-utils 4.2.1 (and main at 9c66baf), table.transform() and sqlite-utils transform drop the COLLATE clause from column definitions. A column declared name TEXT COLLATE NOCASE comes out as plain name TEXT, so comparisons on it silently become case-sensitive.
importsqlite_utilsdb=sqlite_utils.Database(memory=True)
db.execute("CREATE TABLE people (id INTEGER PRIMARY KEY, name TEXT COLLATE NOCASE)")
db["people"].insert({"id": 1, "name": "Alice"})
print(db.execute("select count(*) from people where name = 'alice'").fetchone())
db["people"].transform(types={"id": int})
print(db.execute("select count(*) from people where name = 'alice'").fetchone())
print(db["people"].schema)
Any transform triggers it, even one that does not touch the column. PRAGMA table_info does not report collations, so they need to be read from the schema SQL, as CHECK and UNIQUE constraints already are. A column-level UNIQUE does keep its collation today (it is rewritten as UNIQUE ("name" COLLATE "NOCASE")), but the column itself loses it.
Activity
Preserve column COLLATE through transforms
Preserve column COLLATE through transforms (#955)
simonw commentedon Nov 29, 2026
Fixed by:
Release 4.2.2