fix: SQLite connect button and sidebar table listing#39
Merged
Conversation
- Fix port validation min(1) -> min(0) so SQLite/DuckDB port 0 passes zod schema - Fix resolveExpandedDatabaseName to fallback to first DB for SQLite/DuckDB - Fix get_tables to skip unsafe identifiers instead of failing entire listing
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.
Summary
Fixes three issues that prevented SQLite connections from working properly:
Connect button unresponsive — The zod form schema required
port >= 1but SQLite/DuckDB setportto0. Validation failed silently because the port field is hidden for file-based engines. Fixed by allowingport >= 0in the base schema.Tables not showing in sidebar —
resolveExpandedDatabaseNamereturned the connection's file path (e.g./path/to/db.sqlite) instead of the actual database name (main). SinceisDatabaseActive(main)was alwaysfalse, the tables panel never rendered. Added SQLite/DuckDB fallback to return the first database when no exact match exists (same pattern MySQL already uses).Entire table listing fails on a single non-standard table name —
require_safe_identifierused?in theget_tablesloop, so any table with a hyphen, dot, or other non-ASCII-alphanumeric character caused the entire listing to fail. Changed tois_safe_identifier+continueto skip only the problematic table (matches DuckDB engine behavior).