Skip to content

Commit 2d52610

Browse files
committed
logger.info23
1 parent 62add2b commit 2d52610

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

fastapi-postgres/common/config.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
load_dotenv()
77
except:
88
pass
9-
IS_LOCAL = os.getenv("USER") == os.environ.get("USER_LOCAL")
9+
IS_LOCAL = os.getenv("USER",'1') == os.environ.get("USER_LOCAL")
1010

1111

1212
DATABASE_URL_LOCAL = "postgresql+asyncpg://admin:admin@0.0.0.0:5434/postgres"
@@ -18,7 +18,7 @@
1818
# flyctl proxy 5432 -a full-stack-db
1919
if IS_LOCAL:
2020
DATABASE_URL = DATABASE_URL
21-
# DATABASE_URL = "postgresql+asyncpg://postgres:e0CEeFYUY7kERQcW@aws-0-us-east-1.pooler.supabase.com:6543/postgres"
21+
DATABASE_URL = "postgresql+asyncpg://postgres:e0CEeFYUY7kERQcW@aws-0-us-east-1.pooler.supabase.com:6543/postgres"
2222
# DATABASE_URL = DATABASE_URL_PROD
2323

2424
class Settings:

fastapi-postgres/service/create_data.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,7 @@
1212
async def create_fake_data():
1313
fake = Faker()
1414

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-
)
15+
engine = create_async_engine(conf.POSTGRES_DATABASE_URL, echo=False)
2216
DBModel.engine = engine
2317

2418
async with engine.begin() as conn:

0 commit comments

Comments
 (0)