Without ORMs o query generators, you  pretty much have to do it yourself. Have two syntaxes for the same query, choose based on the driver. This works for me because I don't like maintaining SQL in code unless I have to, I read my SQL from a YAML/text file, or the database itself. 
 
Sent: Wednesday, February 11, 2015 at 7:54 AM
From: pmqt71 <pmq...@gmail.com>
To: "Qt Project" <interest@qt-project.org>
Subject: [Interest] How to deal with database specific syntax
Hi all,
 
in my Qt application I've to duplicate sql instructions for MySql and Postgres due to different sql syntax.
Most problems are on date types. For instance, MySql has DATEDIFF, Postgres has EXTRACT, CAST...
 
Without using ORMs, is there a way to manage specific sql syntax?
 
 
Thanks
pm
 
_______________________________________________ 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

Reply via email to