mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-10 00:02:40 +02:00
chore: prepare cloud merge point with docker and firebase configs in movexe fork Boris account? No, current user.
This commit is contained in:
parent
b38a297349
commit
4a6b335ce3
14 changed files with 263 additions and 2 deletions
21
surfsense_backend/test_db.py
Normal file
21
surfsense_backend/test_db.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import asyncio
|
||||
import asyncpg
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
async def main():
|
||||
load_dotenv()
|
||||
db_url = os.getenv("DATABASE_URL")
|
||||
if db_url.startswith("postgresql+asyncpg"):
|
||||
db_url = db_url.replace("postgresql+asyncpg", "postgresql")
|
||||
|
||||
print(f"Connecting to {db_url}")
|
||||
try:
|
||||
conn = await asyncpg.connect(db_url)
|
||||
print("SUCCESS: Connected to Neon DB!")
|
||||
await conn.close()
|
||||
except Exception as e:
|
||||
print(f"ERROR: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Loading…
Add table
Add a link
Reference in a new issue