Skip to content

Add DB table comment and column doc support to ScenarioDbTable to support txt-to-sql #64

Open
@victorterpstra

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

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions