Skip to content

Question about best practices for Piccolo tables to API schemas #319

Closed

Description

@KuchikiRenji

I am exploring Piccolo and Piccolo API for building an async ASGI service.

I am curious about the recommended approach for connecting Piccolo tables to API schemas.
Specifically, I am interested in:

  • deriving request and response schemas from Piccolo tables
  • handling partial updates safely without duplicating field definitions
  • keeping ORM models and API schemas aligned as models evolve

I haven’t implemented this yet, so I am looking for guidance on the recommended patterns or examples.

If maintainers think this is useful, I would be interested in contributing documentation, examples, or a focused PR once I’ve tried it in practice.

Thanks.

Activity

  1. dantownsend commented on Jan 15, 2026

    @dantownsend
    Member

    Assuming you're using Pydantic for serialisation, there's this for auto creating models:

    https://piccolo-orm.readthedocs.io/en/latest/piccolo/serialization/index.html#create-pydantic-model

    You can also easily create endpoints based on tables using this:

    https://piccolo-api.readthedocs.io/en/latest/crud/index.html

    They're good for getting you started. But after a while you'll probably have to write custom endpoints and models as your app grows in complexity.

  2. converted this issue into a discussion #320 on Jan 19, 2026
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions