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
Copy file name to clipboardExpand all lines: README.md
+12-13Lines changed: 12 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,8 @@ class ShelterRepository(AbstractRepository[Shelter]):
84
84
"""Repository to manage shelters"""
85
85
```
86
86
87
+
Optionally, you may pass a `logger` keyword argument to the repository to log the operations. The logger should be a `structlog` logger with enabled `JSONRenderer`. If no logger is provided the repository will use its default logger (`SQLModelRepositoryLogger`).
88
+
87
89
Done 🚀 You can now use the repository to perform the operations on your entities. e.g.:
88
90
89
91
```python
@@ -113,11 +115,7 @@ Each `Repository` comes with a set of **typed methods** to perform common CRUD o
If you require more flexibility, you may also use the `BaseRepository` which provides more granular operations. The `BaseRepository` provides the following methods:
142
140
143
-
-`_create`: Create a new record of an entity
144
-
-`_create_batch`: Create a batch of records of an entity
145
-
-`_update`: Update an entity instance
146
-
-`_update_batch`: Update a batch of entity instances with the same values
147
-
-`_get`: Get a single record by its ID
148
-
-`_get_batch`: Get all records of an entity that match the given filters
149
-
-`_delete`: Delete an entity instance
150
-
-`_delete_batch`: Delete a batch of entity instances
141
+
-`create`: Create a new record of an entity
142
+
-`create_batch`: Create a batch of records of an entity
143
+
-`update`: Update an entity instance
144
+
-`update_batch`: Update a batch of entity instances with the same values
145
+
-`get`: Get a single record by its ID
146
+
-`get_batch`: Get all records of an entity that match the given filters
147
+
-`find`: Find all records of an entity that match the given filters
148
+
-`delete`: Delete an entity instance
149
+
-`delete_batch`: Delete a batch of entity instances
0 commit comments