Started get_schemas method for postgres driver
This commit is contained in:
parent
13e3c3f807
commit
c3ce5962b6
@ -24,6 +24,9 @@ class ODBC extends DB_PDO {
|
|||||||
function __construct($dsn, $username=null, $password=null, $options=array())
|
function __construct($dsn, $username=null, $password=null, $options=array())
|
||||||
{
|
{
|
||||||
parent::__construct("odbc:$dsn", $username, $password, $options);
|
parent::__construct("odbc:$dsn", $username, $password, $options);
|
||||||
|
|
||||||
|
$class = __CLASS__.'_manip';
|
||||||
|
$this->manip = new $class;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,10 +108,19 @@ class pgSQL extends DB_PDO {
|
|||||||
*/
|
*/
|
||||||
function get_schemas($database="")
|
function get_schemas($database="")
|
||||||
{
|
{
|
||||||
$sql = 'SELECT ';
|
if($database === "")
|
||||||
|
{
|
||||||
|
$sql = 'SELECT DISTINCT "schemaname" FROM pg_tables
|
||||||
|
WHERE "schemaname" NOT LIKE \'pg\_%\'';
|
||||||
|
}
|
||||||
|
|
||||||
|
$sql = 'SELECT DISTINCT "schemaname" FROM pg_tables
|
||||||
|
WHERE "schemaname" NOT LIKE \'pg\_%\'';
|
||||||
|
|
||||||
$res = $this->query($sql);
|
$res = $this->query($sql);
|
||||||
$schemas = $res->fetchAll(PDO::FETCH_ASSOC);
|
$schemas = $res->fetchAll(PDO::FETCH_ASSOC);
|
||||||
|
|
||||||
|
return $schemas;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user