Results of 1 - 1 of about 1 for tables (0.006 sec.)
- SQL (Relational) Databases 9414
- SQL (Relational) Databases Warning The current page still doesn't have a translation for this language. But you can help translating it: Contributing . FastAPI doesn't require you to use a SQL (relational) database. But you can use any data
...gs = { "check_same_thread" : False } engine = create_engine ( sqlite_url , connect_args = connect_args ) def create_db_and_tables (): SQLModel . metadata . create_all ( engine ) def get_session (): with Session ( engine ) as session : yield session Ses...tated [ Session , Depends ( get_session )] app = FastAPI () @app . on_event ( "startup" ) def on_startup (): create_db_and_tables () @app . post ( "/heroes/" ) def create_hero ( hero : Hero , session : SessionDep ) -> Hero : session . add ( hero ) sess...gs = { "check_same_thread" : False } engine = create_engine ( sqlite_url , connect_args = connect_args ) def create_db_and_tables (): SQLModel . metadata . create_all ( engine ) def get_session (): with Session ( engine ) as session : yield session Ses... - https://man.mtool.work/fastapi/0.115/tutorial/sql-databases/
PREV
1
NEXT