Delphi-RAG-Lint

drag-lint help

Field repository: describe a table's fields

Since: 1.62.0-alpha

Prints the per-field attributes of one repository table (kind, type, size, caption, width, events) as JSON or text, with an optional form/view overlay.

Read this when a tool or grid provider needs to know what the field repository holds for one table: it returns every field with its attributes and where each value comes from. It only reads the repository.

How to run it

drag-lint repo describe --table <T> (--repo <file> | --project <project file>) [--form <F> --view <V>] [--kinds <list>] [--json]

Example:

drag-lint repo describe --table FOLDERS --repo fields.dlrepo --json

Full flag list: repo in the CLI reference.

Flags

FlagArgumentMeaningDefault
--table<T>
--repo<file>
--project<project file>
--form<F>
--view<V>
--kinds<list>
--json

Where to click

No IDE surface: this feature runs from the CLI (see How to run it).

Details

drag-lint repo describe --table <T> (--repo <file> | --project <project file>)
                        [--form <F> --view <V>] [--kinds <list>] [--json]

Prints what the field repository knows about every field of ONE table, in the shape a grid builder needs: kind, type, size, caption, width, editor class, events. It only READS the repository. It is the reader contract of the FDGridProvider (FR3): the provider calls it, so the form, grid and view you give it decide which attributes are the grid's own.

Names. Table, form, view and field names match case-insensitively (ASCII); the output carries the STORED spelling of the table and the fields, and the argument as given for form and view.

Order. Fields are sorted by field name (byte order). The repository stores no column position; order is the 1-based position in the returned (kind-filtered) list.

Kinds. --kinds is a comma list of data calc lookup internal-calc aggregate unbound; the default is data,calc,lookup,unbound (internal-calc and aggregate fields are never offered unless named). An unbound field (a column that has no database field, found by read-grid) is offer: unchecked: a tool adds it as an UNCHECKED new column. Every other field is offer: checked.

The overlay. With --form and --view, the DL_GRID_COLUMNS rows of that form and view override the field's own defaults: CAPTION, WIDTH, the editor class and its properties, and COLUMN_NAME / COLUMN_INDEX (stated only by the overlay). A field with several rows takes the lowest COLUMN_INDEX, then COLUMN_NAME. A form and view with no grid row for the table is not an error: the remark no grid rows for form F view V on table T; field defaults used is printed and the fields keep their defaults.

Attributes and sources. Every attribute carries its source in source (same keys, same order):

attributerulesource
CAPTIONoverlay caption, else the field's display label; absent when both empty. A caption that equals the field name, trimmed and case-insensitive, has source default (a caption that only repeats the name is no better than the default)field / grid / default
WIDTHoverlay width if > 0, else the field's display width x 7grid / field
VISIBLE1 / 0, alwaysfield
ALIGNMENTonly 0, 1 or 2field
DISPLAY_FORMAT, EDIT_FORMATwhen statedfield
READONLY1 for calc, lookup, internal-calc, aggregate; else 0; alwayskind
PROPERTIES_CLASS, PROPERTIESthe overlay row, else the first grid row of the field with a class (form, view, column in byte order)grid
COLUMN_NAME, COLUMN_INDEXthe overlay row onlygrid
UNBOUND_KINDunbound fields only (graphic when not stated)field
EVENTSevent names of the stored bodies (OnGetText, OnSetText, OnValidate, OnChange, OnGetDisplayText, OnCustomDrawCell), then those the overlay namesfield / grid / field+grid

Schemas 2 to 8 are read; an attribute whose column does not exist in the repository's schema is simply absent (a schema-4 repository has no grid captions, no unbound kinds).

JSON. One compact line (LF-terminated, 7-bit ASCII, non-ASCII as \uXXXX): {"verb":"describe","repo":"<path>","schema":7,"table":"FOLDERS","form":null,"view":null,"fields":[{"field":"QTY","order":7,"kind":"data","offer":"checked","type":"Integer","size":0,"precision":0,"scale":0,"attrs":{...},"source":{...}}],"remarks":[]}. type is the FireDAC / TFieldType name (SmallInt, Integer, LargeInt, Single, Float, Date, Time, DateTime, TimeStampOffset, WideString, Bytes, Memo, Blob, Boolean, FMTBcd; empty when unknown). size is the character length of a WideString and the byte length of Bytes; precision comes from the field's domain; scale is the absolute scale. A field kind the tool does not know is reported as data with the remark unknown FIELD_KIND n for T.F.

Text. Without --json: TABLE <name> schema <n> repo <path>, one FIELD <name> kind=.. type=.. size=.. caption="..." width=.. offer=.. line per field, then REMARK lines.

Exit codes. 0 ok; 1 the repository is missing, unreadable or not a repository; 2 a usage error (no --table, --form without --view or the reverse, an unknown --kinds word) or an unknown table (the message lists the nearest table names). Errors go to stderr as drag-lint repo describe: <message>; with --json stdout also carries {"verb":"describe","error":"<message>","exit":N}.

Test: tests\autotest\run_v162_FR3_DESCRIBE.ps1 (34 checks: 18 goldens over the schema 4 / 6 / 7 fixtures in tests\fixtures\fr3, positive controls, errors).


All features | CLI reference | IDE menus