feat: Google Cloud Spanner Graph integration - #766
Conversation
|
@m-guesnon-pvotal is attempting to deploy a commit to the shashankss1205's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hey @m-guesnon-pvotal Can you please merge the latest changes and then add these on top of them. I re-added some parts of the visualization... |
|
@Shashankss1205 done. |
|
Still in draft, so leaving it as-is — just flagging that it now conflicts with No action needed if this is parked. If you do want to pick Spanner Graph support back up, rebasing sooner rather than later will be less painful — and worth noting #1302 is proposing changes to how backends are registered, which would affect this. |
This PR formally integrates Google Cloud Spanner Graph as a first-class supported database backend for both the CodeGraphContext CLI and the internal MCP server.
Previously,
cgcwas strictly tied to Neo4j and Kuzu/FalkorDB. By introducing a native Spanner backend, developers can now securely host their CodeGraph indexes inside their GCP environment at enterprise scale while avoiding the maintenance overhead of a separate graph cluster.Key Changes
core/database_spanner.pyto seamlessly execute Graph operations.MERGEqueries into native SpannerINSERT OR UPDATESQL DML statements, ensuring DDL compliance while seamlessly routingMATCHread operations natively via Spanner GQL.cgc spanner setup(orcgc s) to authenticate using Application Default Credentials (ADC) and bind their GCP Project, Instance, and Database IDs locally. Spanner configuration will natively fall back to sensible defaults when environment variables are omitted.CGC_RUNTIME_DB_TYPE=spannerconfiguration on boot and immediately begins routing file watch telemetry and structural graph analysis commands into the Spanner cluster.Additional Bug Fixes
visualizecrashes: Addressed an issue caused by upstream commitfbe8b9e, where thevisualizercommands and submodules were deleted from the codebase, but the corresponding import references insidecli/main.pywere accidentally kept. This oversight was causing an immediateModuleNotFoundErrorfor anyone manually importing the codebase off the main branch. Removed the dangling imports and mock-disabled the visualizer shortcut cleanly so the CLI successfully boots again.Verification
cgc spanner setupbinds variables safely.