Rudimentary support for table prefixing #1

This commit is contained in:
Artur Welp
2019-04-25 05:36:26 -03:00
parent 9f66bb7c55
commit b57229f582
3 changed files with 19 additions and 0 deletions
+5
View File
@@ -57,6 +57,10 @@ class Wrapper{
public static function get_table($name){
$instance = self::getInstance();
echo $instance->_adapter->getConnection()->prefix;
if( $instance->_adapter->getConnection()->prefix ){
$name = $instance->_adapter->getConnection()->prefix . $name;
}
return new Table($name, Array(), $instance->_adapter);
}
@@ -72,6 +76,7 @@ class Wrapper{
public static function exec($sql){
$instance = self::getInstance();
$sql = preg_replace('/{(.*)}/', "$con->prefix$1", $sql);
$instance->_driver->exec($sql);
}