JSON columns
A text column can hold JSON documents. DataPad marks it in the schema tree with a **JSON** badge and a nested graph of its declared structure, and it renders each cell's document as a `{ } JSON` chip you can drill into.
JSON columns
A text column can hold JSON documents. DataPad marks it in the schema tree with a JSON badge and a
nested graph of its declared structure, and it renders each cell’s document as a { } JSON chip you can
drill into.
Define a column’s structure
Open the graph editor from a JSON-capable column in the connections tree (Edit JSON) or its Delete JSON counterpart. The editor has three ways to define the structure:
- Manual: build the graph by hand. Each node has a Kind (Object, Array of objects, or Scalar) and, for a scalar, a Type. Add and remove child nodes to describe nested objects and arrays. The root row’s Kind selector flips within the dialog so no option is cut off.
- Paste: paste C# and let the syntax tree produce candidate roots. A bare class becomes a linkable
class candidate you can accept; an EF fragment with its entity and navigation classes auto-detects.
A bare top-level
builderstatement does not auto-detect, and the guidance says so. The parse reports the detected roots and any skipped constructs. - Infer: sample a bounded number of the column’s rows and suggest a structure. The suggestion carries a sample report: rows sampled, parsed, and skipped, plus a truncation note.
A saved graph is stored per column identity (schema, table, and column). A column whose provider type is no longer text-capable can still keep and edit an existing graph.
Grid-first authoring
In the results grid, a JSON-capable column renders each cell’s document as a { } JSON chip. Clicking a
chip opens the document as a tab in the results area, so several documents can be open at once.
- An existing array document opens as the same property-column grid an array-of-objects renders, with one row per element. The shape is taken from the column’s declared structure, or inferred from the sibling documents in the same column, and the tab states which source it used.
- + Add element appends a new element row; an all-empty untouched draft element is dropped on save.
- Each element row carries a delete checkbox (in Edit mode), and the header states that one row is one new element and one column is one property.
- Save document writes the whole document back to the row’s column in a single update. It is disabled unless you are in Edit mode and the connection is write-enabled, and it becomes live once you have a pending change.
Create a document for a NULL cell
When a row’s JSON cell is NULL, Edit mode replaces the placeholder with a dashed { } + JSON create
affordance. Clicking it opens a document tab (for example Albums[15].Tracks):
- When the column has a declared or sibling-inferred shape, the tab opens the authoring grid with that property’s columns, so you fill in the fields directly.
- When no shape can be determined, the tab falls back to a raw JSON text area with a shape-neutral placeholder.
Saving the new document turns the cell into an ordinary { } JSON chip.
Where the structure comes from
An EF DLL connection can declare a column’s structure in its model (an owned ToJson() column), and
DataPad shows that schema-declared sub-graph in the tree. A connection-string column never carries a
declared structure, so its graph is one you defined or inferred. The JSON structure editor is a Pro
capability; the tree and the grid-first authoring shown here are the surfaces it drives.