Skip to content

Conversation

@rick-five
Copy link

@rick-five rick-five commented Oct 17, 2025

Title

Type

  • feat: (new feature)
  • fix: (bug fix)
  • docs: (doc update)
  • refactor: (refactor code)
  • test: (test code)
  • chore: (other updates)

Scope

  • query: (query engine)
    • parser: (frontend parser)
    • planner: (frontend planner)
    • optimizer: (query optimizer)
    • executor: (execution engine)
    • op: (operators)
  • storage: (storage engine)
    • mvcc: (multi version concurrency control)
    • schema: (graph model and topology)
  • tool: (tools)
    • cli: (cli)
    • sdk: (sdk)
  • none: (N/A)

Description

Issue: #73
Key features include:

  • Database connection management with support for in-memory and file-based databases
  • GQL query execution with result formatting and performance metrics
  • Data loading and saving functionality with file import/export capabilities
  • Graph database creation and management with schema support
  • Support for both Rust bindings and pure Python simulated implementation
  • implementation of all major features including:
    • Direct data loading from Python objects
    • Graph creation with built-in procedures
    • Data manipulation (insert, update, delete)

## Enhance miniGU Python API with additional features

This commit enhances the miniGU Python API with several new features:

1. Added performance configuration methods:
   - set_cache_size() - Configure query result cache size
   - set_thread_count() - Configure parallel execution threads
   - enable_query_logging() - Enable/disable query execution logging

2. Added performance statistics method:
   - get_performance_stats() - Retrieve database performance metrics

3. Added graph data structure creation methods:
   - create_node() - Create node objects
   - create_edge() - Create edge objects
   - create_path() - Create path objects

4. Improved asynchronous API support:
   - Fixed async context manager
   - Enhanced async close method

5. Translated all Chinese comments to English for better internationalization

6. Maintained full backward compatibility with existing API

These enhancements provide a more complete Python API while maintaining compatibility with the Rust backend when available, and providing simulated implementations when Rust bindings are not available.
Copy link
Collaborator

@qishipengqsp qishipengqsp left a comment

Choose a reason for hiding this comment

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

Add an additional Markdown to describe:

  1. How to use the python interface
  2. The linking options you specified in the config.toml
  3. The interfaces you wrapped

raise ImportError("Rust bindings not available. miniGU requires Rust bindings to function.")


class Node:
Copy link
Collaborator

Choose a reason for hiding this comment

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

use vertex instead of node

build.rs Outdated
Copy link
Collaborator

Choose a reason for hiding this comment

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

why there are two build.rs here?

except (ImportError, ModuleNotFoundError):
# No longer provide simulated implementation warning, directly raise exception
HAS_RUST_BINDINGS = False
raise ImportError("Rust bindings not available. miniGU requires Rust bindings to function.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

L14-L28 is duplicate to init.py

metrics = result_dict.get("metrics", {})
return QueryResult(schema, data, metrics)
except Exception as e:
# 根据具体的错误类型抛出更精确的异常
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the chinese comments here. And check the others

else
source .venv/bin/activate
fi
echo "Running Python tests..."
Copy link
Collaborator

Choose a reason for hiding this comment

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

prune the verbose command for debugging here.


# Test that we can execute a simple query after graph creation
try:
result = self.db.execute("RETURN 'test' as result")
Copy link
Collaborator

Choose a reason for hiding this comment

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

this query does not make sense. You should validate the schema

try:
self.db.begin_transaction()
self.db.commit()
self.db.rollback()
Copy link
Collaborator

Choose a reason for hiding this comment

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

this test makes no sense

# Connection should be closed after context
self.assertFalse(db.is_connected)

def test_data_structures(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

why test these functions? They did not create the objects in Rust side

Copy link
Collaborator

Choose a reason for hiding this comment

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

.node .Edge Path

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