Last change
on this file since 1242 was
1041,
checked in by broder, 16 years ago
|
Re-establish the database connection if the server goes AWOL
|
File size:
278 bytes
|
Rev | Line | |
---|
[829] | 1 | from invirt.config import structs as config |
---|
[77] | 2 | from models import * |
---|
[946] | 3 | import sqlalchemy |
---|
[77] | 4 | |
---|
[829] | 5 | def 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.