2 ms·
> not being able to trust other datatypes to enforce type constraints is not ideal You can have more reasonable behaviour now by creating tables as "strict"[1]
by debugnik 4y ago
> not being able to trust other datatypes to enforce type constraints is not ideal
You can have more reasonable behaviour now by creating tables as "strict"[1], in which SQLite will fail if it can't perform a valid conversion. For storing values of arbitrary type it makes available a new "any" type instead.
> if you don't actually have a varchar 40 type, and you just have something that's text-like without other more specific constraints, then call it 'text'
It is in fact called text, it just supports aliases for common ways of specifying text fields in other DBs. However, "strict" tables to the rescue again; they also disable type names other than the native ones.
[1]: https://www.sqlite.org/stricttables.html https://www.sqlite.org/stricttables.html