Skip to content

fix #638 updates for SQLAlchemy 2#639

Merged
robnagler merged 5 commits into
masterfrom
638-sqlalchemy2
Apr 28, 2026
Merged

fix #638 updates for SQLAlchemy 2#639
robnagler merged 5 commits into
masterfrom
638-sqlalchemy2

Conversation

@moellep

@moellep moellep commented Mar 12, 2026

Copy link
Copy Markdown
Member
  • wrap raw SQL in text() for SA 2 compatibility
  • use execution_options(autobegin=False) for explicit transactions
  • remove <2 cap on SQLAlchemy dependency

@moellep moellep marked this pull request as draft March 12, 2026 18:44
@moellep

moellep commented Mar 12, 2026

Copy link
Copy Markdown
Member Author

This needs more thought:
There should be a better way to access the row as a dictionary than going through ._mapping.
Clients of the API shouldn't be required to use ._mapping.
Also, sql_db methods which return a Row, like select_one() may want to return a PKDict directly.

@robnagler robnagler marked this pull request as ready for review April 28, 2026 16:22
moellep and others added 5 commits April 28, 2026 16:56
Restores the original pre-SA2 ordering (PRAGMA before begin) by
disabling autobegin on the connection, rather than reordering the lines.
Tested with SQLAlchemy 1.4 and 2.x.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@robnagler robnagler enabled auto-merge (squash) April 28, 2026 16:57
@robnagler robnagler merged commit 26d778b into master Apr 28, 2026
2 checks passed
@robnagler robnagler deleted the 638-sqlalchemy2 branch April 28, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants