Skip to content

feat: add OMNISQL_PROJECT env var to support custom DB client project names - #27

Open
zerafachris wants to merge 1 commit into
srthkdev:mainfrom
zerafachris:feat/configurable-project-name
Open

feat: add OMNISQL_PROJECT env var to support custom DB client project names#27
zerafachris wants to merge 1 commit into
srthkdev:mainfrom
zerafachris:feat/configurable-project-name

Conversation

@zerafachris

Copy link
Copy Markdown

Summary

WorkspaceConfigParser hardcodes the DB client (DBeaver) project/workspace folder name to 'General' in 6 places. Any workspace that uses a custom or renamed project name (e.g. a real-world project literally named DataPlatform) returns zero connections from list_connections, with no way to configure it — OMNISQL_WORKSPACE only overrides the workspace root, not the project folder underneath it, and OMNISQL_CLI_PATH is unrelated (it only feeds the CLI query-execution fallback, not connection discovery).

I hit this directly: my real DBeaver project is named DataPlatform, containing 9 real connections across several folders. list_connections returned [] until I worked around it locally with a symlink (~/Library/DBeaverData/workspace6/General -> .../DataPlatform). This PR removes the need for that workaround.

Changes

  • Add optional projectName?: string to WorkspaceConfig (src/types.ts)
  • Add DEFAULT_PROJECT_NAME = 'General' constant in src/config-parser.ts; constructor now does config.projectName ?? DEFAULT_PROJECT_NAME
  • Replace all 6 hardcoded 'General' literals in WorkspaceConfigParser with this.config.projectName!: detectNewFormat() (x2), getConnectionsFilePath(), getCredentialsFilePath(), parseConnections() fallback path, isWorkspaceValid()
  • Wire new OMNISQL_PROJECT env var into the WorkspaceConfigParser instantiation in src/index.ts, and document it in the CLI --help text
  • Add test coverage in tests/config-parser.test.ts (asserts default 'General' path vs. a custom projectName path via getDebugInfo())
  • Document OMNISQL_PROJECT in README.md (env var table + "Workspace Format Support" section), docs-site/docs/getting-started/configuration.md, docs-site/docs/getting-started/installation.md, and examples/claude-desktop-config.json

Fully backward compatible — default behavior ('General') is unchanged when the new env var/config field is not set.

Related Issues

None filed — found and fixed while setting this MCP server up against a real workspace.

Checklist

  • Tests pass locally (npm test — 45/45 passing, including 2 new projectName tests)
  • Linting passes (npm run lint, npm run build — clean)
  • Documentation updated (README, docs-site pages, Claude Desktop config example)
  • Breaking changes documented (none — fully backward compatible, defaults preserve current 'General' behavior)

… names

WorkspaceConfigParser hardcoded the DBeaver project/workspace folder name
to 'General' in 6 places, so any DBeaver workspace using a custom or
renamed project (e.g. a project literally named 'DataPlatform') returned
zero connections from list_connections.

Add a new optional OMNISQL_PROJECT env var (config field: projectName)
that overrides the folder name, defaulting to 'General' for full
backward compatibility. Threaded through WorkspaceConfig -> constructor
-> detectNewFormat() x2, getConnectionsFilePath(), getCredentialsFilePath(),
parseConnections() fallback, and isWorkspaceValid().

Verified locally: reproduced the bug with a real DBeaver project named
'DataPlatform' returning [] from list_connections, worked around it with
a symlink (General -> DataPlatform), then implemented and verified this
proper fix removes the need for the symlink.

- Add projectName test coverage in tests/config-parser.test.ts
- Document OMNISQL_PROJECT in README, docs-site pages, and the Claude
  Desktop config example
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