feat: PolarDB graph backend with decomposed mixin architecture#1054
Open
anatolykoptev wants to merge 1 commit intoMemTensor:mainfrom
Open
feat: PolarDB graph backend with decomposed mixin architecture#1054anatolykoptev wants to merge 1 commit intoMemTensor:mainfrom
anatolykoptev wants to merge 1 commit intoMemTensor:mainfrom
Conversation
26216e3 to
3c85b6a
Compare
3c85b6a to
6d418fa
Compare
Major graph_dbs module overhaul: 1. PolarDB backend (polardb/) — decomposed into mixin-based package: - connection.py: pool management with health checks and retries - schema.py: AGE extensions, tables, indexes - nodes.py: node CRUD + agtype parsing - edges.py: edge CRUD - filters.py: dual SQL/Cypher WHERE clause builders - search.py: keyword, fulltext, embedding search - traversal.py: neighbors, subgraph, paths - queries.py: metadata queries, counts - maintenance.py: import/export, clear, cleanup 2. Shared utilities (utils.py) — compose_node, prepare_node_metadata, convert_to_vector, detect_embedding_field, clean_properties 3. BaseGraphDB extended with additional abstract methods: get_edges, search_by_fulltext, get_neighbors_by_tag, delete_node_by_prams, get_user_names_by_memory_ids, exist_user_name, search_by_keywords_like, search_by_keywords_tfidf 4. Neo4j/Neo4j Community/Nebula backends updated to implement new abstract methods Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
6d418fa to
451fa74
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
Overhaul of the
graph_dbs/module:polardb/package (11 files, ~4300 lines). Each mixin handles a logical concern (connection, nodes, edges, search, filters, etc.)utils.py): extracted common helpers used across backendsself.execute_query()incount_nodes()didn't exist — replaced with standard cursor patternPolarDB package structure
__init__.pyPolarDBGraphDBconnection.pyschema.pynodes.pyedges.pyfilters.pysearch.pytraversal.pyqueries.pymaintenance.pyhelpers.pyImport path unchanged
Test plan
BaseGraphDBabstract methods implemented in PolarDB (verified via AST)self.for cross-calls)🤖 Generated with Claude Code