Coverage for docs_src/tutorial/code_structure/tutorial002_py39/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 1abcd

2 

3sqlite_file_name = "database.db" 1abcd

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

5 

6engine = create_engine(sqlite_url) 1abcd

7 

8 

9def create_db_and_tables(): 1abcd

10 SQLModel.metadata.create_all(engine) 1abcd