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
This example demonstrates how to use Codegen to automatically migrate SQLAlchemy 1.6 code to the new 2.0-style query interface. For a complete walkthrough, check out our [tutorial](https://docs.codegen.com/tutorials/sqlalchemy-1.6-to-2.0).
6
4
7
-
## What This Example Does
5
+
## How the Migration Script Works
8
6
9
-
The migration script handles four key transformations:
7
+
The codemod script handles four key transformations:
10
8
11
9
1.**Convert Query to Select**
12
10
```python
@@ -18,6 +16,7 @@ The migration script handles four key transformations:
18
16
select(User).where(User.name =='john')
19
17
).scalars().all()
20
18
```
19
+
This transformation replaces the legacy Query interface with the new Select-based API, providing better type safety and consistency.
21
20
22
21
2.**Update Session Execution**
23
22
```python
@@ -29,6 +28,7 @@ The migration script handles four key transformations:
0 commit comments