Skip to content

Commit

Permalink
Remove obsolete SQLAlchemy future flags
Browse files Browse the repository at this point in the history
Importing from `sqlalchemy.future` and passing `future=True` when
creating sessions is no longer required since we require
SQLAlchemy 2.0 or later.
  • Loading branch information
rra committed Nov 23, 2024
1 parent 24fe2b5 commit 31c85f4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/user-guide/database/session.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ For example:
.. code-block:: python
import structlog
from sqlalchemy.future import select
from sqlalchemy import select
from .schema import User
Expand Down
6 changes: 2 additions & 4 deletions safir/src/safir/database/_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,9 @@ def create_database_engine(
"""
url = build_database_url(url, password)
if isolation_level:
return create_async_engine(
url, future=True, isolation_level=isolation_level
)
return create_async_engine(url, isolation_level=isolation_level)
else:
return create_async_engine(url, future=True)
return create_async_engine(url)


async def create_async_session(
Expand Down

0 comments on commit 31c85f4

Please sign in to comment.