mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-06-25 22:19:41 +02:00
Enhancement to support returned results from update query
This commit is contained in:
parent
6f4dc4d8d2
commit
d2bb29938d
|
@ -39,4 +39,17 @@ class PostgreSQLQueryBuilder extends DBQueryBuilder {
|
|||
return $clause;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a specific PostgreSQL command that returns the affected rows when the 'Update' query is run
|
||||
*
|
||||
* @param SQLUpdate $query
|
||||
* @param array $parameters
|
||||
* @return string
|
||||
*/
|
||||
protected function buildUpdateQuery(SQLUpdate $query, array &$parameters) {
|
||||
$sql = parent::buildUpdateQuery($query, $parameters);
|
||||
$sql .= ' RETURNING *';
|
||||
return $sql;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user