feat: add Pinecone vector database driver - #115
Open
Siyet wants to merge 3 commits into
Open
Conversation
Closes #15 Full PineconeDriver implementation using @pinecone-database/pinecone SDK. Integrated across connection form, driver factory, MCP server, import service, tree view, and driver contract tests. - Schema: indexes as tables, namespaces as children with vector counts - Custom command syntax: QUERY, UPSERT, DELETE, STATS, LIST - Connection form: API key field, no host/port - Optional methods: getEstimatedRowCount, getTableStatistics - 12 unit tests for command parser, driver contract tests updated
…ands
The regex-based parser truncated nested JSON values like
filter={"$and":[{"a":1},{"b":2}]} at the first closing brace.
Replace with a bracket-counting parser that handles nested structures
and string escaping within JSON.
https://claude.ai/code/session_01RwjTCNaBKhphYNzopBwqK1
isReadOnlyQuery() only recognized SQL verbs, blocking all Pinecone commands (QUERY, STATS, LIST) on read-only connections via MCP. Add Pinecone read verbs to READ_VERB_RE and update the error message. https://claude.ai/code/session_01RwjTCNaBKhphYNzopBwqK1
Siyet
commented
Apr 26, 2026
Siyet
left a comment
Owner
Author
There was a problem hiding this comment.
Fixes pushed
8d85d6e— Replace regex-based param parser with bracket-counting parser that handles nested JSON (e.g.filter={"$and":[{"a":1},{"b":2}]}). Added 2 test cases.d55e08e— Add Pinecone read commands (QUERY, STATS, LIST) toREAD_VERB_REso read-only connections can execute them via MCP. Updated error message. Added 3 test cases.
Issues to address
src/drivers/pinecone.ts:1— Top-levelimport { DatabaseDriver }is consistent with other drivers, but thePineconeDriverimport insrc/drivers/index.ts:7eagerly loads the entirepinecone.tsmodule at extension activation. For a cloud-only SDK unlikely to be installed on most machines, consider a lazyrequire()in the factory'scase 'pinecone':branch (matching the lazy pattern already inside the driver itself).package.json— Theviewstor-pineconeicon references\\E005inviewstor-icons.woff2, but the PR doesn't add a glyph to the font file. The icon will silently fall back to nothing until the font is updated.src/drivers/pinecone.ts:233—executeQueryusesparsed.params.topk || parsed.params.topKto handle case variants, but all other params are case-sensitive. Consider normalizing param keys to lowercase in the parser for consistency.
Generated by Claude Code
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
PineconeDriverimplementation using@pinecone-database/pineconeSDK — browse indexes and namespaces, query vectors by similarity, upsert/delete vectors, view index statisticsparsePineconeCommand:QUERY <index> vector=[...] topK=N,UPSERT <index> id=... vector=[...],DELETE <index> ids=[...],STATS <index>,LIST <index>Closes #15
Assumptions
config.password. Pinecone uses API key auth with no username. The connection form shows a dedicated "API Key" field that maps to the password field internally, consistent with how Redis stores its password.execute()method parses a custom syntax:COMMAND index-name key=value .... JSON arrays/objects in params are supported for vectors, metadata, and filters.@pinecone-database/pineconeSDK is loaded via lazyrequire()to avoid blocking extension activation, following the same pattern as other drivers.\E005is used for theviewstor-pineconeicon in the existingviewstor-icons.woff2font. If the glyph doesn't exist yet, the icon will fall back to the default; the font file needs a corresponding glyph added separately.DB_TYPE_TO_GRAFANA_DS.isSafeModeDBcheck already excludes unknown types).Manual test cases
QUERY my-index vector=[0.1,0.2,0.3] topK=5→ results show id, score, truncated values, metadata JSONUPSERT my-index id=test-1 vector=[0.1,0.2] metadata={"key":"val"}→ success messageDELETE my-index ids=["test-1"]→ success message with countSTATS my-index→ table with total vectors, dimension, metric, namespaces, index fullnessLIST my-index namespace=ns1 prefix=doc_ limit=10→ list of vector IDsSELECT * FROM my-index→ error message with supported command syntaxadd_connectionwithtype: "pinecone",password: "<api-key>"→ connection created successfullyChecklist
[Unreleased] > AddedGenerated by Claude Code