Pull merge.
[yaffs-website] / web / core / lib / Drupal / Core / Database / Driver / sqlite / Truncate.php
1 <?php
2
3 namespace Drupal\Core\Database\Driver\sqlite;
4
5 use Drupal\Core\Database\Query\Truncate as QueryTruncate;
6
7 /**
8  * SQLite implementation of \Drupal\Core\Database\Query\Truncate.
9  *
10  * SQLite doesn't support TRUNCATE, but a DELETE query with no condition has
11  * exactly the effect (it is implemented by DROPing the table).
12  */
13 class Truncate extends QueryTruncate {
14
15   public function __toString() {
16     // Create a sanitized comment string to prepend to the query.
17     $comments = $this->connection->makeComment($this->comments);
18
19     return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} ';
20   }
21
22 }