Started get_schemas method for postgres driver

This commit is contained in:
Timothy Warren 2012-02-10 16:57:54 -05:00
parent 13e3c3f807
commit c3ce5962b6
2 changed files with 13 additions and 1 deletions

View File

@ -24,6 +24,9 @@ class ODBC extends DB_PDO {
function __construct($dsn, $username=null, $password=null, $options=array())
{
parent::__construct("odbc:$dsn", $username, $password, $options);
$class = __CLASS__.'_manip';
$this->manip = new $class;
}
/**

View File

@ -108,10 +108,19 @@ class pgSQL extends DB_PDO {
*/
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);
$schemas = $res->fetchAll(PDO::FETCH_ASSOC);
return $schemas;
}
/**