Skip to content

Conversation

@larsschwegmann
Copy link
Contributor

This PR adds support for the Postgres "~" posix regex operator and the MySQL "RLIKE" operator as a filter operator for char fields ("__posix_regex").

Description

I needed support for filtering with the "~" operator offered by postgres (9.7.3. POSIX Regular Expressions)

Motivation and Context

The POSIX regex operator is more powerful than the LIKE statement.

How Has This Been Tested?

I added two tests for the postgres and mysql backends

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added the changelog accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@abondar
Copy link
Member

abondar commented Sep 26, 2024

Hi!

Can you please rebase on new develop, previous commit had faulty version of mssql there, so CI was failing

@larsschwegmann
Copy link
Contributor Author

Hi @abondar , I just rebased onto the latest develop 😄

@abondar
Copy link
Member

abondar commented Sep 29, 2024

@larsschwegmann there seems to be mypy issues in CI

You can run mypy locally with make lint

@larsschwegmann
Copy link
Contributor Author

@abondar Thanks, I have run that locally and fixed the mypy issue now 👍

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11092126846

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 10 of 13 (76.92%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 88.991%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tortoise/backends/mysql/executor.py 2 3 66.67%
tortoise/contrib/postgres/regex.py 5 6 83.33%
tortoise/filters.py 1 2 50.0%
Totals Coverage Status
Change from base Build 11067278859: -0.02%
Covered Lines: 5973
Relevant Lines: 6597

💛 - Coveralls

@abondar abondar merged commit d601ba0 into tortoise:develop Sep 29, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants