Skip to content

Commit

Permalink
Enable "future" SQLAlchemy API
Browse files Browse the repository at this point in the history
  • Loading branch information
smsearcy committed Jun 23, 2023
1 parent 6c768df commit cebfd78
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions meshinfo/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@


def get_engine(settings):
return create_engine(**attr.asdict(settings))
return create_engine(future=True, **attr.asdict(settings))


def get_session_factory(engine) -> sessionmaker:
factory = sessionmaker()
factory.configure(bind=engine)
factory = sessionmaker(engine, future=True)
return factory


Expand Down
2 changes: 1 addition & 1 deletion meshinfo/models/meta.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import annotations

import pendulum
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import declarative_base
from sqlalchemy.schema import MetaData
from sqlalchemy.types import TIMESTAMP, TypeDecorator

Expand Down

0 comments on commit cebfd78

Please sign in to comment.