sqlite3 in Python 2.5b1: my out-of-the-box experience

Avizoa at gmail.com Avizoa at gmail.com
Tue Jul 4 00:30:32 EDT 2006


John Machin wrote:
> Apologies in advance if this is a bit bloggy, but I'd like to get
> comments on whether I've lost the plot (or, more likely, failed to
> acquire it) before I start reporting bugs etc.

These are not, in fact, bugs. One of SQLite's features is that it does
not enforce type, meaning that with the exception of INTEGER PRIMARY
KEY you can stick whatever you want into whatever field you want. The
philosophy of SQLite is that type checking is a "mis-feature" that goes
against some of the principles of the relational model.

Taking this into consideration, how would pysqlite handle opening a
database that mixes strings and integers in datetime fields? The short
answer is that it can't, so instead it is up to the developer to ensure
proper handling of type (sounds like python duck-typing, doesn't it?)




More information about the Python-list mailing list