From 7e3ce8352666af86d597e1fdce95bfe57531207e Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 19 May 2016 12:34:40 +0200 Subject: Add a method to lock a table --- lib/private/DB/AdapterSqlite.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/private/DB/AdapterSqlite.php') diff --git a/lib/private/DB/AdapterSqlite.php b/lib/private/DB/AdapterSqlite.php index 3466e0e1aac..cefb06ffac6 100644 --- a/lib/private/DB/AdapterSqlite.php +++ b/lib/private/DB/AdapterSqlite.php @@ -27,6 +27,18 @@ namespace OC\DB; class AdapterSqlite extends Adapter { + + /** + * @param string $tableName + */ + public function lockTable($tableName) { + $this->conn->executeUpdate('BEGIN EXCLUSIVE TRANSACTION'); + } + + public function unlockTable() { + $this->conn->executeUpdate('COMMIT TRANSACTION'); + } + public function fixupStatement($statement) { $statement = preg_replace('( I?LIKE \?)', '$0 ESCAPE \'\\\'', $statement); $statement = preg_replace('/`(\w+)` ILIKE \?/', 'LOWER($1) LIKE LOWER(?)', $statement); -- cgit v1.2.3