fix(sessions): support MySQL and MariaDB schema creation - #4741
Open
linhongyu510 wants to merge 1 commit into
Open
fix(sessions): support MySQL and MariaDB schema creation#4741linhongyu510 wants to merge 1 commit into
linhongyu510 wants to merge 1 commit into
Conversation
Signed-off-by: linhongyu510 <linhongyu510@users.noreply.github.com>
Author
|
The |
Author
|
Follow-up live-database verification completed against a fresh MySQL 8.0.46 instance using SQLAlchemy 2.0.43 and aiomysql 0.3.2. I exercised the actual
The run completed with |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request fixes automatic SQLAlchemy session table creation on MySQL and MariaDB. Both dialects reject an unbounded
Stringwhen compiling indexedVARCHARcolumns, soSQLAlchemySession(create_tables=True)currently fails before issuing any DDL.Summary
VARCHAR(190)for bothsession_idcolumns on MySQL and MariaDB.VARCHARtype on PostgreSQL and SQLite.(session_id, created_at)index remains within the traditional 767-byte InnoDB key limit underutf8mb4.MetaData.create_all()regression tests for MySQL and MariaDB covering both tables,ON DELETE CASCADE, and the full composite index.Test plan
uv run --extra sqlalchemy pytest -q tests/extensions/memory/test_sqlalchemy_session.py(46 passed).agents/skills/code-change-verification/scripts/run.shIssue number
Closes #4740
Checks
.agents/skills/code-change-verification/scripts/run.sh/reviewbefore submitting this PR