Implement method to close database connections, fixes #246.
This commit is contained in:
parent
00d2279abf
commit
d0c4e9fcc7
@ -136,6 +136,12 @@ class Database(object):
|
||||
else:
|
||||
self.rollback()
|
||||
|
||||
def close(self):
|
||||
"""Close database connections. Makes this object unusable."""
|
||||
self.engine.dispose()
|
||||
self._tables = {}
|
||||
self.engine = None
|
||||
|
||||
@property
|
||||
def tables(self):
|
||||
"""Get a listing of all tables that exist in the database."""
|
||||
|
||||
Loading…
Reference in New Issue
Block a user