summaryrefslogtreecommitdiffstats
path: root/lib/private/DB/AdapterSqlite.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-05-19 12:34:40 +0200
committerJoas Schilling <nickvergessen@owncloud.com>2016-05-21 01:59:03 +0200
commit7e3ce8352666af86d597e1fdce95bfe57531207e (patch)
tree4d0641773e8f1e740285ea7b6bfdf497409a5b78 /lib/private/DB/AdapterSqlite.php
parent59a85a4c76b80658d9373e3acf4f71b872b244a0 (diff)
downloadnextcloud-server-7e3ce8352666af86d597e1fdce95bfe57531207e.tar.gz
nextcloud-server-7e3ce8352666af86d597e1fdce95bfe57531207e.zip
Add a method to lock a table
Diffstat (limited to 'lib/private/DB/AdapterSqlite.php')
-rw-r--r--lib/private/DB/AdapterSqlite.php12
1 files changed, 12 insertions, 0 deletions
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);