From 7154dc22331d73bde4fa36a107f46ff99f68ee6a Mon Sep 17 00:00:00 2001 From: Wolfy-J Date: Fri, 7 Feb 2020 12:29:22 +0300 Subject: [PATCH] - added the support to force the returning key in Postgres insert queries --- tests/Database/Driver/Postgres/InsertQueryTest.php | 13 +++++++++++++ tests/Database/InsertQueryTest.php | 13 ------------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/Database/Driver/Postgres/InsertQueryTest.php b/tests/Database/Driver/Postgres/InsertQueryTest.php index 12a26293..abe5b32e 100644 --- a/tests/Database/Driver/Postgres/InsertQueryTest.php +++ b/tests/Database/Driver/Postgres/InsertQueryTest.php @@ -77,4 +77,17 @@ public function testSimpleInsertMultipleRows(): void $insert ); } + + public function testCustomReturning(): void + { + $insert = $this->database->insert()->into('table') + ->columns('name', 'balance') + ->values('Anton', 100) + ->returning('name'); + + $this->assertSameQuery( + 'INSERT INTO {table} ({name}, {balance}) VALUES (?, ?) RETURNING {name}', + $insert + ); + } } diff --git a/tests/Database/InsertQueryTest.php b/tests/Database/InsertQueryTest.php index 84a5702d..c418dc87 100644 --- a/tests/Database/InsertQueryTest.php +++ b/tests/Database/InsertQueryTest.php @@ -76,17 +76,4 @@ public function testSimpleInsertMultipleRows(): void $insert ); } - - public function testCustomReturning(): void - { - $insert = $this->database->insert()->into('table') - ->columns('name', 'balance') - ->values('Anton', 100) - ->returning('name'); - - $this->assertSameQuery( - 'INSERT INTO {table} ({name}, {balance}) VALUES (?, ?) RETURNING {name}', - $insert - ); - } }