15 lines
296 B
Python
15 lines
296 B
Python
"""
|
|
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()
|