Multi-graph support with GraphManager and FROM clause#6
Merged
dylanbstorey merged 5 commits intomainfrom Jan 4, 2026
Merged
Conversation
added 5 commits
January 3, 2026 10:39
- Update GQLITE-I-0022 with refined use cases and implementation plan - Decompose into 6 tasks covering parser, AST, transform, bindings, and docs - Architecture: FROM clause in C extension, GraphManager in bindings
- Add from_graph_opt grammar rule to cypher_gram.y - Add from_graph field to cypher_match AST struct - Update make_cypher_match to accept graph name parameter - Add memory cleanup for from_graph in ast_node_free - Update AST print function to show FROM clause - Add CUnit tests for FROM clause parsing Syntax: MATCH (n:Person) FROM graph_name WHERE ... The FROM clause specifies which graph to query, enabling future multi-graph support via SQLite ATTACH. The transform layer will prefix table references based on from_graph value.
Add complete multi-graph functionality for querying across multiple graph databases using SQLite ATTACH: Core features: - FROM clause in MATCH patterns (e.g., MATCH (n) FROM social) - Table prefixing for cross-graph property access - graph() function to identify node source graph - Variable tracking with graph association Python bindings: - GraphManager class for managing multiple graphs - graphs() factory function with context manager support - Cross-graph query() and query_sql() methods - 22 tests for multi-graph functionality Rust bindings: - GraphManager struct with similar API - New error types: GraphExists, GraphNotFound - Graph::open_with_extension() method - 7 unit tests Documentation: - New how-to guide for multi-graph workflows - Updated Python and Rust API references
- Use is_some_and() instead of map_or() for clippy - Use relative path for test_other_graph.db (Windows has no /tmp)
Adds 80+ new integration tests covering: - String functions: toUpper, toLower, trim, ltrim, rtrim, substring, replace, reverse, left, right, split - Math functions: abs, ceil, floor, round, sqrt, sign, rand - List functions: size, head, tail, last, range - UNION and UNION ALL queries - WITH clause with filtering, aggregation, ORDER BY/LIMIT - CASE expressions (simple and generic forms) - COALESCE function and IS NULL/IS NOT NULL predicates - Type conversion functions: toString, toInteger, toFloat, toBoolean - EXISTS predicate for property checks - Multiple labels (create and match) - OPTIONAL MATCH with and without matching results - UNWIND clause with lists, CREATE, and range() - GraphManager: create, open, drop, list, query, cross-graph queries This brings Rust test coverage to parity with the Python test suite.
3218b0b to
1852184
Compare
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
FROMclause in MATCH patterns (e.g.,MATCH (n:Person) FROM social)graph()function to identify which graph a node comes fromGraphManagerclass/struct for Python and Rust bindingsFeatures
Core
graph()function for node source identificationPython Bindings
GraphManagerclass withlist(),create(),open(),drop(),query(),query_sql()graphs()factory function with context manager supportRust Bindings
GraphManagerstruct with similar APIGraphExists,GraphNotFoundGraph::open_with_extension()methodDocumentation
Example Usage
Test plan