Craticula GridSchema reference
Generated from spec/grid-schema.schema.json ($id https://schemas.pluries.dev/craticula/v1/grid-schema.schema.json). Every member of the schema is listed with its type and description.
The field allowlist and per-field configuration that the host declares and every compilation requires. Every field a compilation touches (in filters, sort, group or aggregations) must be listed in fields; a column id that is not listed is either rejected or removed, depending on mode. The source and per-field format members were added after the first version of this schema, together with the model that reads them.
Members #
| Member | Type | Required | Default | Description |
|---|---|---|---|---|
mode | one of "strict", "lenient" | yes | "strict" | Controls what happens when a request names a column id that is not listed in fields. Strict mode throws an error, and Lenient mode silently strips the unknown column. Strict is the default. |
source | string (minLength 1) | yes | The physical collection every compiled query reads from: the SQL table or view named in FROM, the MongoDB collection, or the search index. The host declares it and a client never influences it, just like the per-field physical mappings, so it lives here and not on the wire request. It is required, because a query with no source cannot be emitted. | |
stableKey | string (minLength 1) | yes | A field that is unique per row (no two rows share a value, null included). When the request's sort does not already end in an exact ordering on it, it is appended as a final ascending sort key with nulls last, so that paging is deterministic. A repeated field in the sort is dropped, and nothing after the stable key is kept once it orders exactly (any non-text field, or a case-sensitive text field); it is required for every grid and must be one of the keys in fields. | |
staticFilter | filterNode | A host-written condition, in the same filter-node shape as the IR, that is ANDed into every query. Use it for rules such as limiting rows to one tenant or hiding soft-deleted rows. Clients cannot change it. | ||
fields | object map to fieldConfig (minProperties 1) | yes | The complete allowlist of fields, keyed by logical column id. |
Definitions #
fieldConfig #
Type: object
| Member | Type | Required | Default | Description |
|---|---|---|---|---|
type | one of "string", "int64", "decimal", "double", "boolean", "date", "datetime" | yes | The declared type the AG Grid adapter uses to turn this field's wire values into typed values. It matches the type tags of the IR typed values one for one. | |
filterable | boolean | true | ||
sortable | boolean | true | ||
groupable | boolean | false | ||
aggregatable | array of one of "sum", "min", "max", "avg", "count" (uniqueItems true) | The aggregation functions this field may be aggregated with, taken from the closed set of version 1 functions (sum, min, max, avg, count). An empty or absent list means the field cannot be aggregated. | ||
physical | physicalMapping | The per-backend physical mapping of this field. A field only needs mappings for the backends it is actually compiled for. | ||
text | textOptions | Text matching options for this field. They only apply when type is string. | ||
exportable | boolean | true | Whether this field is included by default in a CSV or TSV export when the request does not list its own export columns. In that case every field flagged exportable is written, in schema order. The default is true. | |
label | string (minLength 1) | The header text for this field in an export, used when the request's export columns do not supply their own header override. When absent, the header falls back to the field's column id. | ||
format | formatOptions | Per-field format overrides for the CSV or TSV writer. When absent, the writer uses its default, which does not depend on any culture. The host declares it, no AG Grid request carries a format, and it only affects the export writer and never the compiled query. |
physicalMapping #
Type: object
| Member | Type | Required | Default | Description |
|---|---|---|---|---|
sql | one of object, object, object | Where the field lives in SQL: a plain column, a qualified column such as t.col, or a raw SQL expression as an escape hatch. It is always declared by the host on the server and never influenced by a client. | ||
sql.column | string (minLength 1) | in this variant | ||
sql.qualifiedColumn | string (minLength 1) | in this variant | ||
sql.expression | string (minLength 1) | in this variant | ||
mongo | object | |||
mongo.path | string (minLength 1) | yes | The nested document path of the field in MongoDB, for example address.city. | |
search | object | |||
search.field | string (minLength 1) | yes | ||
search.keywordSubField | string | The name of the exact-value sub-field (often .keyword) that holds the unsplit text. It is used for exact, prefix, wildcard and regex matching on a field that the index also tokenises. | ||
search.normalizedSubField | string | The name of a keyword sub-field that the index fills through a case- and accent-folding normalizer at indexing time. It is used for case-insensitive sorting and range comparisons, because Elasticsearch and OpenSearch range queries cannot ignore case at query time in the supported 7.10-era versions. It is separate from keywordSubField; declare it only for a field that needs case-insensitive ordering, and note that it costs extra index work. |
formatOptions #
The two per-field format overrides for exports: a date pattern and a decimal separator. Nothing else is offered, because anything more (a thousands separator, boolean spelling, a culture name) would be an invention that every language port has to reproduce.
Type: object
| Member | Type | Required | Default | Description |
|---|---|---|---|---|
datePattern | string (minLength 1) | A date pattern for this field in an export, replacing the ISO 8601 default. It only applies when type is date or datetime. Use only the common pattern letters (yyyy, MM, dd, HH, mm, ss and literal separators), so dd/MM/yyyy gives the same output on .NET, Java and JavaScript; a pattern the formatter cannot apply is rejected when the schema is parsed, and an offset letter (z, K) shows the server's own offset for a value that has none. | ||
decimalSeparator | string (minLength 1, maxLength 1) | The decimal separator for this field in an export, overriding the writer-wide default, which is . and does not depend on any culture. It only applies when type is decimal or double, because an integral value has no fractional part. If it equals the delimiter the writer is using, the writer refuses the export before writing its first byte, since only the writer knows the delimiter. |
textOptions #
Type: object
| Member | Type | Required | Default | Description |
|---|---|---|---|---|
caseSensitivity | one of "insensitive", "sensitive" | "insensitive" | Per-field opt-in to case-sensitive comparison. The default is insensitive. | |
searchMode | one of "substring", "analyzed" | "substring" | How contains matches text in this field. substring (default) finds the text anywhere inside the value; analyzed searches by whole words with relevance scoring, and is only available where the backend supports it (search engines). |