Improve 'type_list' methods
This commit is contained in:
parent
db1490c016
commit
eb5d30ab21
@ -116,7 +116,7 @@ class Query_Builder {
|
|||||||
*
|
*
|
||||||
* @var DB_PDO
|
* @var DB_PDO
|
||||||
*/
|
*/
|
||||||
private $sql;
|
public $sql;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Query component order mapping
|
* Query component order mapping
|
||||||
|
@ -248,7 +248,9 @@ SQL;
|
|||||||
public function type_list()
|
public function type_list()
|
||||||
{
|
{
|
||||||
return <<<SQL
|
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;
|
SQL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ SQL;
|
|||||||
return <<<SQL
|
return <<<SQL
|
||||||
SELECT "typname" FROM "pg_catalog"."pg_type"
|
SELECT "typname" FROM "pg_catalog"."pg_type"
|
||||||
WHERE "typname" !~ '^pg_|_'
|
WHERE "typname" !~ '^pg_|_'
|
||||||
AND "typtype" != 'c'
|
AND "typtype" = 'b'
|
||||||
ORDER BY "typname"
|
ORDER BY "typname"
|
||||||
SQL;
|
SQL;
|
||||||
}
|
}
|
||||||
|
@ -35,4 +35,16 @@ class FirebirdQBTest extends QBTest {
|
|||||||
|
|
||||||
// echo '<hr /> Firebird Queries <hr />';
|
// 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