Expose ProllyTree SQL API to Python and Add Chronological LangGraph TA-RAG Example #87
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
This PR adds complete SQL functionality to the ProllyTree Python bindings, allowing users to
execute SQL queries on the versioned key-value store through a new ProllySQLStore class.
Changes
Core Implementation
Python Module Updates
Build System Enhancements
Storage Layer
Documentation & Examples
API Usage
from prollytree import ProllySQLStore
Initialize store (requires git repository)
store = ProllySQLStore(path)
Create table
store.create_table("users", [("id", "INTEGER"), ("name", "TEXT")])
Insert data
store.insert("users", [[1, "Alice"], [2, "Bob"]])
Query with different formats
results = store.execute("SELECT * FROM users") # Returns list of dicts
labels, rows = store.execute("SELECT * FROM users", format="tuples")
json_str = store.execute("SELECT * FROM users", format="json")
csv_str = store.execute("SELECT * FROM users", format="csv")
Helper methods
store.select("users", columns=["name"], where_clause="id > 1")
Execute multiple queries
store.execute_many([query1, query2, query3])
Commit changes
store.commit("Added user data")
Building with SQL Support
Build with SQL support
./python/build_python.sh --with-sql
Build and install
./python/build_python.sh --with-sql --install
Run example
python3 python/examples/sql_example.py
Testing
Breaking Changes
None - SQL support is optional and doesn't affect existing functionality.
Notes