Open matesko opened 12 years ago
If you don't mind posting the SQL dialect you are using, I will look at starting there first. MySQL? Oracle? MS SQL? etc...
i am using oracle and mysql. thanks for a great job
i extended leap to use a table prefix. this prefix is defined in database.php config file and this works well so far.
add this to Base_DB_Connection.php public static function get_fq_table($table, $config = 'default') {
static $dsCache = array();
if (isset($dsCache[$config])) {
$dataSource = $dsCache[$config];
}
else {
$dataSource = new DB_DataSource($config);
$dsCache[$config] = $dataSource;
}
if (strlen($dataSource->prefix)) {
return $dataSource->prefix . strtoupper($table);
}
return strtoupper($table);
}
in your models use public static function table() { return DB_Connection::get_fq_table('GROUPS'); }
that this works you have to extend the Base_DB_DataSource and add
this to init method: $this->settings['prefix'] = (isset($settings['prefix'])) ? (string) $settings['prefix'] : '';
and this to __get method case 'prefix':
then it should work.
very nice addition are schema classes. Are they going to be completed soon. They will enable model generation like Kohana ORM