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: examples/sqlalchemy_1.6_to_2.0/README.md
+25-4Lines changed: 25 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
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
6
7
-
## What This Example Does
7
+
## How the Migration Script Works
8
8
9
9
The migration script handles four key transformations:
10
10
@@ -18,6 +18,9 @@ The migration script handles four key transformations:
18
18
select(User).where(User.name =='john')
19
19
).scalars().all()
20
20
```
21
+
- Replaces legacy `query()` syntax with modern `select()` statements
22
+
- Updates filter conditions to use explicit comparison operators
23
+
- Adds proper `execute()` and `scalars()` chain
21
24
22
25
2.**Update Session Execution**
23
26
```python
@@ -29,6 +32,9 @@ The migration script handles four key transformations:
0 commit comments