Initial commit of akmon project

This commit is contained in:
2026-01-20 08:04:15 +08:00
commit 77a2bab985
1309 changed files with 343305 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import os
import sys
try:
import psycopg
except ImportError:
sys.stderr.write("Missing dependency: install with `python -m pip install psycopg[binary]`\n")
sys.exit(1)
DSN = os.environ.get("SUPABASE_DB_URL")
if not DSN:
sys.stderr.write("SUPABASE_DB_URL environment variable is not set.\n")
sys.exit(1)
try:
with psycopg.connect(DSN, autocommit=True) as conn:
with conn.cursor() as cur:
cur.execute("select 1;")
row = cur.fetchone()
print("Query result:", row[0] if row else None)
except Exception as exc:
sys.stderr.write(f"Connection failed: {exc}\n")
sys.exit(1)