Wednesday, October 29, 2025
Show HN: SQLite Graph Ext – Graph database with Cypher queries (alpha) https://ift.tt/6yINhB7
Show HN: SQLite Graph Ext – Graph database with Cypher queries (alpha) I've been working on adding graph database capabilities to SQLite with support for the Cypher query language. As of this week, both CREATE and MATCH operations work with full relationship support. Here's what it looks like: import sqlite3 conn = sqlite3.connect(":memory:") conn.load_extension("./libgraph.so") conn.execute("CREATE VIRTUAL TABLE graph USING graph()") # Create a social network conn.execute("""SELECT cypher_execute(' CREATE (alice:Person {name: "Alice", age: 30}), (bob:Person {name: "Bob", age: 25}), (alice)-[:KNOWS {since: 2020}]->(bob) ')""") # Query the graph with relationship patterns conn.execute("""SELECT cypher_execute(' MATCH (a:Person)-[r:KNOWS]->(b:Person) WHERE a.age > 25 RETURN a, r, b ')""") The interesting part was building the complete execution pipeline - lexer, parser, logical planner, physical planner, and an iterator-based executor using the Volcano model. All in C99 with no dependencies beyond SQLite. What works now: - Full CREATE: nodes, relationships, properties, chained patterns (70/70 openCypher TCK tests) - MATCH with relationship patterns: (a)-[r:TYPE]->(b) with label and type filtering - WHERE clause: property comparisons on nodes (=, >, <, >=, <=, <>) - RETURN: basic projection with JSON serialization - Virtual table integration for mixing SQL and Cypher Performance: - 340K nodes/sec inserts (consistent to 1M nodes) - 390K edges/sec for relationships - 180K nodes/sec scans with WHERE filtering Current limitations (alpha): - Only forward relationships (no `<-[r]-` or bidirectional `-[r]-`) - No relationship property filtering in WHERE (e.g., `WHERE r.weight > 5`) - No variable-length paths yet (e.g., `[r*1..3]`) - No aggregations, ORDER BY, property projection in RETURN - Must use double quotes for strings: {name: "Alice"} not {name: 'Alice'} This is alpha - API may change. But core graph query patterns work! The execution pipeline handles CREATE/MATCH/WHERE/RETURN end-to-end. Next up: bidirectional relationships, property projection, aggregations. Roadmap targets full Cypher support by Q1 2026. Built as part of Agentflare AI, but it's standalone and MIT licensed. Would love feedback on what to prioritize. GitHub: https://ift.tt/RaxLykf Happy to answer questions about the implementation! https://ift.tt/RaxLykf October 30, 2025 at 12:22AM
Subscribe to:
Post Comments (Atom)
Show HN: Littlebird – Screenreading is the missing link in AI https://ift.tt/3Q79Kr5
Show HN: Littlebird – Screenreading is the missing link in AI https://littlebird.ai/ March 23, 2026 at 11:09PM
-
Show HN: Stickerbox, a kid-safe, AI-powered voice to sticker printer Bob and Arun here, creators of Stickerbox. If AI were built for kids, w...
-
Show HN: Music player for big local collections with mpd support mpz is a C++/Qt music player focused on UX, with derectory tree and playlis...
-
Show HN: HCB Mobile – financial app built by 17 y/o, processing $6M/month Hey everyone! I just built a mobile app using Expo (React Native) ...
No comments:
Post a Comment