Enum objects linked to a specific metadata lock up SQLA when attempting to create_all on sqlite

Issue #3125 duplicate
Tiemo Kieft created an issue

I have a schema that defines some Enum's, running create_all() works fine on Postgres, but on SQLite it locks up.

The code below demonstrates the problem:

from sqlalchemy import create_engine, Enum
from sqlalchemy.orm import sessionmaker
from sqlalchemy.ext.declarative import declarative_base

Base = declarative_base()
e = Enum('foo', 'bar', metadata=Base.metadata)

engine = create_engine('sqlite:///:memory:', echo=True)
Base.metadata.create_all(bind=engine)

Remove the explicit metadata kwarg from the Enum constructor solves the problem. I tried running the above code with echo=True, but it doesn't report anything.

Comments (5)

  1. Log in to comment