mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-05 05:42:39 +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
19
surfsense_backend/test_db_sync.py
Normal file
19
surfsense_backend/test_db_sync.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import psycopg
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
def main():
|
||||
load_dotenv()
|
||||
db_url = os.getenv("DATABASE_URL")
|
||||
db_url = db_url.replace("postgresql+asyncpg://", "postgresql://")
|
||||
db_url = db_url.replace("ssl=require", "sslmode=require")
|
||||
|
||||
print(f"Connecting to {db_url} using PSYCOPG")
|
||||
try:
|
||||
with psycopg.connect(db_url) as conn:
|
||||
print("SUCCESS: Connected to Neon DB via Psycopg!")
|
||||
except Exception as e:
|
||||
print(f"ERROR: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue