source: trunk/packages/invirt-database/python/database/__init__.py @ 1808

Last change on this file since 1808 was 1288, checked in by broder, 16 years ago

sipb-xen-database-common -> invirt-database
sipb-xen-database-server -> invirt-database-server

File size: 278 bytes
RevLine 
[829]1from invirt.config import structs as config
[77]2from models import *
[946]3import sqlalchemy
[77]4
[829]5def connect(uri = config.db.uri):
[77]6    """ Connect to a given database URI"""
[1041]7    engine = sqlalchemy.create_engine(uri, pool_timeout=5)
[991]8    meta.bind = engine
9    session.configure(bind=engine)
Note: See TracBrowser for help on using the repository browser.