summaryrefslogtreecommitdiff
path: root/sphinx/websupport/storage/sqlalchemystorage.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/websupport/storage/sqlalchemystorage.py')
-rw-r--r--sphinx/websupport/storage/sqlalchemystorage.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/sphinx/websupport/storage/sqlalchemystorage.py b/sphinx/websupport/storage/sqlalchemystorage.py
index baef24816..dea2eea02 100644
--- a/sphinx/websupport/storage/sqlalchemystorage.py
+++ b/sphinx/websupport/storage/sqlalchemystorage.py
@@ -32,11 +32,11 @@ class SQLAlchemyStorage(StorageBackend):
A :class:`.StorageBackend` using SQLAlchemy.
"""
- def __init__(self, engine):
- self.engine = engine
- Base.metadata.bind = engine
+ def __init__(self, uri):
+ self.engine = sqlalchemy.create_engine(uri)
+ Base.metadata.bind = self.engine
Base.metadata.create_all()
- Session.configure(bind=engine)
+ Session.configure(bind=self.engine)
def pre_build(self):
self.build_session = Session()