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
With strict tables, SQLite can enforce data type integrity that is not enforced otherwise. Without strict tables, the following works in SQLite:
CREATETABLEuser(id INTEGER);
INSERT into user VALUES ("YOLO!"); --- This works!
Is it possible to enable strict tables in Gorm, somehow? I've tried to do db.Set("gorm:table_options", "STRICT"), but it seemingly has no effect. To inspect whether the table has been created strict, I run the following query:
select*from pragma_table_list
And if the strict column is set to 1, it's a strict table. So far, I've not been successful in having Gorm create strict tables in SQLite. Do I need to create a custom SQLite Dialector for this?
Motivation
Strict tables enable data integrity checks that are disabled by default.
Sorry for cross-posting this to go-gorm/gorm#7443, but I'm unsure whether this is a feature that belongs to Gorm or the SQLite driver/dialector.
The text was updated successfully, but these errors were encountered:
Describe the feature
With strict tables, SQLite can enforce data type integrity that is not enforced otherwise. Without strict tables, the following works in SQLite:
Is it possible to enable strict tables in Gorm, somehow? I've tried to do
db.Set("gorm:table_options", "STRICT")
, but it seemingly has no effect. To inspect whether the table has been created strict, I run the following query:And if the
strict
column is set to1
, it's a strict table. So far, I've not been successful in having Gorm create strict tables in SQLite. Do I need to create a custom SQLiteDialector
for this?Motivation
Strict tables enable data integrity checks that are disabled by default.
Sorry for cross-posting this to go-gorm/gorm#7443, but I'm unsure whether this is a feature that belongs to Gorm or the SQLite driver/dialector.
The text was updated successfully, but these errors were encountered: