Important: Please read the Qt Code of Conduct -

PySide - Interacting with SQLite through Qt vs. native Python?

  • I have been working with Python and PySide for a while but I'm fairly inexperienced with databases. (So far I've been able to accomplish what I need using Pickle).

    I'm looking to take the plunge starting with SQLite and I'm wondering whether I should interact with SQLite through Python's native bindings, or through Qt?

    Are there pros and cons for each? Different use cases in which one would be the preferred option?

    In the end I'll learn to work both ways. But for now I'm wondering where I should start (and why, if you have a moment to explain).


  • Lifetime Qt Champion


    It really all depends on how you are going to use the database. If you are planning to use Qt's Model/View paradigm then using the QtSql module would be the logical choice. However you could also implement your own model using python's sql.

    You should start by looking at your requirements. Then if both qualifies, just try each to see which one fits your needs better.

    Hope it helps

Log in to reply