2024-01-08 00:38:17 +00:00
|
|
|
import aiosqlite
|
|
|
|
|
|
2024-04-25 04:57:39 +00:00
|
|
|
async def connect(path = './data/your_database.db') -> aiosqlite.Connection:
|
|
|
|
|
return await aiosqlite.connect(path)
|
2024-01-08 00:38:17 +00:00
|
|
|
|
2024-04-25 04:57:39 +00:00
|
|
|
async def create(conn: aiosqlite.Connection):
|
2024-01-13 07:44:48 +00:00
|
|
|
import products.db as product_db
|
2024-01-13 01:54:04 +00:00
|
|
|
await product_db.create(conn)
|
2024-01-13 03:21:38 +00:00
|
|
|
|
2024-01-17 07:21:16 +00:00
|
|
|
import ingredients.db as ingredient_db
|
|
|
|
|
await ingredient_db.create(conn)
|
|
|
|
|
|
2024-01-13 07:44:48 +00:00
|
|
|
import recipes.db as recipe_db
|
2024-01-13 03:21:38 +00:00
|
|
|
await recipe_db.create(conn)
|
|
|
|
|
|
2024-01-13 07:44:48 +00:00
|
|
|
import persons.db as person_db
|
2024-01-13 07:18:25 +00:00
|
|
|
await person_db.create(conn)
|
|
|
|
|
|
|
|
|
|
import meals.db as meals_db
|
|
|
|
|
await meals_db.create(conn)
|
|
|
|
|
|
2024-01-08 00:38:17 +00:00
|
|
|
if __name__ == '__main__':
|
|
|
|
|
import asyncio
|
2024-04-25 04:57:39 +00:00
|
|
|
async def initdb():
|
|
|
|
|
conn = await connect()
|
|
|
|
|
await create(conn)
|
|
|
|
|
|
|
|
|
|
asyncio.run(initdb)
|