Skip to content

Add database engine, session, and ORM models #2

Description

@ddvlamin

Description

Create the async SQLAlchemy setup and ORM models for shopping lists and items.

Files

  • Create: app/__init__.py
  • Create: app/database.py — async engine + session factory + get_db dependency
  • Create: app/models.py — ShoppingList and ShoppingListItem ORM models

Details

  • Use async SQLAlchemy with aiosqlite
  • ShoppingList: id, name, created_at, updated_at
  • ShoppingListItem: id, shopping_list_id (FK), name, quantity, unit, is_checked, created_at
  • Relationship with cascade delete on items

Acceptance Criteria

  • Models import without errors
  • Tables can be created from Base.metadata

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions