Closed Tigrov closed 6 months ago
1 - 👍 2 - but we don't know order of fields in rows, also rows may contain not all fields. Seems, it's can lead to errors in user code. 3 - 👍
If no colums passed then means columns have order as in table schema
INSERT INTO table (columns) VALUES (values)
not all fields also possible, only first fields will be used
If no colums passed then means columns have order as in table schema
But why need columns in this case? Isn't that the equivalent to way 3?
But why need columns in this case? Isn't that the equivalent to way 3?
Columns are needed for type casting and seems not all DBMS supports partial lists of values, but we can support them
$columns
can be obtained$rows
if values are associative array$table
if table shema foundNeed to replace arguments from
DMLQueryBuilderInterface::batchInsert(string $table, array $columns, iterable $rows, array &$params = [])
toDMLQueryBuilderInterface::batchInsert(string $table, iterable $rows, array $columns = [], array &$params = [])
This will allow to use the method this way
batchInsert($table, $rows)