Lister implementation for retrieving sources corresponding to records in a query result.
- query As
%String- the query to fetch the data from, wherein each returned row corresponds to an individual source to be indexed.
- idField As
%String- the column retrieved by the query that contains the identifier we can use as the LocalReference for the source to be stored. Values for this column should not contain colon characters.
- groupField As
%String- the column retrieved by the query that contains the group name to use as for the source to be stored.
- dataFields As
%List- the columns retrieved by the query that contain the data to be indexed (currently %String only).
- metaFields As
%List- the columns retrieved by the query that contain the metadata attributes to set for this source.
- metaKeys As
%List- the metadata field names, corresponding to the entries in metaFields (if left blank, we assume the column names correspond to the metadata field names).
- multiDataFieldMode As
%Integer- 0 = concatenate dataFields (default), 1 = store as separate sources (colon+dataField pos is postfixed to idField value).
- concatSeparator As
%String- separator to use for concatenating multiple fields (default " ").
External ID structure: [GroupName]:[LocalRef]
- GroupName = either retrieved as a column in the query results or, if none specified, the full query string.
- LocalRef = a unique (within the group) identifier retrieved as one of the query result columns. This should not contain colon characters!
Lister alias: "SQL"
Triggers the query and loops through the results, listing each row as a separate source (exception: when multiDataFieldMode = 1). Metadata is retrieved and stored as specified by the metaFields and metaKeys parameters.
In the current implementation, the data columns are also fetched and stored locally using
Utility method to format the parameter string passed in AddList for display by the %iKnow.Source.Loader.GetCurrentLists() method. Defaults to $lts() but should be overridden to nicen up complex datatypes in the parameter list.
Lister alias: "SQL"
Tests performed by this Lister:
- query: checks whether this is a valid SQL statement (type SELECT or CALL)
- idField: checks whether this is a valid column, returned by the above query
- groupField: checks whether this is a valid column, returned by the above query
- dataFields: checks whether these are valid columns, returned by the above query
- metaFields: checks whether these are valid columns, returned by the above query
- metaKeys: checks whether these are existing metadata fields
- multiDataFieldMode: no checks
- concatSeparator: no checks