Skip to content

Fix filters for case-sensitive column names on PostgreSQL#232

Merged
debba merged 7 commits into
TabularisDB:mainfrom
m-tonon:fix/postgres-filter-column-quotes
May 21, 2026
Merged

Fix filters for case-sensitive column names on PostgreSQL#232
debba merged 7 commits into
TabularisDB:mainfrom
m-tonon:fix/postgres-filter-column-quotes

Conversation

@m-tonon
Copy link
Copy Markdown
Contributor

@m-tonon m-tonon commented May 20, 2026

Fix: quote Postgres column names in structured filters

Postgres is case-sensitive: userId was becoming userid and filters failed.
Now when driver = postgres, columns get double quotes via quoteIdentifier (MySQL/SQLite unchanged).

Closes #231

@kilo-code-bot
Copy link
Copy Markdown

kilo-code-bot Bot commented May 20, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 0
Resolved Issues
File Line Issue Status
src/components/ui/TableToolbar.tsx 109 Sort change detection now compares raw sort against unformatted initialSort before calling onUpdate with formatted output ✅ Fixed
Other Observations (not in diff)
File Line Issue
src/utils/identifiers.ts 32 JSDoc for quoteIdentifier is still attached to shouldQuoteIdentifiers due to inserted functions; consider moving the JSDoc comment down to the actual quoteIdentifier export
Files Reviewed (2 files in this incremental review)
  • src/components/ui/TableToolbar.tsx - Previous sort change-detection bug is fixed; logic now correctly compares raw sort values before formatting for onUpdate
  • tests/components/ui/TableToolbar.test.tsx - New regression test added: verifies no false-positive onUpdate when PostgreSQL quoting is the only difference

Reviewed by kimi-k2.6 · incremental review


Reviewed by kimi-k2.6-20260420 · 113,143 tokens

After 6a4a330 made TableToolbar consume useDatabase directly, the test
suite rendered the component without a DatabaseProvider, causing all 18
tests to fail. Mock the hook to return a stub with activeDriver: null
so the component renders in isolation.
@debba
Copy link
Copy Markdown
Collaborator

debba commented May 21, 2026

Hi! I fixed the failing tests in this PR. Could you please check that everything looks good before merging?

The changes only touch tests, so the implementation behavior should be unchanged.

@m-tonon
Copy link
Copy Markdown
Contributor Author

m-tonon commented May 21, 2026

I noticed the ORDER BY had the same issue as well, so I created a helper to handle the column identifiers in a cleaner way and reused it wherever needed.

Comment thread src/components/ui/TableToolbar.tsx Outdated
@debba
Copy link
Copy Markdown
Collaborator

debba commented May 21, 2026

@m-tonon That’s great.
I can merge it if you agree

@m-tonon
Copy link
Copy Markdown
Contributor Author

m-tonon commented May 21, 2026

Now it's good to go 👍

@debba debba merged commit 8b309ab into TabularisDB:main May 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: PostgreSQL filters fail with case-sensitive column names

2 participants