Skip to content

Instantly share code, notes, and snippets.

@codemation
Last active November 15, 2021 11:47
Show Gist options
  • Save codemation/dadd072bc9585ca4e83068599ecbdd0e to your computer and use it in GitHub Desktop.
Save codemation/dadd072bc9585ca4e83068599ecbdd0e to your computer and use it in GitHub Desktop.
pydbantic_app_7.py
# app.py
import asyncio
from db import setup_database
from models import Employee, Positions, Department
async def main():
# setup db
await setup_database()
all_employees = await Employee.all()
print(all_employees)
all_positions = await Positions.all()
print(all_positions)
all_departments = await Department.all()
print(all_departments)
asyncio.run(main())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment