Skip to content

Commit

Permalink
Merge branch 'master' into batchInsert-empty-columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Tigrov committed Jan 3, 2024
2 parents e300961 + 65497c3 commit 250e0f2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.1.1 under development

- Enh #312: Change property `Schema::$typeMap` to constant `Schema::TYPE_MAP` (@Tigrov)
- Bug #314: Fix `Command::insertWithReturningPks()` method for empty values (@Tigrov)

## 1.1.0 November 12, 2023

Expand Down
3 changes: 2 additions & 1 deletion src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ public function insertWithReturningPks(string $table, array $columns): bool|arra
$sql = $this->db->getQueryBuilder()->insert($table, $columns, $params);
$this->setSql($sql)->bindValues($params);

$tableSchema = $this->db->getSchema()->getTableSchema($table);

if (!$this->execute()) {
return false;
}

$tableSchema = $this->db->getSchema()->getTableSchema($table);
$tablePrimaryKeys = $tableSchema?->getPrimaryKey() ?? [];
$result = [];

Expand Down

0 comments on commit 250e0f2

Please sign in to comment.