chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

[WIP] - SQL Model Data Layer

Open hayescode opened this issue 2 months ago • 5 comments
trafficstars

[!CAUTION] This is currently a mockup and incomplete. This has not been tested and will not run.

This is an initial draft for consolidating all SQL data layers using FastAPI's sqlmodel (Pydantic + SQL Alchemy).

For now I have created the new models in a new models/ directory and are duplicated from step.py, element.py, etc. The idea would be to delete those once this is ready.

The main reasons for this change are:

  1. Enable everyone who wants to use SQL data persistence to use a single implementation.
  2. Reduce technical debt and bugs, and speed up future development.

replaces #1365

Notes:

  • sqlmodel reserves the 'metadata' field for internal purposes and cannot be changed, so in Threads/Steps/User we have to rename this to something else so for now it's metadata_ instead, then aliased for proper database and API usage.

hayescode avatar Aug 29 '25 19:08 hayescode