CodeIgniter4
CodeIgniter4 copied to clipboard
feat: [CLI] Insert DBGroup variable in CLI validate method
Description Allow a different DBGroup to be added in CLI class validations.
Checklist:
- [ ] Securely signed commits
- [ ] Component(s) with PHPDoc blocks, only if necessary or adds value
- [ ] Unit testing, with >80% coverage
- [ ] User guide updated
- [ ] Conforms to style guide
Please sign all commits.
We ask that contributions have code commits signed. This is important in order to prove, as best we can, the provenance of contributions. See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/signing.md
Add test code.
We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works. https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#contributions
@codeigniter4/core-team Is this a bug fix?
This is a feature.
But I'm confused why CLI has to know the database group for prompts. It feels out of place here.
I I'm doing the secure commit but it doesn't detect it
@daycry What do you mean? What did you do exactly?
@daycry
The email in this signature doesn’t match the committer email.
@daycry Why do you need to add this?
If you want validate rules with another database, you cant It, because now you cant pass DBGroup variable in prompt función.
On Thu, 11 Apr 2024, 12:12 kenjis, @.***> wrote:
@daycry https://github.com/daycry Why do you need to add this?
— Reply to this email directly, view it on GitHub https://github.com/codeigniter4/CodeIgniter4/pull/8762#issuecomment-2049364807, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZ5DP34BQJNEUNMJPHI33TY4ZOZNAVCNFSM6AAAAABGB3Y6R6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBZGM3DIOBQG4 . You are receiving this because you were mentioned.Message ID: @.***>
@daycry Okay, but this is an enhancement. So please change the base branch to 4.6
.
See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/workflow.md#if-you-sent-to-the-wrong-branch
@paulbalandan The database group is a part of the validation rules. But it cannot be set in the rule. After all, there seems no good other way to set it.
I have a feeling that it would be better to set up the following:
is_unique[table.field,ignore_field,ignore_value,db_group]
However, if we do so, we will not be able to pass a DB connection instance.
I wan't pass DB connection instance, only DBGroup name, but I will try this.
is_unique[table.field,ignore_field,ignore_value,db_group]
Thanks
[!IMPORTANT] We expect all code changes or bug-fixes to be accompanied by one or more tests added to our test suite to prove the code works.
This PR does not have the necessary test code. If you want this PR to be reviewed, please add the test code. See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md#unit-testing
If the test is not added, this PR will be closed.