X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-database.git/blobdiff_plain/f397db06b0260d780be34a33d1a158bf894e2a8f..669460d12b74b5af73b82b40b6c413b8298b6fcb:/python/database/__init__.py?ds=inline diff --git a/python/database/__init__.py b/python/database/__init__.py index c247bdf..b3dd61c 100644 --- a/python/database/__init__.py +++ b/python/database/__init__.py @@ -1,5 +1,9 @@ +from invirt.config import structs as config from models import * +import sqlalchemy -def connect(uri): +def connect(uri = config.db.uri): """ Connect to a given database URI""" - meta.connect(uri) + engine = sqlalchemy.create_engine(uri, pool_timeout=5) + meta.bind = engine + session.configure(bind=engine)