crud for collections
This commit is contained in:
parent
bf71979982
commit
250d3f1f15
4 changed files with 195 additions and 13 deletions
|
|
@ -30,11 +30,11 @@ class Base(DeclarativeBase):
|
|||
#models te içe aktarmayı unutma
|
||||
|
||||
def init_db():
|
||||
Base.metadata.drop_all(engine) # Veritabanını her başlangıcta siler burayada dikkat !!!!!!!!
|
||||
#Base.metadata.drop_all(engine) # Veritabanını her başlangıcta siler burayada dikkat !!!!!!!!
|
||||
Base.metadata.create_all(bind=engine) # Veritabanını oluşturur
|
||||
|
||||
# Session dependency (FastAPI için)
|
||||
def get_session_db():
|
||||
def get_session_db() -> 'Generator[Session, None]':
|
||||
db = SessionLocal()
|
||||
try:
|
||||
yield db
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue