This project is in Python and will have an sqlite3 database.
I would like to open the sqlite3 database using Python's sqlite3
module. But I also want to have functionality from the PySide6.QtSql
module.
PySide's documentation shows an example of this happening with Postgres.
con = PQconnectdb("host=server user=bart password=simpson dbname=springfield")
drv = QPSQLDriver(con)
db = QSqlDatabase.addDatabase(drv) # becomes the default() connection()
query = QSqlQuery()
query.exec("SELECT NAME, ID FROM STAFF")
I tried using QSQLiteDriver
, but I cannot import it, and I cannot find the required file qsql_sqlite.cpp
on my computer.
The documentation mentions linking certain files. Is it possible to use QSQLiteDriver
without compiling PySide6 from source?