Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Unfortunately, there doesn't seem to be a PRAGMA option for strict tables. Docs at following link say that 'STRICT' must be appended to end of CREATE TABLE statement to disable the flexible typing 'feature'.

https://www.sqlite.org/stricttables.html



I don't think there can be with sqlite's backwards compatibility model. The DB has to assume it may be accessed with multiple versions of the library or clients using different pragma settings. So one client disabling strict (or using a version predating that feature) and inserting a bunch of violating records would break the DB file when used by another client with strict enabled.

With it part of table creation, which IIRC is read for each connection to create the schema, it's part of the DB file not the client configuration. If you open a DB using strict with a version that doesn't support it, it will fail but not cause problems for other users.


I wish there was a branch of SQLite that cleaned up everything, set new sane behavior (and broke backward compatibility since it’s needed to achieve that).

Eg strict mode by default, WAL2, BEGIN CONCURRENT, etc.

Maybe HC-Tree will become that?

https://sqlite.org/hctree/doc/hctree/doc/hctree/index.html


It is time for version 4 of SQLite.


Yep, that all makes perfect sense!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: