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: Add support for various field operations in dynamic queries
- Introduced new field operations such as IN, GREATER_THAN, LESS_THAN, and LIKE to enhance dynamic query generation capabilities.
- Updated the documentation to include detailed descriptions and examples of supported field operations.
- Modified the `UserRepository` and `ProductRepository` classes to implement new methods for these operations, ensuring consistent usage across repositories.
- Enhanced return types for query methods to use `Optional` for better handling of potential null results.
Copy file name to clipboardExpand all lines: README.md
+155-3Lines changed: 155 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ Features
10
10
- Automatic CRUD Repository: PySpringModel automatically generates a CRUD repository for each of your SQLModel entities, providing common database operations such as Create, Read, Update, and Delete.
11
11
- Managed Sessions: PySpringModel provides a context manager for database sessions, automatically handling session commit and rollback to ensure data consistency.
12
12
- Dynamic Query Generation: PySpringModel can dynamically generate and execute SQL queries based on method names in your repositories.
13
+
- Field Operations Support: PySpringModel supports various field operations like IN, NOT IN, greater than, less than, LIKE, and more.
13
14
- Custom SQL Queries: PySpringModel supports custom SQL queries using the `@Query` decorator for complex database operations.
14
15
- RESTful API Integration: PySpringModel integrates with the PySpring framework to automatically generate basic table CRUD APIs for your SQLModel entities.
15
16
@@ -50,6 +51,11 @@ class UserRepository(CrudRepository[int, User]):
Copy file name to clipboardExpand all lines: py_spring_model/docs/query_operators.md
+20-20Lines changed: 20 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Field Operations Support in PySpringModel
2
2
3
-
PySpringModel now supports multiple field operations for dynamic query generation, similar to Spring Data JPA. This allows you to find entities using various comparison operators and conditions.
3
+
PySpringModel supports multiple field operations for dynamic query generation, similar to Spring Data JPA. This allows you to find entities using various comparison operators and conditions.
4
4
5
5
## Supported Field Operations
6
6
@@ -24,7 +24,7 @@ To use field operations, append the appropriate suffix to your field name in the
24
24
25
25
```python
26
26
from py_spring_model import PySpringModel, Field, CrudRepository
27
-
from typing import List
27
+
from typing import List, Optional
28
28
29
29
classUser(PySpringModel, table=True):
30
30
id: int= Field(default=None, primary_key=True)
@@ -41,16 +41,16 @@ class UserRepository(CrudRepository[int, User]):
0 commit comments