Skip to content

fix(neo4j): route queries to the configured database - #1814

Merged
mehulp93 merged 1 commit into
mainfrom
fix-neo4j-db-driver
Sep 1, 2026
Merged

mehulp93 merged 1 commit into
mainfrom
fix-neo4j-db-driver

Conversation

@mehulp93

@mehulp93 mehulp93 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Neo4jDriver.execute_query put database_ in Cypher parameters_, so the Neo4j client ignored it and every query ran against the connection's home database. This passes database_ as the client's routing keyword (per-call override, including None for the home database, otherwise self._database) and sends delete_all_indexes through the same path. Query error logs now record parameter names only.

Type of Change

  • Bug fix
  • New feature
  • Performance improvement
  • Documentation/Tests

Objective

N/A (bug fix): honor Neo4jDriver(..., database=...) for reads, writes via execute_query, and index deletion.

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • All existing tests pass

Mocked routing tests in tests/driver/test_neo4j_driver_routing.py cover the configured database, per-call override, explicit None, default 'neo4j', and delete_all_indexes. pytest tests/driver/ passed; ruff and pyright are clean.

Breaking Changes

  • This PR contains breaking changes

Checklist

  • Code follows project style guidelines (make lint passes)
  • Self-review completed
  • Documentation updated where necessary
  • No secrets or sensitive information committed

Related Issues

Closes #1481
Related: #798, #851, #354, #875

Made with Cursor

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>
@mehulp93
mehulp93 deployed to development September 1, 2026 03:06 — with GitHub Actions Active
@mehulp93
mehulp93 merged commit 7eea131 into main Sep 1, 2026
10 checks passed
@zep-cla-assistant zep-cla-assistant Bot locked and limited conversation to collaborators Sep 1, 2026
@mehulp93
mehulp93 deleted the fix-neo4j-db-driver branch September 1, 2026 17:51

This branch was successfully deployed

1 active deployment
development — 376aaf09 Deployed Sep 1, 2026 by mehulp93 via pyright #3897
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Database Parameter Not Honored in Neo4jDriver.execute_query()

2 participants