sqlite vs QSqlDatabase Class

82 views
Skip to first unread message

okido

unread,
Jul 29, 2009, 12:45:22 PM7/29/09
to tagaini-jisho
Hi Alex,

Is there a particular reason why you do not use the QSqlDatabase Class
for all db handling but prefer to include sqlite and use python?

Okido

Alexandre Courbot

unread,
Jul 29, 2009, 5:20:48 PM7/29/09
to tagain...@googlegroups.com
> Is there a particular reason why you do not use the QSqlDatabase Class
> for all db handling but prefer to include sqlite and use python?

The program binary uses QtSql and does not rely on Python at all. Only
the database creation scripts use Python for convenience.

At first I was also using QtSql in the Python scripts, but realized
that it imposed to have the PyQt Python bindings installed in order to
compile Tagaini. On the other hand, the SQLite bindings are part of
the standard Python library, so using them requires no additional
dependency. Plus, under Python they are considerably (3 or 4 times)
faster than using PyQt. So as there were only advantages (faster
database creation, less dependencies, and cleaner interface), I
thought it was just plain useless to use PyQt in the Python code too.

In the future, I may also totally drop the use of PyQt in Tagaini in
favor of a custom database layer. I'm already using a dedicated SQLite
driver anyway (since Tagaini needs special SQLite features that are
not compiled by default), so QtSql is just used for its more
convenient interface over the C SQLite API.

Alex.

Reply all
Reply to author
Forward
0 new messages