You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
429 B
17 lines
429 B
from sqlalchemy import create_engine, text
|
|
import os
|
|
try:
|
|
from app.db_schema import ensure_schema
|
|
except ModuleNotFoundError:
|
|
from db_schema import ensure_schema
|
|
|
|
DATABASE_URL = os.getenv("DATABASE_URL")
|
|
engine = create_engine(DATABASE_URL)
|
|
|
|
with engine.connect() as conn:
|
|
ensure_schema(conn)
|
|
rows = conn.execute(text("SELECT name FROM domains"))
|
|
print("Domains:")
|
|
for r in rows:
|
|
print("-", r[0])
|