queryEngineConfig

queryEngineConfig

This property is used for the custom implementations of the Vizzly query engine, and allows you to define the aggregates, time functions and filter operations that you support.

Query Engine Config

type SupportedTimeTruncFunctions = {
  [key: string]: {
    publicName: string;
    // https://docs.vizzly.co/concepts/timeFormat
    dateFormat: DateTimeFormat;
  };
};
 
type SupportedAggregates = {
  [id: string]: {
    publicName: string;
 
    // List of data types that this aggregate can be applied on.
    // All aggregate functions must return numeric results.
    // https://docs.vizzly.co/concepts/dataType
    validDataTypes: DataType;
  };
};
 
type SupportedOperators = {
  [id: string]: {
    publicName: string;
    // https://docs.vizzly.co/concepts/dataType
    validDataTypes: Array<DataType>;
  };
};
 
type QueryEngineConfig = {
   // What filter operations can be applied? For example `=` and `>`
  supportedOperators: SupportedOperators;
  //   What aggregate functions can be ran in the query engine?
  supportedAggregates: SupportedAggregates;
  // What functions can be applied to times? e.g truncate by `month`, `year`...
  supportedTimeTruncFunctions: SupportedTimeTruncFunctions;
};

Please note, there are a few basic requirements for your query engine. It must support at least one aggregate and one time trunc function.