feat: add OMNISQL_PROJECT env var to support custom DB client project names - #27
Open
zerafachris wants to merge 1 commit into
Open
feat: add OMNISQL_PROJECT env var to support custom DB client project names#27zerafachris wants to merge 1 commit into
zerafachris wants to merge 1 commit into
Conversation
… 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
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
WorkspaceConfigParserhardcodes 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 namedDataPlatform) returns zero connections fromlist_connections, with no way to configure it —OMNISQL_WORKSPACEonly overrides the workspace root, not the project folder underneath it, andOMNISQL_CLI_PATHis 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_connectionsreturned[]until I worked around it locally with a symlink (~/Library/DBeaverData/workspace6/General -> .../DataPlatform). This PR removes the need for that workaround.Changes
projectName?: stringtoWorkspaceConfig(src/types.ts)DEFAULT_PROJECT_NAME = 'General'constant insrc/config-parser.ts; constructor now doesconfig.projectName ?? DEFAULT_PROJECT_NAME'General'literals inWorkspaceConfigParserwiththis.config.projectName!:detectNewFormat()(x2),getConnectionsFilePath(),getCredentialsFilePath(),parseConnections()fallback path,isWorkspaceValid()OMNISQL_PROJECTenv var into theWorkspaceConfigParserinstantiation insrc/index.ts, and document it in the CLI--helptexttests/config-parser.test.ts(asserts default'General'path vs. a customprojectNamepath viagetDebugInfo())OMNISQL_PROJECTinREADME.md(env var table + "Workspace Format Support" section),docs-site/docs/getting-started/configuration.md,docs-site/docs/getting-started/installation.md, andexamples/claude-desktop-config.jsonFully 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
npm test— 45/45 passing, including 2 newprojectNametests)npm run lint,npm run build— clean)'General'behavior)