Add deprecation message ofr insertIfNotExist
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
This commit is contained in:
parent
230e93f575
commit
5273639d0e
|
@ -92,6 +92,7 @@ class Adapter {
|
|||
* Please note: text fields (clob) must not be used in the compare array
|
||||
* @return int number of inserted rows
|
||||
* @throws \Doctrine\DBAL\DBALException
|
||||
* @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371
|
||||
*/
|
||||
public function insertIfNotExist($table, $input, array $compare = null) {
|
||||
if (empty($compare)) {
|
||||
|
|
|
@ -63,6 +63,7 @@ class AdapterSqlite extends Adapter {
|
|||
* Please note: text fields (clob) must not be used in the compare array
|
||||
* @return int number of inserted rows
|
||||
* @throws \Doctrine\DBAL\DBALException
|
||||
* @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371
|
||||
*/
|
||||
public function insertIfNotExist($table, $input, array $compare = null) {
|
||||
if (empty($compare)) {
|
||||
|
|
|
@ -251,6 +251,7 @@ class Connection extends ReconnectWrapper implements IDBConnection {
|
|||
* Please note: text fields (clob) must not be used in the compare array
|
||||
* @return int number of inserted rows
|
||||
* @throws \Doctrine\DBAL\DBALException
|
||||
* @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371
|
||||
*/
|
||||
public function insertIfNotExist($table, $input, array $compare = null) {
|
||||
return $this->adapter->insertIfNotExist($table, $input, $compare);
|
||||
|
|
|
@ -116,6 +116,7 @@ interface IDBConnection {
|
|||
* @return int number of inserted rows
|
||||
* @throws \Doctrine\DBAL\DBALException
|
||||
* @since 6.0.0 - parameter $compare was added in 8.1.0, return type changed from boolean in 8.1.0
|
||||
* @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371
|
||||
*/
|
||||
public function insertIfNotExist($table, $input, array $compare = null);
|
||||
|
||||
|
|
Loading…
Reference in New Issue