OperationalError no such table in Flask with SQLAlchemy
For anyone trying to use an in memory database:
from sqlalchemy import create_engine
from sqlalchemy.pool import StaticPool
engine = create_engine(
"sqlite://",
connect_args={"check_same_thread": False},
poolclass=StaticPool
)
There were few things I had to change to make everything work.
- replace
DATABASE_URI
withSQLALCHEMY_DATABASE_URI
parametr in config - replace
:memory:
sqlite address with/tmp/test.db
Now it works fine.