Fix abstract method again, add get_dbs to pgsql driver
This commit is contained in:
parent
b0da1994f5
commit
ef4a84c2d0
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,4 +2,5 @@
|
||||
*.DS_Store
|
||||
settings.json
|
||||
errors.txt
|
||||
*/simpletest/*
|
||||
|
||||
|
@ -111,7 +111,7 @@ abstract class DB_PDO extends PDO {
|
||||
/**
|
||||
* Abstract functions to override in child classes
|
||||
*/
|
||||
abstract function get_dbs();
|
||||
abstract function get_tables();
|
||||
|
||||
}
|
||||
// End of db_pdo.php
|
@ -43,6 +43,21 @@ class pgSQL extends DB_PDO {
|
||||
$this->query($sql);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of databases for the current connection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function get_dbs()
|
||||
{
|
||||
$sql = "SELECT datname FROM pg_database WHERE datname NOT IN ('template0','template1') ORDER BY 1";
|
||||
$res = $this->query($sql);
|
||||
|
||||
$dbs = $res->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
return $dbs;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of tables for the current db
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user