Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Commit

Permalink
- added the support to force the returning key in Postgres insert que…
Browse files Browse the repository at this point in the history
…ries
  • Loading branch information
wolfy-j committed Feb 7, 2020
1 parent 318d4f4 commit 7154dc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
13 changes: 13 additions & 0 deletions tests/Database/Driver/Postgres/InsertQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}
13 changes: 0 additions & 13 deletions tests/Database/InsertQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
}
}

0 comments on commit 7154dc2

Please sign in to comment.