My app does basic CRUD operations, and most of them already are compatible with different DBs. I just have problems in WHERE conditions when using date functions. A part from this, anything works well. Also the binding of dates and datetimes are well supported. So, let me say, Qt covers 90% of basic CRUD operations for any SQL DB. I know it's not a Qt problem but an SQL problem, but I'd like some Qt pseudofunctions, eg QT_DATEDIFF, that the driver would translate in the specific SQL. Qt would have full support for CRUD operations DB indipendent. What do you think about?
pm 2015-02-12 9:30 GMT+01:00 André Somers <an...@familiesomers.nl>: > Dmitriy Purgin schreef op 12-2-2015 om 08:04: > > Exactly, that's what I meant by "supporting the stored procedure call > > syntax". Sorry, it was a bit vague. Anyway, in this case you're > > implementing a single interface for an SP call backed by multiple > > "syntax handlers" which is much easier than handling lots of syntactic > > differences for any kind of operations one might want to do with a > > database. It's not ideal, it has its drawbacks but it also has > > advantages. Moreover, pmqt71 has explicitly stated that he/she doesn't > > want to go the ORM way. > > Normally in Qt, if you want to write db independent code, you have to > create your queries using the QSqlDriver::sqlStatement method. Ignore > the comment in the documentation that states "This class should not be > used directly. Use QSqlDatabase instead.", as QSqlDatabase does not > provide this API. > > The basic problem is however that the Qt SQL drivers are really limited. > They only support the basics of the DML and some TCL, but they don't do > any more advanced things, including any DDL or indeed support for stored > procedures. They also don't support functions you can use in SQL > statements in database. So, there simply is no support for creating > anything more advanced than a simple insert or select query. > > A couple of years back, I wrote an extension to the Qt SQL drivers to > add DDL support for a database agnostic application, and that extended > the sqlStatement virtual method with many more features. It proved > possible to do without modifying Qt itself, and it removed any database > specific code I had in the application itself. Everything was abstracted > into a new set of extended drivers. You may be able to do the same for > accessing stored procedures in different database. If you are > interested, I can point you to the code. > > André > > > > _______________________________________________ > Interest mailing list > Interest@qt-project.org > http://lists.qt-project.org/mailman/listinfo/interest >
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest