Graphtia documentation · workflow
Explore SQL schemas and declarations
Read PostgreSQL, MySQL and SQLite declarations, inspect table relationships and distinguish source facts from a live database.
Read one connected relationship map
Start with the endpoint, find its declaring handler, then inspect function calls, SQL operations and table declarations. The arrows retain each relationship’s direction.
- getOrder() to GET /orders/:idDeclares endpoint · Confirmed static
DECLARES_API_HANDLER - getOrder() to loadOrder()Calls · Confirmed static
CALLS - getOrder() to loadCustomer()Calls · Confirmed static
CALLS - loadOrder() to Read orderDeclares SQL operation · Confirmed static
DECLARES_DB_OPERATION - loadCustomer() to Read customerDeclares SQL operation · Confirmed static
DECLARES_DB_OPERATION - Read order to public.ordersReads table · Inferred
READS_TABLE - Read customer to public.customersReads table · Inferred
READS_TABLE - public.orders to public.customersForeign key · Confirmed static
FOREIGN_KEY - schema.sql to public.ordersDeclares table · Confirmed static
DECLARES_TABLE - schema.sql to public.customersDeclares table · Confirmed static
DECLARES_TABLE
Coverage is a separate question. A result may be partial even when an individual relationship is confirmed. Inspect coverage, completeness and limitations alongside each edge’s evidence strength.
This original illustration connects an endpoint, its declaring handler, function calls, SQL operations and two tables declared in one SQL file. The handler points toward the endpoint it declares; the foreign key points from orders to customers. Table-read matches remain inferred.
Analyze declarations, without connecting
Explorer reads indexed SQL source files. It does not ask for a database password, open a database connection, execute queries or apply migrations. Its graph describes declared structure and source relationships, not the current contents or effective schema of a running server.
Open a SQL source
Choose API & DB, then Database schemas, in the indexed workspace.
Find the SQL source and open it. Check the source identity and current revision.
Start with automatic dialect detection. If the source is unknown or ambiguous, select PostgreSQL, MySQL or SQLite explicitly for that source.
Inspect Tables, Indexes and Routines & changes. Open the source evidence for the item that matters.
Use Table graph for declared structure, or Tables + code to inspect supported linked code. Read uncertainty notices before following a relationship.

Supported declaration detail
Tables and columns: names, types, declared nullability, primary/unique/foreign keys and bounded defaults.
Indexes: supported simple index declarations, source column order and explicit ASC/DESC where present.
PostgreSQL identity columns, quoted identifier case, and bounded function/procedure/trigger declaration headers.
Recognized ALTER TABLE actions such as add, drop, rename, default and nullability changes, retained as declarations with their own source evidence.
Supported CHECK expressions have bounded structural evidence with complete, partial or unknown status. Routine bodies, unsupported expressions and unmodeled options retain their limits; recording a declaration does not execute or enforce it.
Automatic dialect selection
Automatic detection starts with recognizable SQL syntax. When supported source evidence proves how a migration is invoked, Explorer can also show a context-derived dialect. A directory name or driver dependency alone is insufficient. Portable SQL can remain unknown, and conflicting evidence can be ambiguous. An explicit selection does not certify the syntax or the live database. Read the detection evidence and incomplete-reading notices.
Relationships between migrations
CREATE and ALTER declarations can be shown with possible target relationships. A unique scoped candidate is still a static candidate. Repeated names, separate schemas, missing scope, temporary tables or incomplete input can leave several candidates or no resolved target. File order alone does not establish execution order or a final applied schema.
In API & DB → Database schemas, open a SQL source, then Routines & changes. Expand an ALTER declaration and review Related declarations before opening its source. Candidate labels describe the available scope; they do not claim that a migration has executed.
Within an explicitly declared scope, the ALTER statement can identify a candidate CREATE declaration. The two facts stay separate.
ALTER TABLE app.items ADD COLUMN label TEXT;CREATE TABLE app.items(id INTEGER);Matching scope supports the candidate. The original CREATE still declares only id.
A candidate does not establish migration order or an applied database state. Without sufficient scope, matches can remain ambiguous.
Limits by database family
PostgreSQL: supported source names are normalized according to quoted/unquoted identifier rules; runtime search paths, overload resolution and applied migrations are not inferred.
MySQL: bounded table/index declarations; dynamic SQL and unsupported compound bodies stay partial.
SQLite: bounded declarations; runtime pragmas, database contents and trigger execution are not inspected.
This guide does not claim SQL Server/T-SQL, Oracle PL/SQL, MongoDB or a universal database connector.
Follow a table into code
Open Database uses in code or the table’s code action. A source declaration and a code reference are separate observations. Read the database-code guide before treating a name match as the same table.
Agent query
Ask a connected agent to read the exact SQL source with get_db_schema, report its dialect, columns, keys and completeness, and cite ranges. Never ask it to convert an unresolved match into a verified live table.
Compose declared migrations only when their order is known
When a single-scope ordered plan is established by source evidence, Explorer can build a bounded declared composition. It starts from a declared model, not an observed database. Unordered migration files remain candidate relationships; filename order alone is not proof of execution order. No migration is applied.
Inspect CHECK expressions with supplied samples
An optional analysis can evaluate supported CHECK expressions against explicitly supplied typed samples. Results preserve unknowns and SQL’s three-valued behavior. This does not test INSERT conversion, defaults, complete row validity or enforcement by a real server. Only supply data you intend to expose to the querying client.
Use this through a connected agent with the optional analysis explicitly enabled. Start with the returned identity of the exact CHECK declaration and supply typed values. The supported request accepts at most 32 sample rows with at most 64 values per row. There is no native sample-entry form implied by this example.
Evaluate this supported expression against supplied values. Evaluation status and SQL truth answer different questions.
CHECK (x > 0)x = 1- Evaluation
- Evaluated
- SQL truth
- TRUE
Satisfied for this expression
x = -1- Evaluation
- Evaluated
- SQL truth
- FALSE
Not satisfied
x = NULL- Evaluation
- Evaluated
- SQL truth
- UNKNOWN
Satisfied under SQL CHECK truth rules
x omitted- Evaluation
- Cannot evaluate
- SQL truth
- Not established
Missing input is not treated as NULL
Illustration of opt-in agent analysis. It does not validate a complete row, apply defaults or execute an insertion.
Compare with an imported schema
An optional comparison can contrast declarations or a proved migration plan with DDL you supply. It reports supported differences with their source and uncertainty. The imported text is not a verified live snapshot; missing or partial information is not evidence that the deployed database matches. Explorer does not connect to a database to obtain it.
This is an opt-in agent analysis. Supply the DDL with its origin, dialect and completeness information. Keep the indexed source and supplied text separate when reading the differences.
The indexed SQL and the DDL supplied for review remain distinct inputs. These three differences are selected examples from the comparison.
CREATE TABLE t (
id INTEGER,
label TEXT DEFAULT 'old',
CONSTRAINT positive CHECK (id > 0)
);
CREATE INDEX ix ON t(label);CREATE TABLE t (
id BIGINT,
label TEXT DEFAULT 'new',
extra INTEGER,
CONSTRAINT positive CHECK (id > 1)
);t.idINTEGER → BIGINTChanged definitiont.extraOnly in supplied DDLINTEGER columnixAbsent from supplied DDLIndex on t(label)
Supplied DDL is not a verified live schema. Missing, partial or unsupported input can leave the comparison incomplete.
