4 ms·
SQLite accepts a type constraint without enforcing it. That's a bug just like MySQL sometimes accepting a foreign key constraint without enforcing it.
by erik_seaberg 6y ago
SQLite accepts a type constraint without enforcing it. That's a bug just like MySQL sometimes accepting a foreign key constraint without enforcing it.
- camgunz 6y agoIt's not a type constraint. It's a hint to SQLite to try and coerce values when it can. Here's what that link parent posted says: > As far as we can tell, the SQL language specification allows the use of manifest typing. Nevertheless, most other SQL database engines are statically typed and so some people feel that the use of manifest typing is a bug in SQLite. But the authors of SQLite feel very strongly that this is a feature. The use of manifest typing in SQLite is a deliberate design decision which has proven in practice to make SQLite more reliable and easier to use, especially when used in combination with dynamically typed programming languages such as Tcl and Python. It's intended behavior that's compatible with the SQL spec.
- OOPMan 6y agoThat doesn't change the fact that it's not a good idea.
- kirstenbirgit 6y agoWhy?