Skip to content

test: add test for Postgre upsertBatch() - #8453

Merged
kenjis merged 1 commit into
codeigniter4:developfrom
kenjis:test-postgre-upsertBatch
Jan 25, 2024
Merged

test: add test for Postgre upsertBatch()#8453
kenjis merged 1 commit into
codeigniter4:developfrom
kenjis:test-postgre-upsertBatch

Conversation

@kenjis

@kenjiskenjis commented Jan 25, 2024

Copy link
Copy Markdown
Member

Description

  • add test
$data = [
// new row insert
[
'type_varchar' => 'insert', // Key'type_bigint' => 9_999_999,
'type_date' => '2024-01-01',
'type_datetime' => '2024-01-01 09:00:00',
],
// update
[
'type_varchar' => 'test1', // Key'type_bigint' => 9_999_999,
'type_date' => '2024-01-01',
'type_datetime' => '2024-01-01 09:00:00',
],
];
$builder->onConstraint('type_varchar')->upsertBatch($data);
INSERT INTO"db_type_test" ("type_bigint", "type_date", "type_datetime", "type_varchar")
VALUES (9999999,'2024-01-01','2024-01-01 09:00:00','insert'), (9999999,'2024-01-01','2024-01-01 09:00:00','test1')
ON CONFLICT("type_varchar")
DO UPDATESET"type_bigint"="excluded"."type_bigint",
"type_date"="excluded"."type_date",
"type_datetime"="excluded"."type_datetime"

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjiskenjis added the testing Pull requests that changes tests only label Jan 25, 2024

@sclubricantssclubricants left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@kenjis
kenjis merged commit 2190110 into codeigniter4:developJan 25, 2024
@kenjis
kenjis deleted the test-postgre-upsertBatch branch January 25, 2024 03:31
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

testingPull requests that changes tests only

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kenjis@sclubricants