Commit 082f555
committed
enhance QueryRecorder to track which database bind is used for each query
Replace flask_sqlalchemy's get_recorded_queries with SQLAlchemy event listeners that capture the bind_key for each engine. Add QueryInfo dataclass with statement, parameters, and bind_key fields. This enables tests to verify that queries are being routed to the correct database when using db.session_bulk.
This is an alternative to the existing PR pallets-eco/flask-sqlalchemy#1403 for flask-sqlalchemy.1 parent aae5d26 commit 082f555
1 file changed
+37
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
2 | 13 | | |
3 | 14 | | |
4 | 15 | | |
5 | 16 | | |
6 | | - | |
7 | | - | |
| 17 | + | |
| 18 | + | |
8 | 19 | | |
9 | 20 | | |
10 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
11 | 26 | | |
12 | 27 | | |
13 | 28 | | |
14 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
0 commit comments