-
Notifications
You must be signed in to change notification settings - Fork 9
Open
Description
I write this for have available use types in bulk insert:
private function types(array $types, int $datasetLength, array $columns): array
{
$positionalTypes = [];
for ($dataRowIdx = 0; $dataRowIdx < $datasetLength; $dataRowIdx++) {
foreach (array_values($columns) as $columnIndex => $column) {
$columnIndex = $columnIndex + $dataRowIdx * count($columns);
$positionalTypes[$columnIndex] = null;
if (array_key_exists($column, $types)) {
$positionalTypes[$columnIndex] = $types[$column];
}
}
}
return $positionalTypes;
}
And
return $this->connection->executeUpdate($sql, $this->parameters($dataset), $this->types($types, count($dataset), $this->extractColumns($dataset)));
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels