File tree Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Expand file tree Collapse file tree 3 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 18
18
# flyctl proxy 5432 -a full-stack-db
19
19
if IS_LOCAL :
20
20
DATABASE_URL = DATABASE_URL
21
+ # DATABASE_URL = "postgresql+asyncpg://postgres:e0CEeFYUY7kERQcW@aws-0-us-east-1.pooler.supabase.com:6543/postgres"
21
22
# DATABASE_URL = DATABASE_URL_PROD
22
23
23
24
class Settings :
Original file line number Diff line number Diff line change 1
- from app import create_app
1
+ import os
2
+
3
+
4
+
5
+
6
+ DATABASE_URL_PROD = os .environ .get ("DATABASE_URL" )
2
7
from common .config import conf
3
8
from common .utils .log import logger
4
9
5
10
logger .info (conf .POSTGRES_DATABASE_URL )
6
-
11
+ logger .info (os .environ .get ("DATABASE_URL" ))
12
+ logger .info (f'{ os .getenv ("USER" ) } ,{ os .environ .get ("USER_LOCAL" )} ' )
13
+ from app import create_app
7
14
app = create_app (docs = True )
Original file line number Diff line number Diff line change 12
12
async def create_fake_data ():
13
13
fake = Faker ()
14
14
15
- engine = create_async_engine (conf .POSTGRES_DATABASE_URL , echo = False )
15
+ engine = create_async_engine (conf .POSTGRES_DATABASE_URL , connect_args = {
16
+ "ssl" : "require" ,
17
+ # optional: if still using pooler
18
+ "statement_cache_size" : 0
19
+ },
20
+ echo = True
21
+ )
16
22
DBModel .engine = engine
17
23
18
24
async with engine .begin () as conn :
You can’t perform that action at this time.
0 commit comments