Skip to content

fix: resolve SQLite paths relative to config file directory#62

Merged
linhdmn merged 1 commit into
mainfrom
worktree-fix+sqlite-path-resolution
Apr 19, 2026
Merged

fix: resolve SQLite paths relative to config file directory#62
linhdmn merged 1 commit into
mainfrom
worktree-fix+sqlite-path-resolution

Conversation

@linhdmn
Copy link
Copy Markdown
Member

@linhdmn linhdmn commented Apr 18, 2026

Summary

  • Fix SQLite database_path relative path resolution to be relative to the config file location, not the server's working directory
  • This fixes "database connection not found" errors when the server runs from a different directory than where the config file lives

Root Cause

When the MCP server runs from /tmp (or any directory different from the config file location), relative SQLite paths like ./test.db were being resolved from /tmp instead of from the config file's directory.

Test plan

  • go build ./... passes
  • golangci-lint run passes
  • Test SQLite query via MCP tools after PR is merged

🤖 Generated with Claude Code

@linhdmn
Copy link
Copy Markdown
Member Author

linhdmn commented Apr 18, 2026

LGTM - Good fix for SQLite relative path resolution. resolveSQLitePaths() properly converts relative paths to absolute based on config file location.

When using relative SQLite database_path in config JSON, paths were
resolved relative to the server's working directory (/tmp) instead of
the config file location. This caused "database connection not found"
errors when the server ran from a different directory than where the
config file lived.

Now calls resolveSQLitePaths() after JSON unmarshal to convert relative
paths to absolute paths based on the config file's directory.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linhdmn linhdmn force-pushed the worktree-fix+sqlite-path-resolution branch from 21cf8ab to 6676da5 Compare April 19, 2026 04:03
@linhdmn linhdmn merged commit e25b755 into main Apr 19, 2026
4 checks passed
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