Improve 'type_list' methods
This commit is contained in:
parent
db1490c016
commit
eb5d30ab21
@ -116,7 +116,7 @@ class Query_Builder {
|
||||
*
|
||||
* @var DB_PDO
|
||||
*/
|
||||
private $sql;
|
||||
public $sql;
|
||||
|
||||
/**
|
||||
* Query component order mapping
|
||||
|
@ -248,7 +248,9 @@ SQL;
|
||||
public function type_list()
|
||||
{
|
||||
return <<<SQL
|
||||
SELECT "RDB\$FIELD_TYPE" FROM "RDB\$FIELDS"
|
||||
SELECT "RDB\$TYPE_NAME", "RDB\$FIELD_NAME" FROM "RDB\$TYPES"
|
||||
WHERE "RDB\$FIELD_NAME" IN ('RDB\$FIELD_TYPE', 'RDB\$FIELD_SUB_TYPE')
|
||||
ORDER BY "RDB\$FIELD_NAME" DESC, "RDB\$TYPE_NAME" ASC
|
||||
SQL;
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ SQL;
|
||||
return <<<SQL
|
||||
SELECT "typname" FROM "pg_catalog"."pg_type"
|
||||
WHERE "typname" !~ '^pg_|_'
|
||||
AND "typtype" != 'c'
|
||||
AND "typtype" = 'b'
|
||||
ORDER BY "typname"
|
||||
SQL;
|
||||
}
|
||||
|
@ -35,4 +35,16 @@ class FirebirdQBTest extends QBTest {
|
||||
|
||||
// echo '<hr /> Firebird Queries <hr />';
|
||||
}
|
||||
|
||||
public function TestTypeList()
|
||||
{
|
||||
$sql = $this->db->sql->type_list();
|
||||
$query = $this->db->query($sql);
|
||||
|
||||
$this->assertIsA($query, 'PDOStatement');
|
||||
|
||||
$res = $query->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$this->assertTrue(is_array($res));
|
||||
}
|
||||
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user