Skip to content

Commit 61d80b0

Browse files
committed
docs: correct create_engine description in create-db-and-table
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>
1 parent 07b69be commit 61d80b0

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/tutorial/create-db-and-table.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,9 @@ If you didn't know about SQLAlchemy before and are just learning **SQLModel**, y
204204

205205
You can read a lot more about the engine in the [SQLAlchemy documentation](https://docs.sqlalchemy.org/en/14/tutorial/engine.html).
206206

207-
**SQLModel** defines its own `create_engine()` function. It is the same as SQLAlchemy's `create_engine()`, but with the difference that it defaults to use `future=True` (which means that it uses the style of the latest SQLAlchemy, 1.4, and the future 2.0).
207+
**SQLModel** re-exports SQLAlchemy's `create_engine()` directly, so `sqlmodel.create_engine` is the same function as `sqlalchemy.create_engine`. SQLModel requires SQLAlchemy 2.0 or above, which uses the modern 2.0 style by default.
208208

209-
And SQLModel's version of `create_engine()` is type annotated internally, so your editor will be able to help you with autocompletion and inline errors.
209+
SQLAlchemy's `create_engine()` is type annotated, so your editor will be able to help you with autocompletion and inline errors.
210210

211211
## Create the Database and Table
212212

0 commit comments

Comments
 (0)