fix(neo4j): route queries to the configured database - #1814
Merged
Merged
Conversation
Pass database_ as Neo4j's routing keyword instead of a unused Cypher parameter, and send index deletion through the same path. Co-authored-by: Cursor <cursoragent@cursor.com>
prasmussen15
approved these changes
Sep 1, 2026
This branch was successfully deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
Neo4jDriver.execute_queryputdatabase_in Cypherparameters_, so the Neo4j client ignored it and every query ran against the connection's home database. This passesdatabase_as the client's routing keyword (per-call override, includingNonefor the home database, otherwiseself._database) and sendsdelete_all_indexesthrough the same path. Query error logs now record parameter names only.Type of Change
Objective
N/A (bug fix): honor
Neo4jDriver(..., database=...)for reads, writes viaexecute_query, and index deletion.Testing
Mocked routing tests in
tests/driver/test_neo4j_driver_routing.pycover the configured database, per-call override, explicitNone, default'neo4j', anddelete_all_indexes.pytest tests/driver/passed; ruff and pyright are clean.Breaking Changes
Checklist
make lintpasses)Related Issues
Closes #1481
Related: #798, #851, #354, #875
Made with Cursor