Subquery-driven filter

Provide a dropdown that allows the user to filter on any column where the column is drawn from a subquery.

Ingredient Family: sqlFilterIngredients

Outline Display: Filter on column {{columnName}} from table {{table}} using the query: {{subQuery}}. The values are drawn from the query: {{optionsQuery}}

Local scope

The parent slot binds these (look up the slot in the parent to see how):

  • $query – The query that will get filtered

Names introduced within this component’s knobs:

  • table – table picked from the FROM clause of $query
  • subQueryTab – result columns of subQuery (referenceable as a virtual table)
  • queryTab – result columns of optionsQuery (referenceable as a virtual table)

Settings

Required

  • table : table name/alias from the FROM of $query
    The name or alias of the table that has the column we’re filtering by

  • columnName : column of table (type filter: any type)
    The name of an existing column from the table specified by tnm that we are filtering by (can be any type)

  • subQuery : SQL query
    A SQL query producing a boolean result that will be used (as a subquery) as a filter condition
    Must produce: result named Result matching exactly bool; required, non-nullable, then no more results
    Scope: none – this query does not accept [Username] or handler parameters. Use only table/column references and literal values.

  • optionsQuery : SQL query
    A SQL query returning the values and their labels for the dropdown
    Must produce: result named Value matching any type, then result named Label matching any type, then no more results
    Scope: none – this query does not accept [Username] or handler parameters. Use only table/column references and literal values.

  • label : constant value (type: text; required, non-nullable)
    The label for the dropdown

Optional

  • cssWidth : constant value (type: integer; required, non-nullable)
    Width as an integer between 1 and 12 where 12 is a full row