Fix posgres tests
This commit is contained in:
parent
851ff0b916
commit
57842a44b4
@ -72,5 +72,61 @@ abstract class DB_SQL {
|
||||
* @return string
|
||||
*/
|
||||
abstract public function backup_data();
|
||||
|
||||
/**
|
||||
* Returns sql to list other databases
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function db_list();
|
||||
|
||||
/**
|
||||
* Returns sql to list tables
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function table_list();
|
||||
|
||||
/**
|
||||
* Returns sql to list system tables
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function system_table_list();
|
||||
|
||||
/**
|
||||
* Returns sql to list views
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function view_list();
|
||||
|
||||
/**
|
||||
* Returns sql to list triggers
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function trigger_list();
|
||||
|
||||
/**
|
||||
* Return sql to list functions
|
||||
*
|
||||
* @return FALSE
|
||||
*/
|
||||
abstract public function function_list();
|
||||
|
||||
/**
|
||||
* Return sql to list stored procedures
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function procedure_list();
|
||||
|
||||
/**
|
||||
* Return sql to list sequences
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function sequence_list();
|
||||
}
|
||||
// End of db_sql.php
|
@ -73,5 +73,23 @@ class pgSQL extends DB_PDO {
|
||||
{
|
||||
return (isset($this->statement)) ? $this->statement->rowCount : FALSE;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Get a list of schemas for the current connection
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function get_schemas()
|
||||
{
|
||||
$sql = <<<SQL
|
||||
SELECT DISTINCT "schemaname" FROM "pg_tables"
|
||||
WHERE "schemaname" NOT LIKE 'pg\_%'
|
||||
AND "schemaname" != 'information_schema'
|
||||
SQL;
|
||||
|
||||
return $this->driver_query($sql);
|
||||
}
|
||||
}
|
||||
//End of pgsql_driver.php
|
@ -17,6 +17,15 @@
|
||||
*/
|
||||
class pgSQL_SQL extends DB_SQL {
|
||||
|
||||
/**
|
||||
* Database-specific method to create a new table
|
||||
*
|
||||
* @param string $name
|
||||
* @param array $columns
|
||||
* @param array $constraints
|
||||
* @param array $indexes
|
||||
* @return string
|
||||
*/
|
||||
public function create_table($name, $columns, array $constraints=array(), array $indexes=array())
|
||||
{
|
||||
$column_array = array();
|
||||
@ -67,6 +76,12 @@ class pgSQL_SQL extends DB_SQL {
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Database-specific SQL for dropping a table
|
||||
*
|
||||
* @param string $name
|
||||
* @return string
|
||||
*/
|
||||
public function delete_table($name)
|
||||
{
|
||||
return 'DROP TABLE "'.$name.'"';
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user