[TYPO3-dev] Idea for DBAL, add a setDBinit for each database..

R. van Twisk typo3 at rvt.dds.nl
Sun Mar 11 17:41:25 CET 2007


Hey Guys,

I have a small idea for the DBAL extension,
but I need your input on it.

As we all know we have setDBinit the the install tool for mysql databases,
however when using DBAL we don't have that for other database then the 
default..

My proposal is also to add setDBinit to DBAL databases like this:

$TYPO3_CONF_VARS['EXTCONF']['dbal']['handlerCfg'] = array (
    '_DEFAULT' => array (
        'type' => 'native',
        'config' => array(
            'username' => '',        // Set by default (overridden)
            'password' => '',        // Set by default (overridden)
            'host' => '',            // Set by default (overridden)
            'database' => '',        // Set by default (overridden)
        )
    ),

    'abs' => array (
        'type' => 'adodb',
        'config' => array(
            'username' => '....',       
            'password' => '',      
            'host' => 'localhost',       
            'database' => '....',       
            'driver' => '...',
            'setDBinit' => "set search_path to 'sch_exhibition';",
        )
    ),
);


Then setDBinit can be execute for each database.

A good example can already be seen above,
I always store my tables in different schema's for
clarity. However DBAL doesn't allow me in the table
mapping to specify a schema name.

The above could solve that (my table names are always unique).

what do you think?

Ries


PS: next step would be to allow schema names in the table mappings of 
course....
But a setDBinit for each DB can come handy anyways.


-- 
Ries van Twisk
Freelance Typo3 Developer
=== Private:
email: ries at vantwisk.nl
web:   http://www.rvantwisk.nl/freelance-typo3.html
skype: callto://r.vantwisk
=== Work:
email: ries at livetravelguides.com
web:   http://www.livetravelguides.com





More information about the TYPO3-dev mailing list