[Typo3-dev] DBAL Drivers
Florian Schaeffer
florian.schaeffer at mercoline.de
Tue Mar 15 12:30:03 CET 2005
Hello Martin,
> - how can i figure whether my sql code is dbal proof ... becaues
> currently ist is possible to use mysql specific functions in select and
> where clauses
>
> as an examlple i'm currently using the |FIND_IN_SET() function in a
> where clause ... how du i figure out whether the dbal supports this.
> depending on the result i could decide to use a workaround or to create
> an extension für mysql only. |
Only use standard-sql functions and avoid any DB-specific things like
the FIND_IN_SET or LIMIT BY - things.
I don't know the DBAL at the moment but in ADODb there are
meta-functions for that, so one can use a wrapper for let's say the
limit part of the query.
In ADODb you would write $conn->selectLimit and ADODb builds a suitable
command for the selected DB. (Oracle uses numrows, MySQL LIMIT ad so on)
So use the meta-functions provided in class.t3lib_db.php
(exec_SELECTquery, exec_SELECT_mm_query for multiple tables and so on)
*Don't use* exec_SELECTquery('my own specific to_char()
oracle-convert-function').
So simplay said, stick on old SQL-functions every DB is capable of or
use (if available) meta-functions.
Karsten knows more about the DBAL, so we should wait until everything is
finished and I think there will be a documentation or at least a
how-to-archive-dbal-functionality document ?
HTH
Florian
More information about the TYPO3-dev
mailing list