Hi everyone,

I'm relatively new to Qt and sql. Been building my own Qt driver/plugin for a relatively unknown database. Everything is working and going all fine. However, I have run into a weird problem.

Qt parses my statements. This meaning when I prepare the statement:

QVERIFY(query.prepare("insert into tab_char values(?,?,?)"));

The actual statement being sent to the database is:

"insert into tab_char values(:a,:bb,:bc)"

That is usually fine, however can sometimes be problematic.

This would not be stange if it wasn't for the fact that in the "hasFeature" function for the driver both NamedPlaceholders and PositionalPlaceholders are set to be true and if you look at whats written on, http://doc.qt.io/qt-5/sql-sqlstatements.html, is says the following:

"Qt supports two placeholder syntaxes: named binding and positional binding. Here's an example of named binding. Both syntaxes work with all database drivers provided by Qt. If the database supports the syntax natively, Qt simply forwards the query to the DBMS; otherwise, Qt simulates the placeholder syntax by preprocessing the query."

I'm therefore a bit confused why Qt seem to be, per default, using namedPlaceholders. When I'm using "null indicators" it is problomatic that Qt parses my statements.

I'm aware of the hasFeature as i said before, so i know I can turn off namedPlaceholders etc. However i want both of them and I just don't understand why Qt parses the statement, the essential part of hasFeature looks like this:

bool QMSQLDriver::hasFeature(DriverFeature f) const {
switch (f) {
case NamedPlaceholdercans:
case PositionalPlaceholders:
return true;
}
}

Is there any other way to set the options for Qt to parse the sql statements? Would be very grateful for some help, and if the situation isn't clear just ask questions and I will explain it further.

Regards