[DB-SIG] Re: Using SQLite from Python

Gerhard Häring haering_postgresql@gmx.de
Thu, 9 Jan 2003 23:52:58 +0100


* Oliver Vecernik <vecernik@aon.at> [2003-01-09 09:05 +0100]:
> Gerhard Häring schrieb:
> >[...]
> >Btw. it occured to me today that we should rather use something like
> >"-- pysqlite_pragma" instead, so SQL code can be written more portably
> >across databases.
> 
> Very good idea, in my opinion. BTW: I can specify types for sqlite as an 
> option (I know it's not used, but encouraged to do it for 
> clarification).

> Is there a special reason (e.g. speed) for pysqlite not to use this
> information, if provided? It would be convenient!

Actually, since SQLite 2.5.6 we can get some type information when we
use "pragma show datatypes=ON". Unfortunately, that support is broken in
the current PySQLite release (at least the SQLite version check, so it
will only work with 2.5.x). In theory this SQLite pragma can save many
uses of "pysqlite_pragma expected types" in the future, but not right
now.

I'm at this moment experimenting with a more or less complete rewrite of
PySQLite that will move lots of code into the Python layer instead of
the C layer, to make things more manageable :-)

Gerhard
-- 
Favourite database:             http://www.postgresql.org/
Favourite programming language: http://www.python.org/
Combine the two:                http://pypgsql.sf.net/
Embedded database for Python:   http://pysqlite.sf.net/