mirror of
https://github.com/dg/dibi.git
synced 2025-08-15 18:44:27 +02:00
MySQL drivers: getColumns() obtains comments
This commit is contained in:
@@ -467,7 +467,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
|||||||
*/
|
*/
|
||||||
public function getColumns($table)
|
public function getColumns($table)
|
||||||
{
|
{
|
||||||
$this->query("SHOW COLUMNS FROM `$table`");
|
$this->query("SHOW FULL COLUMNS FROM `$table`");
|
||||||
$res = array();
|
$res = array();
|
||||||
while ($row = $this->fetch(TRUE)) {
|
while ($row = $this->fetch(TRUE)) {
|
||||||
$type = explode('(', $row['Type']);
|
$type = explode('(', $row['Type']);
|
||||||
@@ -479,6 +479,7 @@ class DibiMySqlDriver extends DibiObject implements IDibiDriver
|
|||||||
'nullable' => $row['Null'] === 'YES',
|
'nullable' => $row['Null'] === 'YES',
|
||||||
'default' => $row['Default'],
|
'default' => $row['Default'],
|
||||||
'autoincrement' => $row['Extra'] === 'auto_increment',
|
'autoincrement' => $row['Extra'] === 'auto_increment',
|
||||||
|
'vendor' => $row,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->free();
|
$this->free();
|
||||||
|
@@ -470,7 +470,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
|||||||
FROM INFORMATION_SCHEMA.COLUMNS
|
FROM INFORMATION_SCHEMA.COLUMNS
|
||||||
WHERE TABLE_NAME = $table AND TABLE_SCHEMA = DATABASE()
|
WHERE TABLE_NAME = $table AND TABLE_SCHEMA = DATABASE()
|
||||||
");*/
|
");*/
|
||||||
$this->query("SHOW COLUMNS FROM `$table`");
|
$this->query("SHOW FULL COLUMNS FROM `$table`");
|
||||||
$res = array();
|
$res = array();
|
||||||
while ($row = $this->fetch(TRUE)) {
|
while ($row = $this->fetch(TRUE)) {
|
||||||
$type = explode('(', $row['Type']);
|
$type = explode('(', $row['Type']);
|
||||||
@@ -482,6 +482,7 @@ class DibiMySqliDriver extends DibiObject implements IDibiDriver
|
|||||||
'nullable' => $row['Null'] === 'YES',
|
'nullable' => $row['Null'] === 'YES',
|
||||||
'default' => $row['Default'],
|
'default' => $row['Default'],
|
||||||
'autoincrement' => $row['Extra'] === 'auto_increment',
|
'autoincrement' => $row['Extra'] === 'auto_increment',
|
||||||
|
'vendor' => $row,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$this->free();
|
$this->free();
|
||||||
|
Reference in New Issue
Block a user