OQGRAPH Graph Engine
Graph and hierarchy queries in SQL via ENGINE=OQGRAPH on MariaDB and MySQL-family servers.
OQGRAPH computes paths, reachability, and leaves over an edge table stored in a normal engine (typically InnoDB). Relational data stays relational. Graph operations stay in SQL — same clients, backups, and HA plane.
Use when
- Org charts, category trees, BOM, ACL inheritance
- Directed networks with optional edge weights
- You need answers without operating a separate graph database
Contract
- Store edges in a backing table (
origid,destid, optionalweight). - Create an OQGRAPH table bound with
data_table/origid/destid[/weight]. - Select with
latch=dijkstras,breadth_first, orleaves.
SELECT GROUP_CONCAT(linkid ORDER BY seq) AS path
FROM oq_graph
WHERE latch='dijkstras' AND origid=1 AND destid=6;Limits
- Latch-driven API — not a general property-graph store
- Not aimed at billion-edge analytical warehouses
- Writes go only to the backing table
- Query cache is unused