Open
Description
In SQLAlchemy, one can add text comments to columns and tables. This will be reflected in the SQL table in the DB.
This will support any use of txt-to-sql where the LLM will pull the SQL table model from the DB.
Adding comments, descriptions of the columns and tables will enhance the ability of the LLM to generate SQL.
For Table
, use the comment
argument (https://docs.sqlalchemy.org/en/13/core/metadata.html#sqlalchemy.schema.Table.params.comment)
For Column
use the doc
argument: https://docs.sqlalchemy.org/en/13/core/metadata.html#sqlalchemy.schema.Column.params.doc
The Column.doc can simply be added in the regular table definitions.
The Table.comment
needs to be passed into the method ScenarioDbTable.create_table_metadata
Activity