[Solved] SQLite: pragma foreign_key_check
-
I try to execute a QSqlQuery for the following pragma command (sqlite) but it does not return the expected results.
QSqlQuery q("pragma foreign_key_check")
The expected result would be to return the 4 columns table with all foreign key constrains violations. I have entered in purpose some violations but it returns an empty record (q.size() == -1). From sqlite studio I am able to see the results of this commands. no through Qt though.
Other pragma commands like "pragma foreign_key_list(tablename)" work fine.
Can anyone explain why "pragma foreign_key_check" command does not return any result when it should?
-
Hi and welcome to devnet,
IIRC, not all database drivers support returning query sizes. You can check with QSqlDriver::hasFeature(QSqlDriver::QuerySize);