API reference: @salmonui/data/server
JsonQueryHandlerOptionsinterface
import type { JsonQueryHandlerOptions } from '@salmonui/data/server';interface JsonQueryHandlerOptions {
readonly key: string;
readonly fields?: readonly string[];
readonly types?: Readonly<Record<string, WireType>>;
readonly dict?: readonly string[] | 'auto';
readonly parentField?: string;
readonly versionField?: string;
readonly validate?: (row: Obj) => readonly {
readonly field?: string;
readonly code: string;
readonly message: string;
}[];
readonly nextKey?: () => Json;
readonly facetLimit?: number;
readonly lookups?: Readonly<Record<string, readonly Obj[]>>;
readonly lookupFields?: Readonly<Record<string, {
readonly lookup: string;
readonly keyField: string;
readonly displayField: string;
}>>;
}
| Name | Signature | Description |
|---|---|---|
key | readonly key: string; | |
fieldsoptional | readonly fields?: readonly string[]; | Full field list (default: keys of the first row). |
typesoptional | readonly types?: Readonly<Record<string, WireType>>; | Wire types per field (default: inferred from the first row; |
dictoptional | readonly dict?: readonly string[] | 'auto'; | Dictionary-encode these string fields, or |
parentFieldoptional | readonly parentField?: string; | Tree data: field holding the parent key (blank for roots). Tree reads
( |
versionFieldoptional | readonly versionField?: string; | Row version field; incremented on every change and checked against |
validateoptional | readonly validate?: (row: Obj) => readonly {
readonly field?: string;
readonly code: string;
readonly message: string;
}[]; | Validation for added and changed rows. |
nextKeyoptional | readonly nextKey?: () => Json; | Key generator for added rows whose key is null. |
facetLimitoptional | readonly facetLimit?: number; | Max facet entries. Default 1000. |
lookupsoptional | readonly lookups?: Readonly<Record<string, readonly Obj[]>>; | Lookup tables answered for |
lookupFieldsoptional | readonly lookupFields?: Readonly<Record<string, {
readonly lookup: string;
readonly keyField: string;
readonly displayField: string;
}>>; | Fields holding a lookup key (lookup / foreign-key columns):
sorting and grouping by such a field order rows and groups by the
|