fastapi/sqlmodel — reverse-engineered prompt

Reverse engineered prompt

GitHub

Build me a simple Python library for working with SQL databases using normal Python classes and type hints. I want to define one model once, like a Hero with id, name, secret name, and age, and have that same model work for database tables, data validation, and FastAPI responses without repeating myself.

It should feel beginner friendly, with sensible defaults, good editor autocomplete, and clear errors when I use the wrong types. I want to be able to create tables, add rows, commit them, and query them back with clean Python code. Start with SQLite for examples, but design it so it can sit on top of SQLAlchemy and work nicely with Pydantic and FastAPI.

Please include a small working demo, tests, and basic documentation showing how to install it, create a model, save data, and select data. Look up current docs online if you need to.

Want more depth? Deep Reverse