Skip to content

feat: support column comments through driver capabilities - #187

Merged
aesslinger merged 1 commit into
TabularisDB:mainfrom
lejyfps:feat/column-comments
Nov 10, 2026
Merged

aesslinger merged 1 commit into
TabularisDB:mainfrom
lejyfps:feat/column-comments

Conversation

@lejyfps

@lejyfps lejyfps commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Enables the shared column_comments capability for the external PostgreSQL driver, matching the built-in implementation in TabularisDB/tabularis#1453.

Add Column appends COMMENT ON COLUMN; Modify Column adds, replaces or clears a comment without restating unchanged attributes. Rename plus comment targets the new name. Escape strings preserve apostrophes, backslashes, Unicode and line breaks, with byte-identical output to the built-in driver. The optional field preserves older host payloads.

Validation:

  • 449 library and 5 binary tests passed; 20 existing live tests remain ignored.
  • Added RPC, manifest, SQL-generation and quoting tests.
  • Added a real-PostgreSQL stdio test to the existing live_db suite for add/update/remove and metadata preservation. It compiles locally; execution awaits CI's PostgreSQL service.
  • cargo fmt --all -- --check passed.
  • Clippy passes with the pre-existing Windows-only bind_instead_of_map warning in models.rs:663 allowed at the command line. The strict command hits that warning; no source suppression was added.
  • GitNexus upstream impact and pre-commit change detection completed.

Companion to host issue TabularisDB/tabularis#1448. No new RPC/capability name or version bump.

@kilo-code-bot

kilo-code-bot Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (8 files)
  • .tabularium
  • README.md
  • src/handlers/column_comments.rs
  • src/handlers/column_comments_tests.rs
  • src/handlers/ddl.rs
  • src/handlers/ddl_tests.rs
  • src/models.rs
  • tests/live_db.rs

Reviewed by claude-sonnet-5.5 · Input: 244 · Output: 1.5K · Cached: 156.5K

@aesslinger aesslinger self-assigned this Nov 10, 2026
@aesslinger aesslinger added enhancement New feature or request prerelease:rc Version suggestion targets a release candidate labels Nov 10, 2026
@github-actions

Copy link
Copy Markdown

Version suggestion

Based on this PR's title (feat) and the prerelease:rc label:

Current 1.0.0-rc.13
Suggested next tag v1.0.0-rc.14

This is informational only — no tag or release is created automatically yet.

@aesslinger aesslinger left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving — this is a clean, faithful parity port of the built-in driver's column_comments capability. I diffed comment_sql, the add-column filter, and the alter-column comparison/ordering against the built-in implementation in the companion host PR (tabularis#1453), and they match byte-for-byte. E-string escaping, identifier quoting, the #[path] module layout, the #[serde(default)] comment field, and the filter(!is_empty()) guard are all consistent with the parity target. Test coverage is solid: quoting/SQL-builder unit tests plus a real-PostgreSQL stdio round-trip for add/update/remove with metadata preservation.

Potential follow-up (non-blocking, out of scope for this PR): the old_column.comment.as_deref().unwrap_or("") != new_column.comment.as_deref().unwrap_or("") comparison treats Some("") and None as identical, so a column with a stored empty-string comment (COMMENT ON COLUMN t.c IS '', set by another tool or hand SQL) cannot be cleared through the alter dialog — Some("").unwrap_or("") == None.unwrap_or("") produces no COMMENT IS NULL, and the empty-string comment persists.

This is a shared limitation, not a regression this PR introduces: the built-in driver uses the exact same unwrap_or("") comparison and filter(!is_empty()) guard, so fixing it here alone would create the parity drift the repo rules exist to prevent. If we want to clear empty-string comments, the fix should ship in both repos simultaneously and likely treats Some("") as "clear" (emit IS NULL) distinct from None (no comment). Worth tracking as a known parity gap for a future ticket.

@aesslinger
aesslinger merged commit 9554b6b into TabularisDB:main Nov 10, 2026
8 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request prerelease:rc Version suggestion targets a release candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants