596 Commits

Author SHA1 Message Date
Jorge Rojas f40493b425 Merge pull request #299 from jorgerojas26/feat/local-config-file
feat: add local .lazysql.toml config file support
v0.4.9
2026-05-04 00:41:08 -04:00
Jorge Rojas 58ffe72e2b fix: resolve golangci-lint errors (errcheck, gci) 2026-05-04 00:39:12 -04:00
Jorge Rojas 4695fe693e feat: add local .lazysql.toml config file support
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
2026-05-04 00:31:54 -04:00
Jorge Rojas a166236488 Merge pull request #272 from carlosflorencio/feat/cell-external-editor
feat: add external editor for cell values and Enter keybinding config
2026-03-12 10:17:10 -04:00
Jorge Rojas d51d2531e8 fix: linter 2026-03-12 10:16:47 -04:00
Jorge Rojas f36b5e40ab changed keybinding from 'Ctrl + o' to 'e' for editing a cell in external editor 2026-03-12 10:09:54 -04:00
Jorge Rojas 633bb97b57 Merge branch 'main' into feat/cell-external-editor 2026-03-12 10:07:23 -04:00
Jorge Rojas 3d772c3f25 Merge pull request #278 from kovstas/fix/no-pk-edit
fix: support editing tables without primary keys & fix cross-tab UI bugs
2026-03-12 09:49:26 -04:00
Jorge Rojas 70f1837e2d fix: linter 2026-03-12 09:49:01 -04:00
Jorge Rojas a3caecb1b7 Merge pull request #279 from koh-sh/fix/confirmation-dialog-wording
fix: align confirmation dialog wording with actual action
2026-03-12 09:42:56 -04:00
Jorge Rojas 6c279cd90a Merge pull request #280 from qdentity/dvic/fix-postgres-switch-database
Fix PostgreSQL cross-database queries and switching
2026-03-12 09:42:38 -04:00
Jorge Rojas 4f56f18532 Merge pull request #288 from SylvanFranklin/patch-1
Fix formatting for Homebrew installation command
2026-03-10 23:24:26 -04:00
Sylvan Franklin 7d8304d2e4 Fix formatting for Homebrew installation command 2026-03-10 17:26:29 -04:00
Damir Vandic 26b8e14c97 Fix cross-database queries using temporary connections
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.
2026-03-05 11:21:11 +01:00
Jorge Rojas c7959d15ce Merge pull request #282 from quantonganh/281-forcedraw-goroutine-panic
Calling ForceDraw from a goroutine can cause a panic
2026-02-26 23:05:26 -04:00
Jorge Rojas aec4474894 Merge pull request #283 from shahwan42/main
Fix: JSON viewer wraps single-cell content under column name, creating incorrect nesting
2026-02-26 23:01:06 -04:00
Ahmed Shahwan cb47008049 Fix: JSON viewer single-cell view 2026-02-27 00:28:30 +02:00
Quan Tong d5b0c4b371 Calling ForceDraw from a goroutine can cause a panic 2026-02-26 18:07:04 +07:00
Damir Vandic 714c9883b3 Fix PostgreSQL database switching and listing
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.
2026-02-25 13:34:18 +01:00
Jorge Rojas 1d4ee973dc Add Star History section to README
Added a Star History section with a chart to track repository stars.
2026-02-21 16:45:05 -04:00
koh-sh 54b84456d9 fix: align confirmation dialog wording with actual action
The dialog said "save" but the action is executing queries.
2026-02-19 00:43:48 +09:00
Stanislav Kovalenko 225e3f2a41 fix: scope pending change highlights to current table
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.
2026-02-18 14:26:29 +01:00
Stanislav Kovalenko 105fedf002 fix: allow editing and deleting rows in tables without primary keys
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.
2026-02-18 14:26:29 +01:00
Stanislav Kovalenko 33f67f227a fix: resolve duplicate rows in PostgreSQL Columns tab
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.
2026-02-18 14:26:28 +01:00
Jorge Rojas 075b18df9f Merge pull request #233 from ivanetchart/feature/configurable-command-timeout
Add configurable timeout for pre-connection commands
v0.4.8
2026-02-17 14:21:11 -04:00
Jorge Rojas 4139d0bdbd Merge pull request #274 from fjmoralesp/main
feat: add custom keymaps config
2026-02-17 14:17:24 -04:00
Jorge Rojas fecdce55ef Merge pull request #275 from jorgerojas26/fix/focus-lost
fix: app focus lost when navigating tabs after removing one
2026-02-17 14:01:42 -04:00
Jorge Rojas 151704702b fix: app focus lost when navigating tabs after removing one 2026-02-17 14:01:26 -04:00
Francisco Morales 612a33f3d8 feat: add keymaps config 2026-02-12 11:02:01 -05:00
Carlos Florêncio 0715cdce08 fix: suppress gosec G204 false positive for editor command
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>
2026-02-05 04:06:02 +00:00
Carlos Florêncio 19fd586a89 fix: address PR review feedback
- 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>
2026-02-05 04:04:21 +00:00
Carlos Florêncio a813d59777 docs: add documentation for new config options and keybindings
- 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>
2026-02-05 02:57:28 +00:00
Carlos Florêncio c53bf4abd9 feat: add external editor for cell values and Enter keybinding config
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>
2026-02-05 02:49:49 +00:00
Jorge Rojas 2ee9adf3ab Merge pull request #271 from carlosflorencio/feat/json-viewer-word-wrap
feat: add JSON viewer word wrap setting and toggle keybinding
2026-02-04 21:55:57 -04:00
Carlos Florêncio 71c6fdbf33 feat: add JSON viewer word wrap setting and toggle keybinding
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>
2026-02-05 00:08:01 +00:00
Jorge Rojas 2482cbe47f Merge pull request #255 from koh-sh/feat/env-var-support
feat: add environment variable support in config file
v0.4.7
2026-02-02 15:45:04 -04:00
Jorge Rojas 10a6805cea Merge pull request #268 from itomise/feature/schema-filter
feat: add Schemas config option to filter schemas in tree
2026-02-02 15:42:30 -04:00
Jorge Rojas 0aff728e36 Merge pull request #267 from itomise/feature/tree-width-config
feat: add TreeWidth config option for tree pane width
2026-02-02 15:38:51 -04:00
itomise 839e655ce4 feat: add Schemas config option to filter schemas in tree 2026-02-01 18:10:43 +09:00
itomise 862f2a65cb feat: add TreeWidth config option for tree pane width 2026-02-01 16:55:13 +09:00
Jorge Rojas a19986b2e8 Merge pull request #266 from Mathieubola/fix-postgres-url
fix: hostname parsing of postgres url
2026-01-29 14:50:26 -04:00
Mathieubl 9b28b5f794 fix: hostname parsing of postgres url 2026-01-29 18:36:04 +01:00
Ivan Etchart 1e8bc92e9e Add configurable timeout for pre-connection commands
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 }
]
2026-01-18 14:49:21 -03:00
Jorge Rojas 66248844a2 Merge pull request #261 from jorgerojas26/add-comment-column
add "comment" column to postgres and mssql
2026-01-02 15:57:58 -04:00
Jorge Rojas 3ddafb2c9d add "comment" column to postgres and mssql 2026-01-02 15:55:54 -04:00
Jorge Rojas 9bc8ec4925 Merge pull request #260 from koh-sh/feature/csv-export
feat: add csv export feature
v0.4.6
2026-01-02 12:53:30 -04:00
koh-sh 12e79526c6 docs: add csv export section to README 2026-01-03 01:08:24 +09:00
koh-sh 4367aacf8d fix: fallback to first column sort when no user sort or primary key exists in CSV export 2026-01-02 21:40:14 +09:00
koh-sh 94817cece5 fix: prevent timeout on large csv exports with batch fetching 2026-01-02 20:38:09 +09:00
Jorge Rojas b57c904fbb Merge pull request #259 from AlexRainHao/fix-toggle-left-wrapper
Fix Issue of #258
2026-01-01 14:52:09 -04:00