[Tutor] PySQLite vs SQLalchemy

Alan Gauld alan.gauld at btinternet.com
Sat Sep 13 01:33:26 CEST 2008


"Patrick" <optomatic at rogers.com> wrote

> I like SQLite, it's really easy to work with. I would like to model 
> my
> database in it natively but I am having quite a bit of trouble 
> mapping
> the variables in the SQLIte database via PySQLite. It appears that 
> this
> sort of thing is SQLalchemy's strong suit. However I would prefer 
> not to
> model my data base in it.

The two approaches are fundamentally different.
PySQLite is basically a wrapper to allow SQLite ro work with
the standard Python DBAPI (which is quite extensively documented
on the web site). SQLAlchemy is an OOP wrapper around DBAPI
that makes objects persistent by hiding the SQL from you.

If you know SQL then you should be able to use the DB API
without any problems. What are the specific issues you are having?
What are you trying to do? How? And what goes wrong?

> PySQLite and SQLalchemy. Is mapping the variables from the a 
> database
> via PySQLite a common problem?

No, it works very well in my experience Within the well known issues
of mapping objects to an RDBMS of course - assuming thats what
you are doing.

> Is SQLalchemy being used for desktop Applications?

Not by me, and it seems to be mainly uwsed in Web apps
but I see no reason for it not to be used in a desktop app.
You just need to use an OOP design.

> sparse documentation. We can build Python with SQLite built right 
> in,
> why is there not more documentation?

Because you normally use the generic DBAPI which is
documented in many places including several books
Basic instructions are in the Database topic of my tutor...

HTH

Alan G. 




More information about the Tutor mailing list