Browse Source

Revert "Add RETURNING * support to Sqlite driver"

This reverts commit bf1a682736e6a9d0a946c0fe9c4e4ff28f5880cc.
Corey Taylor 4 years ago
parent
commit
f55cf21177
2 changed files with 0 additions and 40 deletions
  1. 0 15
      src/Database/Driver/Sqlite.php
  2. 0 25
      tests/TestCase/Database/Driver/SqliteTest.php

+ 0 - 15
src/Database/Driver/Sqlite.php

@@ -109,7 +109,6 @@ class Sqlite extends Driver
      */
     protected $featureVersions = [
         'cte' => '3.8.3',
-        'returning' => '3.35.0',
         'window' => '3.28.0',
     ];
 
@@ -276,20 +275,6 @@ class Sqlite extends Driver
     /**
      * @inheritDoc
      */
-    protected function _insertQueryTranslator(Query $query): Query
-    {
-        if (version_compare($this->version(), $this->featureVersions['returning'], '>=')) {
-            if (!$query->clause('epilog')) {
-                $query->epilog('RETURNING *');
-            }
-        }
-
-        return $query;
-    }
-
-    /**
-     * @inheritDoc
-     */
     protected function _expressionTranslators(): array
     {
         return [

+ 0 - 25
tests/TestCase/Database/Driver/SqliteTest.php

@@ -140,31 +140,6 @@ class SqliteTest extends TestCase
     }
 
     /**
-     * Tests that insert queries get a "RETURNING *" string at the end
-     */
-    public function testInsertReturning(): void
-    {
-        $driver = ConnectionManager::get('test')->getDriver();
-        $this->skipIf(!$driver instanceof Sqlite || version_compare($driver->version(), '3.35.0', '<'));
-
-        $query = ConnectionManager::get('test')->newQuery()
-            ->insert(['id', 'title'])
-            ->into('articles')
-            ->values([1, 'foo']);
-        $translator = $driver->queryTranslator('insert');
-        $query = $translator($query);
-        $this->assertSame('RETURNING *', $query->clause('epilog'));
-
-        $query = ConnectionManager::get('test')->newQuery()
-            ->insert(['id', 'title'])
-            ->into('articles')
-            ->values([1, 'foo'])
-            ->epilog('CUSTOM EPILOG');
-        $query = $translator($query);
-        $this->assertSame('CUSTOM EPILOG', $query->clause('epilog'));
-    }
-
-    /**
      * Data provider for schemaValue()
      *
      * @return array