-
-
Notifications
You must be signed in to change notification settings - Fork 121
Closed
Labels
Description
sqlite-utils/sqlite_utils/db.py
Lines 1165 to 1174 in 13ebcc5
cursor = self.conn.cursor() | |
schema_version = cursor.execute("PRAGMA schema_version").fetchone()[0] | |
cursor.execute("PRAGMA writable_schema = 1") | |
for table_name, new_sql in table_sql.items(): | |
cursor.execute( | |
"UPDATE sqlite_master SET sql = ? WHERE name = ?", | |
(new_sql, table_name), | |
) | |
cursor.execute("PRAGMA schema_version = %d" % (schema_version + 1)) | |
cursor.execute("PRAGMA writable_schema = 0") |
This is the only place in the code that attempts to modify sqlite_master
directly, which fails on some Python installations.
Could this use the .transform()
trick instead?
Or automatically switch to that trick if it hits an error?