Support project-level .lazysql.toml files that merge with the global
configuration. The local config is discovered by walking up from CWD
to the git repository root.
Merge behavior:
- [application]: deep merge, local values override global
- [[database]]: local connections replace global ones entirely
- [keymap.*]: deep merge, local keybindings override global
Two issues fixed:
1. DSN construction: empty password= corrupted dbname parameter, causing
all cross-database connections to silently connect to the default
database instead of the target. Only include password when present.
2. Race condition: InitializeNodes spawns goroutines per database, each
calling GetTables → SwitchDatabase which mutated the shared
db.Connection. Replace with connectionFor() that returns independent
temporary connections for non-current databases, leaving db.Connection
untouched. SwitchDatabase remains for explicit user-initiated switches.
Two bugs in the PostgreSQL driver:
1. SwitchDatabase() used the URL path (e.g. "/postgres") instead of
the target database name. The leading slash caused
'database "/postgres" does not exist' errors, making multi-database
browsing completely broken when connecting with a URL that includes
a database name.
2. GetDatabases() listed all databases regardless of permissions.
Users with restricted CONNECT privileges saw databases they couldn't
access, causing connection errors. Now filters with
has_database_privilege() and datallowconn.
Filter colorChangedCells() to only apply delete/update highlights for
changes belonging to the current table, preventing phantom colored
rows from appearing on unrelated tables in other tabs.
When a table has no primary key, fall back to using all column values
in the WHERE clause for UPDATE and DELETE queries. A status bar warning
is shown to alert the user that the table lacks a primary key.
Also adds empty-row guard clauses in buildUpdateQuery and
buildDeleteQuery to prevent generating invalid SQL.
Add schema namespace constraint (n.nspname = s.schemaname) to the
pg_class JOIN in GetTableColumns to prevent duplicate rows when
multiple schemas contain tables with the same name.
The editor command comes from trusted $EDITOR/$VISUAL env vars,
same trust level as the existing SQL editor implementation.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove unnecessary sort icon stripping from column name since
GetColumnNameByIndex reads from the data model, not UI cells
- Handle editor env vars with flags (e.g. "code --wait") by splitting
with strings.Fields before passing to exec.Command
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add JSONViewerWordWrap and EnterOpensJSONViewer config options
- Add Application settings table with all config options
- Document Ctrl+O keybinding for external cell editor
- Document z/Z keybindings for JSON viewer
- Add JSON Viewer keybindings section (w for wrap toggle, y for copy)
- Add External Editor section with environment variables
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Ctrl+O keybinding to edit current cell value in external editor
($EDITOR, $VISUAL, or vi). Works on Linux/macOS only.
Add EnterOpensJSONViewer config option to open JSON viewer when
pressing Enter on a cell (disabled by default).
Config usage:
[application]
EnterOpensJSONViewer = true
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add JSONViewerWordWrap config option to enable word wrap in JSON viewer.
Add 'w' keybinding to toggle word wrap while viewing JSON.
Config usage:
[application]
JSONViewerWordWrap = true
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Adds a new Timeout field to the Command struct that allows users to configure the timeout duration (in seconds) for commands that run before connecting to a database. Previously, the timeout was hardcoded to 5 seconds.
Changes:
- Add Timeout field to Command struct (defaults to 5 seconds if not set)
- Update RunCommand function to accept configurable timeout duration
- Improve error handling with descriptive messages for:
- Invalid database providers
- Command timeouts (includes command name and duration)
- Command start failures
- Add comprehensive tests for timeout functionality
Usage example in config.toml:
Commands = [
{ Command = 'ssh -L ${port}:localhost:5432 user@host', Timeout = 30 }
]