Repository navigation
ask consumers
Which code reads or writes this table or column -- and what does the database itself do with it? One of the diagram questions of the ask verb -- see Diagrams and Charts for the model, the bundle and click-to-source.
Planned engine verb -- drag-lint ask is not shipped yet. Today ask this question with the chart pipeline command below, or with Ask-Report.ps1 (see Charts and the IDE).
From RAD Studio: drag-lint > Reports > Who uses this table or column... -- type the name in the prompt (see IDE Menu Reference).
drag-lint ask --question consumers --target <TABLE | TABLE.COLUMN> --db <project.sqlite> --sql-db <sql-index.sqlite>
Today, ask it through the chart pipeline:
New-DiagramArtifact.ps1 -Question consumers -Target TABLE|TABLE.COLUMN -DbPath <Delphi project index> -SqlDbPath <SQL-script index>
A database table (CUSTOMERS) or a column (CUSTOMERS.NAME).
- Code side: the routines that WRITE it and the routines that READ it.
-
Database side: the triggers declared FOR the table (their bodies are scanned, including
NEW./OLD.column use), the stored procedures that name it (aSET TERM-aware body scan), and the indexes ON it. - Column form only: the form bindings whose data-source chain resolves to that table.
-
The schema comes from SCRIPTS, not the live database. It is built from the
MS*.SQLmigration scripts, collapsed by name with the newest script winning. A table created outside those scripts is absent (measured: 5 livePDF_*tables), and a column may survive only in an older script. -
Writers are certain, readers are mostly inferred. Writers come from the engine's
sql_writesfact and are[certain]. Readers are mostly[inferred]from upper-case SQL-verb literals, becausesql_readsmisses SQL built with multi-lineSQL.Addcalls. Both counts are printed. -
Positional reads are invisible.
Fields[i]access names no column, so it cannot appear. -
On an index without SQL facts (ORM3 CLIENT today), only
[by name]literal matches appear. - A live-database snapshot (
fb-snapshot) makes the database side richer; it is optional.
The SQL-script index (tables, columns, triggers, procedures, indexes), the per-routine sql_reads / sql_writes facts that touches-tables uses in the other direction, SQL-verb string literals, and DFM data bindings for the column form.