Update database.py
Browse files- 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 |
-
"
|
13 |
-
username="
|
14 |
-
password="
|
15 |
-
host="
|
16 |
-
database="
|
|
|
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,
|
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 |
|