AdapterSqlite

class OC\DB\AdapterSqlite
Source:lib/private/DB/AdapterSqlite.php#32
Parent:OC\DB\Adapter

Methods

public OC\DB\AdapterSqlite::lockTable($tableName)
Source:

lib/private/DB/AdapterSqlite.php#37

Parameters:
  • $tableName (string)
public OC\DB\AdapterSqlite::unlockTable()
Source:lib/private/DB/AdapterSqlite.php#41
public OC\DB\AdapterSqlite::fixupStatement($statement)
Source:lib/private/DB/AdapterSqlite.php#45
public OC\DB\AdapterSqlite::insertIfNotExist($table, $input, $compare=null)
Insert a row if the matching row does not exists. To accomplish proper race condition avoidance
it is needed that there is also a unique constraint on the values. Then this method will
catch the exception and return 0.
Source:

lib/private/DB/AdapterSqlite.php#68

Parameters:
  • $table (string) The table name (will replace PREFIX with the actual prefix)
  • $input (array) data that should be inserted into the table (column name => value)
  • $compare (array | null) List of values that should be checked for “if not exists”

If this is null or an empty array, all keys of $input will be compared Please note: text fields (clob) must not be used in the compare array

Returns:

int number of inserted rows

Throws:

\Doctrine\DBAL\Exception

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