mirror of
https://github.com/cssgunc/compass.git
synced 2025-04-10 06:10:17 -04:00
14 lines
430 B
Python
14 lines
430 B
Python
from sqlalchemy import text, create_engine
|
|
from ..database import engine, _engine_str
|
|
from ..env import getenv
|
|
|
|
engine = create_engine(_engine_str(), echo=True)
|
|
"""Application-level SQLAlchemy database engine."""
|
|
|
|
with engine.connect() as connection:
|
|
connection.execute(
|
|
text("COMMIT")
|
|
)
|
|
database = getenv("POSTGRES_DATABASE")
|
|
stmt = text(f"DROP DATABASE IF EXISTS {database}")
|
|
connection.execute(stmt) |