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: docs/advanced/joins.md
+41-2Lines changed: 41 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -201,9 +201,48 @@ This works for both `get_joined` and `get_multi_joined`.
201
201
202
202
Note that the final `"_"` in the passed `"tier_"` is stripped.
203
203
204
-
!!! WARNING "join_prefix and return_as_model Compatibility"
204
+
#### Returning Pydantic Models with `return_as_model`
205
205
206
-
When using `return_as_model=True` with `nest_joins=True`, ensure that your `join_prefix` (minus trailing "_") matches the field name in your Pydantic schema. Otherwise, FastCRUD will raise a `ValueError` with clear guidance on how to fix the mismatch.
206
+
By default, `get_joined` returns dictionaries containing the joined data. However, you can use the `return_as_model` parameter to get Pydantic model instances instead:
**Required Parameters**: When `return_as_model=True`, the `schema_to_select` parameter is required. FastCRUD will raise a `ValueError` if you try to use `return_as_model=True` without providing a schema.
242
+
243
+
**Schema Design**: Ensure your schema includes all the fields that will be present in the flattened result, including joined fields with their prefixes.
244
+
245
+
**Nested Joins Compatibility**: When using `return_as_model=True` with `nest_joins=True`, ensure that your `join_prefix` (minus trailing "_") matches the field name in your Pydantic schema. Otherwise, FastCRUD will raise a `ValueError` with clear guidance on how to fix the mismatch.
Copy file name to clipboardExpand all lines: docs/changelog.md
+32Lines changed: 32 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,38 @@
5
5
The Changelog documents all notable changes made to FastCRUD. This includes new features, bug fixes, and improvements. It's organized by version and date, providing a clear history of the library's development.
6
6
___
7
7
8
+
## [0.19.2] - Nov 15, 2025
9
+
10
+
#### Added
11
+
-**get_joined Method Overloads** by [@igorbenav](https://github.com/igorbenav)
12
+
- Added missing `@overload` signatures for `get_joined()` method to support proper type inference
13
+
- Added `return_as_model` parameter for converting joined results to Pydantic models
14
+
- Enhanced type safety: returns `SelectSchemaType` when `return_as_model=True`, `dict` when `False`
15
+
- Consistent API with other CRUD methods like `get()`, `update()`, etc.
16
+
17
+
#### Improved
18
+
-**create Method Performance and Consistency** by [@igorbenav](https://github.com/igorbenav)
19
+
- Removed unnecessary database round-trip by eliminating redundant `get()` call after creation
20
+
- Added deprecation warnings for upcoming API consistency changes in next major version
21
+
- Fixed type hints to match actual implementation behavior (removed incorrect `None` return type)
-`create()` without `schema_to_select` will return `None` instead of SQLAlchemy model in next major version
26
+
-`create()` with `schema_to_select` will properly respect `return_as_model` parameter in next major version
27
+
- These changes align `create()` behavior with `update()` and other CRUD methods for consistency
28
+
29
+
#### Fixed
30
+
-**Type Safety Issues** by [@igorbenav](https://github.com/igorbenav)
31
+
- Fixed `get_joined()` method type annotations to properly reflect actual return types
32
+
- Corrected `create()` method type hints to remove impossible `None` return type
33
+
- Enhanced test coverage with 8 new comprehensive tests for `get_joined` return type variations
34
+
35
+
#### Breaking Changes
36
+
⚠️ **None** - This release maintains full backward compatibility with 0.19.1. Deprecation warnings provide clear migration path for next major version.
**Upcoming Changes in Next Major Version**: The `create()` method currently behaves inconsistently compared to other CRUD methods like `update()`. It will change:
134
+
135
+
- **Currently without `schema_to_select`**: Returns SQLAlchemy model → **Will return `None`**
136
+
- **Currently with `schema_to_select`**: Bypasses `return_as_model` parameter → **Will respect `return_as_model` like other methods**
137
+
138
+
This makes `create()` consistent with `update()` behavior. Current usage patterns will trigger deprecation warnings. See [changelog](../changelog.md#0192---nov-15-2025) for details.
139
+
131
140
!!! WARNING
132
141
133
142
Note that naive `datetime` such as `datetime.utcnow` is not supported by `FastCRUD` as it was [deprecated](https://github.com/python/cpython/pull/103858).
0 commit comments