summaryrefslogtreecommitdiff
path: root/sphinx/websupport/storage/sqlalchemystorage.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-08-21 22:33:09 +0200
committerGeorg Brandl <georg@python.org>2010-08-21 22:33:09 +0200
commit092ebec8a7eb938a2c720d57b258bd6e106bff9e (patch)
treeee6812efd7de0d796cb0fcf37cceb5aeab72b611 /sphinx/websupport/storage/sqlalchemystorage.py
parent7dd3f40461b87e599d5fdc19fe7153edb428cc3e (diff)
downloadsphinx-git-092ebec8a7eb938a2c720d57b258bd6e106bff9e.tar.gz
Move default sqlalchemy engine creation to storage backend.
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()