Coverage for docs_src/tutorial/code_structure/tutorial002/database.py: 100%
6 statements
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 00:02 +0000
« prev ^ index » next coverage.py v7.6.1, created at 2024-09-09 00:02 +0000
1from sqlmodel import SQLModel, create_engine 1abcdef
3sqlite_file_name = "database.db" 1abcdef
4sqlite_url = f"sqlite:///{sqlite_file_name}" 1abcdef
6engine = create_engine(sqlite_url) 1abcdef
9def create_db_and_tables(): 1abcdef
10 SQLModel.metadata.create_all(engine) 1abcdef