'What is the exact PostgreSQL driver used by PyQt6?
How can I determine the exact PostgreSQL driver used by PyQt6? QPSQL is a Qt thingy for which there is no documentation as to configuration options, so I'm guessing it's just a wrapper for a real driver.
There is no such thing as a "PostgreSQL Driver", as shown in the QSqlDatabase doc.
Postgres version 12 docs lists the following "external projects" as possible drivers: DBD::Pg, JDBC, libpqxx, node-postgres, Npgsql, pgtcl, pgtclng, pq, psqlODBC, psycopg. There are also two native drivers: libpq, ECPG.
Though not listed in the version 12 docs, there are several variations of ODBC, divided into single-tier and multi-tier types.
A Postgres doc states that psqlODBC is the "official PostgreSQL ODBC driver", but that doesn't mean that PyQt6 is using it.
Possibly Qt won't commit to a specific driver because they may want to change driver implementation without notice. Nevertheless, I'd like to know what I have so I can tweak its options. Even better, I'd like to use a different driver if I don't like the one Qt provides. Qt has a section, "Compile Qt with a specific driver"; that should not be necessary for a PyQt6 programmer, and it is not clear whether such a compiled thing would find its way into PyQt6 with the static method, registerSqlDriver(). The QSqlDriver doc has a bunch of enums used with the hasFeature() method; this is useful, but it's not the same as manipulating driver parameters. The JDBC driver has a whole raft of options which are enumerated in the Postgres docs; I'd like to be able to retrieve a similar list for whatever driver Qt implements.
Any help, please.
Solution 1:[1]
Qt uses libpq driver for qsqlpsql plugin.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mugiseyebrows |
