mirror of
https://github.com/dg/dibi.git
synced 2025-08-03 20:57:36 +02:00
Implemented OracleDriver::getColumns() (#233)
This commit is contained in:
@@ -466,7 +466,20 @@ class OracleDriver implements Dibi\Driver, Dibi\ResultDriver, Dibi\Reflector
|
||||
*/
|
||||
public function getColumns($table)
|
||||
{
|
||||
throw new Dibi\NotImplementedException;
|
||||
$res = $this->query('SELECT * FROM "ALL_TAB_COLUMNS" WHERE "TABLE_NAME" = ' . $this->escapeText($table));
|
||||
$columns = [];
|
||||
while ($row = $res->fetch(TRUE)) {
|
||||
$columns[] = [
|
||||
'table' => $row['TABLE_NAME'],
|
||||
'name' => $row['COLUMN_NAME'],
|
||||
'nativetype' => $row['DATA_TYPE'],
|
||||
'size' => isset($row['DATA_LENGTH']) ? $row['DATA_LENGTH'] : NULL,
|
||||
'nullable' => $row['NULLABLE'] === 'Y',
|
||||
'default' => $row['DATA_DEFAULT'],
|
||||
'vendor' => $row,
|
||||
];
|
||||
}
|
||||
return $columns;
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user