You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature: connect directly to a live PostgreSQL instance (--postgres DSN) instead of dumping schema to .sql first #1093
Add an optional live-database source so users can point graphify at a running PostgreSQL instance (via a connection string / DSN) and have it auto-extract the schema, instead of manually running pg_dump --schema-only first and feeding the resulting .sql file.
Motivation
Graphify already maps database schemas well: extract_sql() (extract.py:4251) parses tables, views, functions, and foreign-key relationships from .sql files via tree-sitter, and this is exactly what the v0.6.0 "map your entire backend in one graph" feature is about.
The friction is the manual dump step. Today the workflow is:
For users who just want a graph of their live database, the dump-to-file round trip is an unnecessary step, and it goes stale the moment the schema changes. A direct connector would let them do:
and get a fresh graph of the current schema on demand.
Proposed design
This should be a thin wrapper around the existing extraction path, not a new extractor:
New optional dependency group, e.g. postgres = ["psycopg[binary]"].
A small introspection helper that connects, reads the schema from the catalog (information_schema / pg_catalog), and emits the same node/edge shape extract_sql() already produces - tables, views, functions, and FK references edges - so everything downstream (build, cluster, report, export) is unchanged.
Wire it as a --postgres <dsn> flag (or a graphify extract source variant) that feeds the introspected schema into the normal pipeline.
Reusing the extract_sql node/edge contract keeps this isolated: no changes to build/cluster/export, and the graph looks identical whether the schema came from a .sql dump or a live connection.
Scope / non-goals
Schema only, not data. Same as the current .sql path - this maps structure (tables, columns, FKs, views, functions), not rows.
Read-only. The connector only introspects the catalog; it never writes.
Postgres first. The same approach generalizes to other engines later (MySQL, etc.) but this issue is scoped to Postgres.
Credentials handling: support a DSN string and standard PG* env vars (PGHOST, PGUSER, ...); document not committing secrets.
Alternatives
Keep the status quo (pg_dump then graphify extract). Works today, but stale and manual.
Context
Came up from a user asking whether graphify could point directly at PostgreSQL (and VictoriaLogs). The .sql-file path covers the Postgres-schema case once dumped; this issue is about removing the dump step. (Live log/time-series ingestion like VictoriaLogs is a separate, out-of-scope domain.)
graphify extract --postgres "postgresql://user:pass@host/db" now introspects a live database directly — no pg_dump roundtrip needed. Extracts tables, views, routines, and FK relations via information_schema in a SERIALIZABLE READ ONLY transaction. Credentials are sanitized from error messages. New graphify[postgres] optional extra (psycopg3).
Upgrade: uv tool upgrade graphifyy (coming in v0.8.34)
Activity
geektan123 commentedon Jun 1, 2026
Hi! I'd like to work on this issue. Could you assign it to me?
feat: Add live PostgreSQL introspection connector (resolves Graphify-…
safishamsi commentedon Jun 7, 2026
Fixed in 7467c1b (landed as part of PR #1103).
graphify extract --postgres "postgresql://user:pass@host/db"now introspects a live database directly — nopg_dumproundtrip needed. Extracts tables, views, routines, and FK relations viainformation_schemain aSERIALIZABLE READ ONLYtransaction. Credentials are sanitized from error messages. Newgraphify[postgres]optional extra (psycopg3).Upgrade:
uv tool upgrade graphifyy(coming in v0.8.34)