Correct create_engine description in create-db-and-table tutorial#2037
Closed
anxkhn wants to merge 1 commit into
Closed
Correct create_engine description in create-db-and-table tutorial#2037anxkhn wants to merge 1 commit into
anxkhn wants to merge 1 commit into
Conversation
SQLModel re-exports SQLAlchemy's create_engine directly (sqlmodel.create_engine is sqlalchemy.create_engine), it does not define its own wrapper. The previous text described an obsolete future=True default and SQLAlchemy 1.4/2.0 framing that no longer applies now that SQLModel requires SQLAlchemy 2.0. Signed-off-by: Anas Khan <83116240+anxkhn@users.noreply.github.com>
Contributor
📝 Docs previewLast commit 61d80b0 at: https://feee8c7b.sqlmodel.pages.dev Modified Pages |
Contributor
|
This was marked as potentially AI generated and will be closed now. If this is an error, please provide additional details, make sure to read the docs about contributing and AI. |
Member
|
@anxkhn, please, stop opening PRs with AI-tools! |
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.
The "Engine Technical Details" tip in the create-db-and-table tutorial describes
create_engine()in a way that no longer matches SQLModel:SQLModel no longer defines its own
create_engine(). Since the SQLAlchemy 2.0upgrade it is a direct re-export:
so
sqlmodel.create_engine is sqlalchemy.create_engineisTrue. There is nowrapper anymore, and the
future=True/ "latest SQLAlchemy, 1.4, and the future2.0" framing is obsolete:
pyproject.tomlrequiresSQLAlchemy >=2.0.14,<2.1.0,where the 2.0 style is the only mode and
futureis no longer a meaningful toggle(SQLAlchemy 2.0 rejects
future=False). The type annotations now come fromSQLAlchemy itself (
create_enginereturns an annotatedEngine).This updates the two sentences to say that SQLModel re-exports SQLAlchemy's
create_engine()directly, requires SQLAlchemy 2.0+, and that SQLAlchemy'screate_engine()is type annotated. Docs-only, no code change.