diff options
Diffstat (limited to 'includes/database/sqlite')
-rw-r--r-- | includes/database/sqlite/query.inc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/database/sqlite/query.inc b/includes/database/sqlite/query.inc index ab6e2da50..98fa80754 100644 --- a/includes/database/sqlite/query.inc +++ b/includes/database/sqlite/query.inc @@ -136,5 +136,17 @@ class DeleteQuery_sqlite extends DeleteQuery { } /** + * SQLite specific implementation of TruncateQuery. + * + * SQLite doesn't support TRUNCATE, but a DELETE query with no condition has + * exactly the effect (it is implemented by DROPing the table). + */ +class TruncateQuery_sqlite extends TruncateQuery { + public function __toString() { + return 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '} '; + } +} + +/** * @} End of "ingroup database". */ |