Skip to content

feat: add read-only query support for replica instances#2

Merged
SecKatie merged 1 commit into
SecKatie:mainfrom
singhtanmay6735:feature/read-only-support
Feb 2, 2026
Merged

feat: add read-only query support for replica instances#2
SecKatie merged 1 commit into
SecKatie:mainfrom
singhtanmay6735:feature/read-only-support

Conversation

@singhtanmay6735

Copy link
Copy Markdown
Contributor

Add comprehensive read-only query support to enable safe querying of FalkorDB read replicas and prevent accidental write operations.

Features:

  • Add FALKORDB_DEFAULT_READONLY config option for global read-only mode
  • Enhance query_graph tool with optional readOnly parameter
  • Add dedicated query_graph_readonly tool for explicit read-only queries
  • Use graph.roQuery() for read-only operations (GRAPH.RO_QUERY)
  • Maintain backward compatibility (default: read-write mode)

Implementation:

  • Update FalkorDBService.executeQuery() with readOnly parameter
  • Add FalkorDBService.executeReadOnlyQuery() convenience method
  • Add config.falkorDB.defaultReadOnly setting
  • Update MCP tools with read-only support
  • Add comprehensive test coverage (24 new tests)

Tests:

  • All 100 tests passing
  • Test coverage for read-only query execution
  • Test both roQuery() and query() code paths
  • Test error handling for read-only operations
  • Test configuration defaults

Documentation:

  • Update README.md with read-only mode usage
  • Add .env.example configuration

Use Cases:

  • Connect to FalkorDB read replicas in replication setups
  • Prevent accidental writes in production environments
  • Run analytics/reporting queries safely
  • Provide read-only access in multi-tenant setups

Breaking Changes: None
Backward Compatibility: Fully maintained

Add comprehensive read-only query support to enable safe querying
of FalkorDB read replicas and prevent accidental write operations.

Features:
- Add FALKORDB_DEFAULT_READONLY config option for global read-only mode
- Enhance query_graph tool with optional readOnly parameter
- Add dedicated query_graph_readonly tool for explicit read-only queries
- Use graph.roQuery() for read-only operations (GRAPH.RO_QUERY)
- Maintain backward compatibility (default: read-write mode)

Implementation:
- Update FalkorDBService.executeQuery() with readOnly parameter
- Add FalkorDBService.executeReadOnlyQuery() convenience method
- Add config.falkorDB.defaultReadOnly setting
- Update MCP tools with read-only support
- Add comprehensive test coverage (24 new tests)

Tests:
- All 100 tests passing
- Test coverage for read-only query execution
- Test both roQuery() and query() code paths
- Test error handling for read-only operations
- Test configuration defaults

Documentation:
- Update README.md with read-only mode usage
- Update CLAUDE.md with API documentation
- Add .env.example configuration
- Document use cases for replica instances

Use Cases:
- Connect to FalkorDB read replicas in replication setups
- Prevent accidental writes in production environments
- Run analytics/reporting queries safely
- Provide read-only access in multi-tenant setups

Breaking Changes: None
Backward Compatibility: Fully maintained

@SecKatie SecKatie left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@singhtanmay6735

Copy link
Copy Markdown
Contributor Author

All checks are green and tests are passing, ready to merge when you have a moment. @SecKatie

@SecKatie SecKatie merged commit ea60278 into SecKatie:main Feb 2, 2026
4 checks passed
@singhtanmay6735

singhtanmay6735 commented Feb 3, 2026

Copy link
Copy Markdown
Contributor Author

I don’t have permission to create a new release or publish the package to the npm registry. Could you please cut a new release and publish the updated version to npm when you have a moment? @SecKatie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants