Skip to content

Commit cdd32f1

Browse files
fix(storage): address PR review comments for skipDuplicatesCheck
- Use Booleanish validator and BoolUtils::castToBool for skipDuplicatesCheck parameter - Remove unnecessary exception handling for driver-based backends - Add unit tests for skipDuplicatesCheck parameter in CreatePrimaryKeyRequestTest - Add E2E test testPrimaryKeyAddWithDuplicitySkipCheck - Update Storage API client to support skipDuplicatesCheck option Co-Authored-By: Martin Zajic <ja@mzajic.cz>
1 parent 07a3eda commit cdd32f1

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/Keboola/StorageApi/Client.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3233,12 +3233,16 @@ public function removeTablePrimaryKey($tableId)
32333233
*
32343234
* @param string $tableId
32353235
* @param array $columns
3236+
* @param array $options
32363237
*/
3237-
public function createTablePrimaryKey($tableId, $columns)
3238+
public function createTablePrimaryKey($tableId, $columns, $options = [])
32383239
{
32393240
$data = [
32403241
'columns' => $columns,
32413242
];
3243+
if (isset($options['skipDuplicatesCheck'])) {
3244+
$data['skipDuplicatesCheck'] = $options['skipDuplicatesCheck'];
3245+
}
32423246
$this->apiPostJson("tables/$tableId/primary-key", $data);
32433247
}
32443248

0 commit comments

Comments
 (0)