moriire commited on
Commit
22305da
1 Parent(s): 46904ba

Update database.py

Browse files
Files changed (1) hide show
  1. database.py +7 -6
database.py CHANGED
@@ -9,18 +9,19 @@ import os
9
  from sqlalchemy import URL
10
 
11
  db_url = URL.create(
12
- "mysql+pymysql",
13
- username="ibmabdulsalam",
14
- password="opengenai", # plain (unescaped) text
15
- host="ibmabdulsalam.mysql.pythonanywhere-services.com",
16
- database="default",
 
17
  )
18
  #database = databases.Database(settings.db_url)
19
  SQLALCHEMY_DATABASE_URL = db_url # "ibmabdulsalam.mysql.pythonanywhere-services.com" #"sqlite:///./sql_app.db"
20
  #SQLALCHEMY_DATABASE_URL = db_url #"postgresql://user:password@postgresserver/db"
21
 
22
  engine = create_engine(
23
- SQLALCHEMY_DATABASE_URL, echo=True
24
  )#, connect_args={"check_same_thread": False}
25
  SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
26
 
 
9
  from sqlalchemy import URL
10
 
11
  db_url = URL.create(
12
+ "postgresql",
13
+ username="avnadmin",
14
+ password="AVNS_u12fHxoNLBbzD8TGpqN", # plain (unescaped) text
15
+ host="pg-opengenai-opengenai.b.aivencloud.com",
16
+ database="defaultdb",
17
+ port=14535,
18
  )
19
  #database = databases.Database(settings.db_url)
20
  SQLALCHEMY_DATABASE_URL = db_url # "ibmabdulsalam.mysql.pythonanywhere-services.com" #"sqlite:///./sql_app.db"
21
  #SQLALCHEMY_DATABASE_URL = db_url #"postgresql://user:password@postgresserver/db"
22
 
23
  engine = create_engine(
24
+ SQLALCHEMY_DATABASE_URL, pool_size=10
25
  )#, connect_args={"check_same_thread": False}
26
  SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
27