Writing DB queries when supporting other databases


I noticed Yii 2 supports the following databases:





CUBRID: version 9.3 or higher. (Note that due to a bug in the cubrid PDO extension, quoting of values will not work, so you need CUBRID 9.3 as the client as well as the server)


MSSQL: version 2008 or higher.

But was wondering, so enable support for these in your application I assume you would need to use the query builder right!?

If you didn’t use that and just used DAO would this still support MariaDB as I heard they are pretty interchangeable.


No need to use query builder for explicitly quoting table & column names.

This is done automatically in Yii2 (improved against Yii1) also in AR.

Well I’m mainly wondering about supporting other databases. Like I know the vast majority of queries will work on pretty much any SQL database, but if I get too MySQL specific and write stuff they may not be transferable to other databases how does Yii handle that?

Just trying to understand how far the "supported databases" goes? If I wanted to make sure my application supported the specified databases would I have to write custom code for each or use something like Doctrine?