Skip to content

Commit

Permalink
update from planetscale(mysql) to postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
david-dong828 committed Apr 2, 2024
1 parent 8ce90a0 commit e39fddc
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions api/database_handle.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
import psycopg2

def get_planetscale_params(file ='vercel_postgres.json'):
# To check if in CI env
if os.getenv("POSTGRES_HOST") and os.getenv("POSTGRES_USER") and os.getenv("POSTGRES_PASSWORD"):
# To check if in CI env (GITHUB Workflow file)
if os.getenv("DB_HOST") and os.getenv("DB_USER") and os.getenv("DB_PASSWORD"):
return {
"host": os.getenv("POSTGRES_HOST"),
"user": os.getenv("POSTGRES_USER"),
"passwd": os.getenv("POSTGRES_PASSWORD"),
"database": os.getenv("POSTGRES_DATABASE")
"host": os.getenv("DB_HOST"),
"user": os.getenv("DB_USER"),
"passwd": os.getenv("DB_PASSWD"),
"database": os.getenv("DB_DATABASE")
}
else:
params = {}
Expand Down

0 comments on commit e39fddc

Please sign in to comment.