25 lines
No EOL
567 B
Python
25 lines
No EOL
567 B
Python
import aiosqlite
|
|
|
|
async def connect() -> aiosqlite.Connection:
|
|
return await aiosqlite.connect('./data/your_database.db')
|
|
|
|
async def create():
|
|
import products.db as product_db
|
|
conn = await connect()
|
|
await product_db.create(conn)
|
|
|
|
import recipes.db as recipe_db
|
|
await recipe_db.create(conn)
|
|
|
|
import persons.db as person_db
|
|
await person_db.create(conn)
|
|
|
|
import meals.db as meals_db
|
|
await meals_db.create(conn)
|
|
|
|
await conn.commit()
|
|
await conn.close()
|
|
|
|
if __name__ == '__main__':
|
|
import asyncio
|
|
asyncio.run(create()) |