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

Add regex operator #304

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions gqlalchemy/query_builders/declarative_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ class Operator(Enum):
LEQ_THAN = "<="
NOT_EQUAL = "!="
INCREMENT = "+="
SIMILAR = "=~"


class Order(Enum):
Expand Down
3 changes: 1 addition & 2 deletions tests/query_builders/test_query_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def test_multiple_merges(self, vendor):

mock.assert_called_with(expected_query)

@pytest.mark.parametrize("operator", ["=", "<>", "<", "!=", ">", "<=", ">="])
@pytest.mark.parametrize("operator", ["=", "<>", "<", "!=", ">", "<=", ">=", "=~"])
def test_where_without_operator_enum(self, vendor, operator):
query_builder = (
vendor[1]
Expand All @@ -318,7 +318,6 @@ def test_where_without_operator_enum(self, vendor, operator):
.return_()
)
expected_query = f" MATCH (n:L1)-[:TO]->(m:L2) WHERE n.name {operator} 'best_name' RETURN * "

with patch.object(vendor[0], "execute_and_fetch", return_value=None) as mock:
query_builder.execute()

Expand Down
Loading