Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DB Insert Ignore (Tada5hi/database-feature) #2446

Merged
merged 12 commits into from
Dec 10, 2019
Prev Previous commit
Next Next commit
fixed postgre builder methods
tada5hi committed Aug 23, 2019

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit fa0bf1d6ac3b9fcc674382a7eb17ffee28393b2b
5 changes: 3 additions & 2 deletions system/Database/Postgre/Builder.php
Original file line number Diff line number Diff line change
@@ -39,6 +39,7 @@

use CodeIgniter\Database\BaseBuilder;
use CodeIgniter\Database\Exceptions\DatabaseException;
use http\Encoding\Stream\Inflate;

/**
* Builder for Postgre
@@ -178,7 +179,7 @@ public function decrement(string $column, int $value = 1)
*
* @return string
*/
protected function _insertBatch($table, $keys, $values)
protected function _insertBatch(string $table, array $keys, array $values) : string
{
return 'INSERT INTO ' . $table . ' (' . implode(', ', $keys) . ') VALUES ' . implode(', ', $values) . $this->compileIgnore('insert');
}
@@ -196,7 +197,7 @@ protected function _insertBatch($table, $keys, $values)
*
* @return string
*/
protected function _insert($table, array $keys, array $unescapedKeys)
protected function _insert(string $table, array $keys, array $unescapedKeys) : string
{
return 'INSERT INTO ' . $table . ' (' . implode(', ', $keys) . ') VALUES (' . implode(', ', $unescapedKeys) . ')' . $this->compileIgnore('insert');
}