-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[QueryBuilder] The combination of the setUpdateBatch()
and the updateBatch()
is difficult to use.
#5134
Comments
In both cases, it is a breaking change in the public API of updateBatch(). |
Thanks, response. |
I was wondering if the following code could be implemented without adding breaking change if the user has called setUpdateBatch at least once. The concrete method is to change the behavior of
$builder->setUpdateBatch([
[
'id' => 2,
'name' => 'SUBSTRING(name, 1)',
'description' => 'SUBSTRING(description, 3)',
],
[
'id' => 3,
'name' => 'SUBSTRING(name, 2)',
'description' => 'SUBSTRING(description, 4)',
],
], 'id', false);
$builder->updateBatch(100); |
@ytetsuro I think the API you propose is better. It is easy to use. But unfortunately, the first param of CodeIgniter4/system/Database/BaseBuilder.php Line 1935 in 4576b12
If you change it to accept |
You could write code like this on PHP8: $builder->updateBatch(batchSize: 100); https://www.php.net/manual/en/functions.arguments.php#functions.named-arguments |
Or how about this? $builder->setUpdateBatch([
[
'id' => 2,
'name' => 'SUBSTRING(name, 1)',
'description' => 'SUBSTRING(description, 3)',
],
[
'id' => 3,
'name' => 'SUBSTRING(name, 2)',
'description' => 'SUBSTRING(description, 4)',
],
], 'id', false);
$builder->setBatchSize(100);
$builder->updateBatch(); |
Thanks, response.
Sure!
Oh! You are great!
Thanks. |
setUpdateBatch
method and the updateBatch
method is difficult to use.setUpdateBatch()
and the updateBatch()
is difficult to use.
The combination of the
setUpdateBatch
method and theupdateBatch
method is difficult to use.If you try to use it, it will look like the following.
escape
argument.updateBatch
.In my opinion, it would be easier for developers to use if they can write the following.
or
What do you think?
The text was updated successfully, but these errors were encountered: