Question about best practices for Piccolo tables to API schemas #320
-
|
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.
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. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
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. |
Beta Was this translation helpful? Give feedback.
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.