Skip to content

Commit

Permalink
Add =~ operator (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
imilinovic authored Jul 9, 2024
1 parent e3f1b61 commit 43c302f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 43c302f

Please sign in to comment.