Repository navigation
feat(BAR-56): Filters the schemas the tree lists with include and exclude regexes - #63
Merged
Merged
Conversation
…exes Filter schemas… in the schema tree's options menu opens a dialog with an on/off switch, an include regex and an exclude regex. Patterns ignore case and match anywhere in the name unless anchored, | means or, an empty include keeps every schema and exclude wins. A pattern that doesn't compile shows its error and can't be saved. The filter is saved on the connection (schemaFilter in connections.json), for all its databases, and saving it refreshes the tree. Switching it off keeps the patterns. When it hides every schema, the tree says so.
VM-dash
marked this pull request as ready for review
November 30, 2026 13:19
Bare7a
approved these changes
Dec 1, 2026
Bare7a
added a commit
that referenced
this pull request
Dec 1, 2026
…lude regexes (#63) Filter schemas… in the schema tree's options menu hides schemas by name with an include and an exclude regex, saved on the connection for all its databases. Closes #66. - Dialog: an on/off switch and Include / Exclude fields; patterns ignore case and match anywhere unless anchored, an empty include keeps everything, exclude wins, and spaces count, with a hint when a pattern starts or ends with one; a broken pattern blocks Save only while the filter is on, and switching it off keeps the patterns - Saving: schemaFilter in connections.json with blank patterns cleared; no reconnect and no schema reload; the dialog can't close mid-save and shows a failed save inline - Tree: the menu item is checked while the filter is on; the tree says when the filter hides every schema, even during a search; Import data goes to the first listed schema and turns off when every schema is hidden; load errors from hidden schemas don't show; Collapse all ignores hidden schemas - MySQL / MariaDB and ClickHouse: with Show all databases, the filter hides databases in the Databases list and the query tab's database menu; the picked database and the connection's own always show - Code: SchemaFilter, SchemaMatcher and database_filter in barsql-core, which now uses regex (already in the exe); the sidebar opens the dialog on the saved connection - No new crates - Docs: the schema guide - Tests: matching, error messages, spaces, blank patterns and the saved JSON; the empty-state message, a picked database, a hidden schema's error and import target; the Databases list; saving without a schema reload; a broken pattern saving only switched off; the import scenarios pick from the bottom of the menu. --------- Co-authored-by: victormasson <victor.massonv@gmail.com> Co-authored-by: Bare7a <bare7a@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 What changed?
Filter schemas… in the schema tree's options menu opens a dialog to hide schemas by name:
|means "or" (the placeholder shows^test.*|-\d$)The filter is saved on the connection (
schemaFilterinconnections.json) and applies to all its databases. Saving updates the tree from what it already loaded, without reloading the schema. The menu item is checked while the filter is on, and the tree says so when the filter hides every schema, even with a search typed. Import data goes into the first schema the tree lists, and turns off when every schema is hidden.On MySQL / MariaDB and ClickHouse with Show all databases, where databases are schemas, the filter hides databases in the Databases list and the query tab's database menu. The database you pick, and the connection's own, always show.
Closes #66
🧩 Type of change
🧪 Tested
📖 Docs
📌 Notes
SchemaFilterand its matcher live inbarsql-core's config, soregexmoves there; it was already in the app through other crates. The dialog isschema_filter_dialog.rs, which the sidebar opens on the saved connection.regexcrate, which runs in linear time, and a filter compiles once when it changes, not on every redraw.