[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [jfw] Discussion - Package Updates for Framework 2.0

On 23.04.2014, at 09:27, Andrew Eddie <mamboblue AT gmail.com> wrote:

> Not much. The only thing I think that is missing is the ability to
> quote identifiers. The point is that in Joomla we don't inject a PDO,
> we inject a Joomla DatabaseDriver. Lots of other PHP developers use
> PDO; few outside Joomla circles use DatabaseDriver. So if we swapped
> the CMS and Framework apps to using PDO as the native DBAL, I think
> that would be better (and deprecate DatabaseDriver).

While I agree that this would be nice it's not that easy.  Unfortunately some of the PDO drivers are in piss poor shape. Most notably that's the Oracle driver is still experimental and I've read (http://stackoverflow.com/a/2655765/1432249) that it doesn't work when a column is larger than 4000 characters (think large JSON columns). Basically the only solid drivers seem to be mysql, sqlite, postgres and mostly sqlsrv.

I think it's worth looking at Doctrine DBAL. Their driver part is mostly a thin layer around PDO, allowing them to use other driver with a PDO-like interface. For example this is the class used for PDO based drivers (https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Driver/PDOConnection.php) and this is one for oci8 (https://github.com/doctrine/dbal/blob/master/lib/Doctrine/DBAL/Driver/OCI8/OCI8Connection.php).

Of course this only forms the core of Doctrine DBAL, around that is convent API build that is quite similar to the one offered JDatabase. The nice thing is that you can always get the inner connection if you so desire - however you can't be 100% sure it's a PDO instance. Of course application developers can limit the supported drivers to get this 1:1 mapping.

Best regards

Framework source code: https://github.com/joomla/joomla-framework
Visit http://developer.joomla.org for more information about developing with Joomla!
You received this message because you are subscribed to the Google Groups "Joomla! Framework Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-framework+unsubscribe AT googlegroups.com.
Visit this group at http://groups.google.com/group/joomla-dev-framework.