Fix Firebird Tests, update README
This commit is contained in:
parent
c36cd13dd6
commit
49dc7fad11
10
README.md
10
README.md
@ -1,8 +1,8 @@
|
||||
#OpenSQLManager
|
||||
|
||||
OpenSQLManager is an attempt to create an alternative to Navicat that is free and open. It is built with PHP-GTK, so I'm looking for a way to create normal binaries.
|
||||
OpenSQLManager is an attempt to create an alternative to Navicat that is free and open. It is build with PHP-GTK, so I'm looking for a way to create normal binaries.
|
||||
|
||||
### Included pre-configured version of php for windows
|
||||
### Pre-configured version of php for windows
|
||||
Because php-gtk is such a pain to compile on Windows, I've put together this package from the latest php-gtk windows package. It's available in the downloads section.
|
||||
|
||||
## PHP Requirements
|
||||
@ -15,6 +15,9 @@ Because php-gtk is such a pain to compile on Windows, I've put together this pac
|
||||
* PDO
|
||||
* PDO drivers for the databases you wish to use
|
||||
|
||||
## Want to Contribute?
|
||||
See [Dev Guide](https://github.com/aviat4ion/OpenSQLManager/blob/master/DEV_README.md)
|
||||
|
||||
## Planned Features
|
||||
* CRUD (Create, Read, Update, Delete) functionality
|
||||
* Database table creation and backup
|
||||
@ -33,5 +36,4 @@ Plan to implement, not support:
|
||||
|
||||
|
||||
## Won't Support
|
||||
Closed source DBs, like Oracle, MSSQL, etc.
|
||||
|
||||
Closed source DBs, like Oracle, MSSQL, etc.
|
@ -120,7 +120,7 @@ class firebird {
|
||||
|
||||
/**
|
||||
* Emulate PDO prepare
|
||||
*
|
||||
*
|
||||
* @return resource
|
||||
*/
|
||||
function prepare()
|
||||
@ -136,10 +136,19 @@ class firebird {
|
||||
*/
|
||||
function get_tables()
|
||||
{
|
||||
$sql="SELECT rdb\$relation_name FROM rdb\$relations WHERE rdb\$relation_name NOT LIKE 'RDB\$%'";
|
||||
$sql='SELECT "RDB$RELATION_NAME" FROM "RDB$RELATIONS"
|
||||
WHERE "RDB$RELATION_NAME" NOT LIKE \'RDB$%\'
|
||||
AND "RDB$RELATION_NAME" NOT LIKE \'MON$%\'';
|
||||
$this->statement = $this->query($sql);
|
||||
|
||||
return $this->fetch();
|
||||
$tables = array();
|
||||
|
||||
while($row = $this->fetch(PDO::FETCH_ASSOC))
|
||||
{
|
||||
$tables[] = $row['RDB$RELATION_NAME'];
|
||||
}
|
||||
|
||||
return $tables;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,23 +37,32 @@ class FirebirdTest extends UnitTestCase {
|
||||
$this->assertIsA($this->db, 'Firebird');
|
||||
}
|
||||
|
||||
/*function TestGetTables()
|
||||
function TestGetTables()
|
||||
{
|
||||
$tables = $this->db->get_tables();
|
||||
|
||||
print_r($tables);
|
||||
}
|
||||
|
||||
function TestCreateDatabase()
|
||||
{
|
||||
//Attempt to create the table
|
||||
$sql = $this->db->manip->create_table('create_test', array('id' => 'SMALLINT'), array('id' => 'PRIMARY KEY'));
|
||||
$sql = $this->db->manip->create_table('create_test', array('id' => 'SMALLINT'));
|
||||
$this->db->query($sql);
|
||||
|
||||
//Check
|
||||
$tables = $this->db->get_tables();
|
||||
$table_exists = in_array('create_test', $tables);
|
||||
$this->assertTrue($table_exists);
|
||||
}
|
||||
|
||||
function TestDeleteDatabase()
|
||||
{
|
||||
//Attempt to delete the table
|
||||
$sql = $this->db->manip->delete_table('create_test');
|
||||
$this->db->query($sql);
|
||||
}*/
|
||||
|
||||
//Check
|
||||
$tables = $this->db->get_tables();
|
||||
$table_exists = in_array('create_test', $tables);
|
||||
$this->assertFalse($table_exists);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user