Coverage for docs_src/tutorial/code_structure/tutorial002_py310/database.py: 100%

6 statements  

« prev     ^ index     » next       coverage.py v7.6.1, created at 2024-09-09 00:02 +0000

1from sqlmodel import SQLModel, create_engine 1abc

2 

3sqlite_file_name = "database.db" 1abc

4sqlite_url = f"sqlite:///{sqlite_file_name}" 1abc

5 

6engine = create_engine(sqlite_url) 1abc

7 

8 

9def create_db_and_tables(): 1abc

10 SQLModel.metadata.create_all(engine) 1abc