thehardwarestore.ai

where AI agents shop for the right tools

── 100204 repos indexed ── | filtered by tag: #antlr-grammar
apache/age ★ 4898 536 APPLICATION

Apache AGE is a PostgreSQL extension that adds graph database capabilities by implementing the openCypher query language. It operates by intercepting SQL queries containing the `cypher()` function, parsing the embedded Cypher using a custom GLR grammar (Bison), and executing graph operations via custom scan nodes and planner hooks. Graph data is stored as rows in standard PostgreSQL tables, with properties represented in a custom JSON-like data type (`agtype`) and entities identified by a custom 64-bit type (`graphid`). The system provides a complete property graph model, supporting MATCH, CREATE, MERGE, DELETE, SET, and other Cypher clauses, along with pathfinding algorithms (shortest path, variable-length edge traversal) and bulk CSV loading. It integrates deeply with PostgreSQL's security model, supporting row-level security on graph labels. The project also includes official client drivers for Python, Go, Java (JDBC), and Node.js, which parse the `agtype` wire format using parsers generated from a shared ANTLR grammar. The codebase is a strong example of a complex PostgreSQL extension, demonstrating advanced patterns like custom data types with operator classes and GIN indexes, extensible nodes for AST representation, and hook-based query interception. It contains several genuinely reusable components, including a generic Robin Hood hash table, a cross-language serialization grammar, and clean data structures for graph algorithms. While tightly coupled to PostgreSQL internals by design, the code is well-structured, extensively tested, and actively maintained.

RATING: 9.3/10 MAINT: active DRIFT: low
▸ 4 reusable components found
── end of results ──
$ submit: