mirror of
https://github.com/kennethreitz/records.git
synced 2026-06-05 06:46:17 +00:00
+7
-1
@@ -259,7 +259,13 @@ class Database(object):
|
||||
# Create an engine.
|
||||
self._engine = create_engine(self.db_url, **kwargs)
|
||||
self.open = True
|
||||
|
||||
|
||||
def get_engine(self):
|
||||
# Return the engine if open
|
||||
if not self.open:
|
||||
raise exc.ResourceClosedError('Database closed.')
|
||||
return self._engine
|
||||
|
||||
def close(self):
|
||||
"""Closes the Database."""
|
||||
self._engine.dispose()
|
||||
|
||||
Reference in New Issue
Block a user