Seth0330 commited on
Commit
28f279d
·
verified ·
1 Parent(s): 82fd2c7

Create app/core/database.py

Browse files
Files changed (1) hide show
  1. app/core/database.py +11 -0
app/core/database.py ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from sqlalchemy import create_engine
2
+ from sqlalchemy.orm import sessionmaker, declarative_base
3
+ from .config import settings
4
+
5
+ engine = create_engine(
6
+ settings.DATABASE_URL,
7
+ pool_pre_ping=True,
8
+ )
9
+
10
+ SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
11
+ Base = declarative_base()