Skip to content

cypher2sql

Ask graph questions of the PostgreSQL schema you already have.

Describe your tables and foreign keys once as nodes and edges, write a Cypher pattern, and get back one plain SQL query that selects the primary keys you asked for. No graph database, no copy of your data and no new runtime server: your PostgreSQL does the work.

  • Tutorial — your first query in ten minutes.
  • API reference — the exact names, signatures and errors.
  • Design — how a pattern becomes one SQL query.
  • Performance — what a compiled query costs.
  • Vision — what cypher2sql is, and is not, trying to be.

Install

pip install cypher2sql        # or: uv add cypher2sql
pip install psycopg           # the driver that executes the SQL

cypher2sql has no runtime dependencies and needs Python 3.12 or newer; you also need PostgreSQL 15 or newer. Every example in the tutorial and the API reference runs against a real PostgreSQL database in CI, so the SQL shown here is the SQL you get.