You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Enhance query handling with IN operator support and related tests
- Updated `CrudRepositoryImplementationService` to support IN operations in query filtering, including validation for parameter types and handling of empty lists.
- Modified `_Query` class to include `field_operations` for mapping field names to their respective operations.
- Enhanced `_MetodQueryBuilder` to parse method names with IN operations and generate appropriate query structures.
- Added comprehensive unit tests for IN operator functionality, including cases for single fields, multiple fields with AND/OR conditions, and error handling for invalid types and empty lists.
- Updated existing tests to reflect changes in query structure and ensure correct SQL statement generation.
Copy file name to clipboardExpand all lines: py_spring_model/py_spring_model_rest/service/curd_repository_implementation_service/crud_repository_implementation_service.py
Copy file name to clipboardExpand all lines: py_spring_model/py_spring_model_rest/service/curd_repository_implementation_service/method_query_builder.py
+20-4Lines changed: 20 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
importre
2
+
fromtypingimportDict, Any
2
3
3
4
frompydanticimportBaseModel
4
5
@@ -9,12 +10,14 @@ class _Query(BaseModel):
9
10
- `conditions`: A list of string conditions that will be used to filter the query.
10
11
- `is_one_result`: A boolean indicating whether the query should return a single result or a list of results.
11
12
- `required_fields`: A list of string field names that should be included in the query result.
13
+
- `field_operations`: A dictionary mapping field names to their operations (e.g., "in" for IN operator).
0 commit comments