DefaultSerializeFunction
The type of the defFn callback passed into a SerializeFunction,
letting a dialect extension fall back to the builder's own default rendering for a node it doesn't
want to fully override. Relevant only to authors of a dialect/adapter package — not to everyday
query building.
type DefaultSerializeFunction = (ctx: SerializeContext, o: any) => string;
Parameters
| Parameter | Type | Description |
|---|---|---|
ctx | SerializeContext | The active serialization context for the whole .generate() call. |
o | any | The node's own serialized-data shape, as passed to the enclosing SerializeFunction. |
serialize(ctx, type, obj, defFn) {
// ...only override some node types, defer to the default for the rest
return defFn(ctx, obj);
}