init
This commit is contained in:
14
backend/core/db_cache.py
Normal file
14
backend/core/db_cache.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""
|
||||
compat layer - exposes getconn used by older code
|
||||
"""
|
||||
from contextlib import contextmanager
|
||||
from backend.core.db import engine
|
||||
|
||||
@contextmanager
|
||||
def getconn():
|
||||
conn = engine.raw_connection()
|
||||
try:
|
||||
yield conn
|
||||
finally:
|
||||
conn.commit()
|
||||
conn.close()
|
||||
Reference in New Issue
Block a user