Skip to content
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

feat: [Validation] add support for dbGroup as parameter in is_unique and is_not_unique #9216

Open
wants to merge 4 commits into
base: 4.6
Choose a base branch
from

Conversation

maniaba
Copy link
Contributor

@maniaba maniaba commented Oct 6, 2024

Description

See: #9215

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

@ddevsr ddevsr added the wrong branch PRs sent to wrong branch label Oct 7, 2024
@ddevsr
Copy link
Collaborator

ddevsr commented Oct 7, 2024

This is enchantment, send to branch 4.6

…atabase connections

cs fixer

docs format

fix rules

add test testIsNotUniqueWithDBConnectionAsParameter
@maniaba maniaba changed the base branch from develop to 4.6 October 7, 2024 20:29
@maniaba
Copy link
Contributor Author

maniaba commented Oct 7, 2024

This is enchantment, send to branch 4.6

I’ve switched to branch 4.6, everything is now set. Could you please remove the 'wrong branch' label?

@ddevsr ddevsr added 4.6 enhancement PRs that improve existing functionalities and removed wrong branch PRs sent to wrong branch labels Oct 10, 2024
Copy link
Member

@michalsn michalsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks good.

Comment on lines +889 to +895
.. note:: Since version v4.6.0, you can optionally include ``dbGroup`` in validation rules like ``is_unique`` and ``is_not_unique``.
This allows specifying which database connection to use during validation, giving you more flexibility when working with multiple databases.
To use ``dbGroup``, you place it before the table name in the validation rule, like this:
``is_unique[dbGroup.table.field,ignore_field,ignore_value]`` or ``is_not_unique[dbGroup.table.field,where_field,where_value]``.
In these examples, ``dbGroup`` is used to select the appropriate database connection for the specified table and field.
If ``dbGroup`` is not provided, the default database group will be used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if we should add such an extensive description of these changes here.

The description in the following table is sufficient for me. The user guide cannot be covered with continuous notes, because it becomes unreadable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.6 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants