Skip to content

Instantly share code, notes, and snippets.

@codemation
Created November 15, 2021 09:08
Show Gist options
  • Save codemation/e47bdabc3b872ab3051ae0e8dbcc9ceb to your computer and use it in GitHub Desktop.
Save codemation/e47bdabc3b872ab3051ae0e8dbcc9ceb to your computer and use it in GitHub Desktop.
pydbantic_app_4.py
# app.py
import asyncio
from db import setup_database
from models import Employee
async def main():
# setup db
await setup_database()
all_employees = await Employee.all()
for employee in all_employees:
await employee.delete()
employees = await Employee.all()
print(employees)
asyncio.run(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment