Added support PostgreSQL schema setting, if schema has been specified.
Signed-off-by: Rack Lin <racklin@gmail.com>
This commit is contained in:
parent
ec41836241
commit
54f4cb2644
|
@ -85,6 +85,7 @@
|
||||||
'password' => '',
|
'password' => '',
|
||||||
'charset' => 'utf8',
|
'charset' => 'utf8',
|
||||||
'prefix' => '',
|
'prefix' => '',
|
||||||
|
'schema' => 'public',
|
||||||
),
|
),
|
||||||
|
|
||||||
'sqlsrv' => array(
|
'sqlsrv' => array(
|
||||||
|
|
|
@ -44,6 +44,13 @@ public function connect($config)
|
||||||
$connection->prepare("SET NAMES '{$config['charset']}'")->execute();
|
$connection->prepare("SET NAMES '{$config['charset']}'")->execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If a schema has been specified, we'll execute a query against
|
||||||
|
// the database to set the search path.
|
||||||
|
if (isset($config['schema']))
|
||||||
|
{
|
||||||
|
$connection->prepare("SET search_path TO '{$config['schema']}'")->execute();
|
||||||
|
}
|
||||||
|
|
||||||
return $connection;
|
return $connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue