Skip to content

Expose table and column comments in metadata responses #23

Description

@debba

Context

Core support is being added in TabularisDB/tabularis#764 for TabularisDB/tabularis#722. The runtime now accepts an optional comment: string | null in get_tables and get_columns results.

SQL Server commonly stores object descriptions in the MS_Description extended property, exposed through sys.extended_properties.

Requested changes

  • Add optional comment fields to the plugin's TableInfo and TableColumn response models.
  • In get_tables, left join the MS_Description property with class = 1 and minor_id = 0 and map its value to TableInfo.comment.
  • In get_columns, join the corresponding property using the table object_id and column column_id, mapping it to TableColumn.comment.
  • Keep bulk metadata paths consistent, where implemented.
  • Cast sql_variant values safely to text; return None / omit the property when absent.
  • Add tests for descriptions containing apostrophes, Unicode, and newlines, plus objects without descriptions.

Only the conventional MS_Description property should be interpreted as the description; unrelated extended properties must be ignored.

Compatibility

This is additive: no manifest/capability change or minimum runtime bump is required. Older Tabularis runtimes ignore unknown JSON fields, while newer runtimes continue to accept payloads without comment.

References

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions