mirror of
https://github.com/vrana/adminer.git
synced 2025-08-16 03:24:01 +02:00
PostgreSQL: Display auto_increment of inserted rows
This commit is contained in:
@@ -139,10 +139,19 @@ abstract class SqlDriver {
|
||||
* @return bool
|
||||
*/
|
||||
function insert($table, $set) {
|
||||
return queries("INSERT INTO " . table($table) . ($set
|
||||
return queries($this->insertSql($table, $set));
|
||||
}
|
||||
|
||||
/** Get SQL query to insert data into table
|
||||
* @param string
|
||||
* @param array same as insert()
|
||||
* @return string
|
||||
*/
|
||||
protected function insertSql($table, $set) {
|
||||
return "INSERT INTO " . table($table) . ($set
|
||||
? " (" . implode(", ", array_keys($set)) . ")\nVALUES (" . implode(", ", $set) . ")"
|
||||
: " DEFAULT VALUES"
|
||||
));
|
||||
);
|
||||
}
|
||||
|
||||
/** Insert or update data in table
|
||||
|
@@ -87,6 +87,10 @@ if (extension_loaded('pdo')) {
|
||||
return $this->fetch(\PDO::FETCH_NUM);
|
||||
}
|
||||
|
||||
function fetch_column($field) {
|
||||
return $this->fetchColumn($field);
|
||||
}
|
||||
|
||||
function fetch_field() {
|
||||
$row = (object) $this->getColumnMeta($this->_offset++);
|
||||
$row->orgtable = $row->table;
|
||||
|
Reference in New Issue
Block a user