Skip to content

UI for advanced search with multiple columns and with additional conditional operators#842

Closed
sbamin wants to merge 7 commits into
sosedoff:mainfrom
sbamin:local
Closed

UI for advanced search with multiple columns and with additional conditional operators#842
sbamin wants to merge 7 commits into
sosedoff:mainfrom
sbamin:local

Conversation

@sbamin
Copy link
Copy Markdown

@sbamin sbamin commented Mar 2, 2026

No description provided.

sbamin added 2 commits March 2, 2026 16:16
Advanced Search panel** (`Advanced` toggle button next to the existing filter bar):

- **Multiple conditions** — add unlimited filter rows with `+ Add Condition`
- **Per-row AND/OR connectors** — each row after the first has AND/OR toggle pills, enabling mixed logic like `(A AND B) OR (C AND D)`
- **18 filter operators** grouped by category:
  - Comparison: `=`, `<>`, `<`, `>`, `<=`, `>=`
  - List: `IN`, `NOT IN` (comma-separated values)
  - Null: `IS NULL`, `IS NOT NULL`
  - Range: `BETWEEN`, `NOT BETWEEN` (From / To inputs)
  - Pattern: Contains, Not contains, Has prefix, Has suffix — plus case-insensitive (ILIKE) variants for all four
- **Show Query** — previews the full `SELECT * FROM ... WHERE ...;` SQL inline, with a Copy button
- **"Advanced Filter Active"** badge in the pagination row when a multi-condition filter is applied
- **Right-click → Filter Rows By Value** adds a pre-filled condition row when the panel is open
- Filter state resets automatically on table switch or clicking the basic `×` reset button
- No backend changes — uses the existing `where` parameter on `GET /api/tables/:table/rows`

**Files changed:** `static/index.html`, `static/js/app.js`, `static/css/app.css
@sbamin
Copy link
Copy Markdown
Author

sbamin commented Mar 2, 2026

Adding this pull request though I have not reviewed claude 🤖 code in detail and so merge only if you deem it ok.

Features implemented: c5c56cd

We needed a few advanced search features in UI and so I used claude code with following prompts:

  1. pgweb UI currently does not allow conditional search and rather only allows search based on a single column. Plan out advanced search features that includes multiple columns, let user choose AND OR and other conditional operators across >1 columns.

  2. DO I need to build pgweb binary for linux amd64

  3. build please

  4. This works! Write a memory and save under tmp/pgweb/.claude/memory/advanced_search.md

  5. plan a few more tweaks:

    1. besides ALL (AND) and Any (OR), also implement AND OR flags for each of condition added. e.g., (first condition AND second condition) OR (third condition AND fourth condition)
    2. Provide a button which when clicked show and let user copy raw postgresql query
    3. Add additional conditional operators as in screenshot
  6. build it now

  7. nice and good! Memories and update memory

  8. show me a summary of features implemented for me to write in git commit


Screenshot 2026-03-02 at 4 51 44 PM Screenshot 2026-03-02 at 4 52 03 PM

What's new

Advanced Search panel (Advanced toggle button next to the existing filter bar):

  • Multiple conditions — add unlimited filter rows with + Add Condition
  • Per-row AND/OR connectors — each row after the first has AND/OR toggle pills, enabling mixed logic like (A AND B) OR (C AND D)
  • 18 filter operators grouped by category:
    • Comparison: =, <>, <, >, <=, >=
    • List: IN, NOT IN (comma-separated values)
    • Null: IS NULL, IS NOT NULL
    • Range: BETWEEN, NOT BETWEEN (From / To inputs)
    • Pattern: Contains, Not contains, Has prefix, Has suffix — plus case-insensitive (ILIKE) variants for all four
  • Show Query — previews the full SELECT * FROM ... WHERE ...; SQL inline, with a Copy button
  • "Advanced Filter Active" badge in the pagination row when a multi-condition filter is applied
  • Right-click → Filter Rows By Value adds a pre-filled condition row when the panel is open
  • Filter state resets automatically on table switch or clicking the basic × reset button
  • No backend changes — uses the existing where parameter on GET /api/tables/:table/rows

Files changed: static/index.html, static/js/app.js, `static/css/app.css

@sbamin sbamin changed the title Local UI for advanced search with multiple columns and with additional conditional operators Mar 2, 2026
@sbamin
Copy link
Copy Markdown
Author

sbamin commented Mar 3, 2026

supercede by #843

@sbamin sbamin closed this Mar 3, 2026
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.

1 participant