FormatQueryOptions
Defined in: packages/core/src/types/export.ts:76
Options object shape for formatQuery.
Extended by
Methods
getOperators()?
optionalgetOperators(field:string,misc: {fieldData: {[key:string]:unknown;className?:Classname;comparator?:string| (f: {[key:string]:unknown;className?:Classname;comparator?: string | ((f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string...;defaultOperator?:string;defaultValue?:any;disabled?:boolean;id?:string;inputType?:InputType|null;label:string;matchModes?:boolean|MatchMode[] |FlexibleOption<MatchMode>[];name:string;operators?:FlexibleOptionList<{[key:string]:unknown;disabled?:boolean;label:string;name:string;value:string; }> |string[] |FlexibleOption<string>[] | string | FlexibleOption<string>[];placeholder?:string;subproperties?:FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string | FlexibleOpt...>;validator?:RuleValidator;value:string;valueEditorType?:ValueEditorType| (operator:string) =>ValueEditorType;values?:FlexibleOptionList<{[key:string]:unknown;disabled?:boolean;label:string;name:string;value:string; }>;valueSources?:ValueSources|ValueSourceFlexibleOptions| (operator:string) => ValueSources | ValueSourceFlexibleOptions; },operator:string) =>boolean;defaultOperator?:string;defaultValue?:any;disabled?:boolean;id?:string;inputType?:InputType|null;label:string;matchModes?:boolean|MatchMode[] |FlexibleOption<MatchMode>[];name:string;operators?:FlexibleOptionList<{[key:string]:unknown;disabled?:boolean;label:string;name:string;value:string; }> |string[] |FlexibleOption<string>[] | string | FlexibleOption<string>[];placeholder?:string;subproperties?:FlexibleOptionList<{[key:string]:unknown;className?: Classname | undefined;comparator?:string| (f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string | FlexibleOpt...,operator:string) =>boolean;defaultOperator?:string;defaultValue?:any;disabled?:boolean;id?:string;inputType?: InputType | null | undefined;label:string;matchModes?:boolean|MatchMode[] |FlexibleOption<MatchMode>[];name:string;operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<string>[] | (string | FlexibleOption<...>)[] | undefined;placeholder?:string;subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (s...;validator?:RuleValidator;value:string;valueEditorType?: ValueEditorType | ((operator: string) => ValueEditorType) | undefined;values?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | undefined;valueSources?: ValueSources | ValueSourceFlexibleOptions | ((operator: string) => ValueSources | ValueSourceFlexibleOptions) | undefined; }>;validator?:RuleValidator;value:string;valueEditorType?:ValueEditorType| (operator:string) =>ValueEditorType;values?:FlexibleOptionList<{[key:string]:unknown;disabled?:boolean;label:string;name:string;value:string; }>;valueSources?:ValueSources|ValueSourceFlexibleOptions| (operator:string) => ValueSources | ValueSourceFlexibleOptions; }; }):FlexibleOptionList<FullOperator<string>> |null
Defined in: packages/core/src/types/export.ts:170
This can be the same getOperators function passed to QueryBuilder.
The full operator object from this array, where the operator's identifying property
matches the rule's operator, will be passed to the rule processor.
Parameters
| Parameter | Type | Description |
|---|---|---|
field | string | - |
misc | { fieldData: {[key: string]: unknown; className?: Classname; comparator?: string | (f: {[key: string]: unknown; className?: Classname; comparator?: string | ((f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string...; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }> | string[] | FlexibleOption<string>[] | string | FlexibleOption<string>[]; placeholder?: string; subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string | FlexibleOpt...>; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | (operator: string) => ValueEditorType; values?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>; valueSources?: ValueSources | ValueSourceFlexibleOptions | (operator: string) => ValueSources | ValueSourceFlexibleOptions; }, operator: string) => boolean; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }> | string[] | FlexibleOption<string>[] | string | FlexibleOption<string>[]; placeholder?: string; subproperties?: FlexibleOptionList<{[key: string]: unknown; className?: Classname | undefined; comparator?: string | (f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string | FlexibleOpt..., operator: string) => boolean; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null | undefined; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<string>[] | (string | FlexibleOption<...>)[] | undefined; placeholder?: string; subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (s...; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | ((operator: string) => ValueEditorType) | undefined; values?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | undefined; valueSources?: ValueSources | ValueSourceFlexibleOptions | ((operator: string) => ValueSources | ValueSourceFlexibleOptions) | undefined; }>; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | (operator: string) => ValueEditorType; values?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>; valueSources?: ValueSources | ValueSourceFlexibleOptions | (operator: string) => ValueSources | ValueSourceFlexibleOptions; }; } | - |
misc.fieldData | {[key: string]: unknown; className?: Classname; comparator?: string | (f: {[key: string]: unknown; className?: Classname; comparator?: string | ((f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string...; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }> | string[] | FlexibleOption<string>[] | string | FlexibleOption<string>[]; placeholder?: string; subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string | FlexibleOpt...>; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | (operator: string) => ValueEditorType; values?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>; valueSources?: ValueSources | ValueSourceFlexibleOptions | (operator: string) => ValueSources | ValueSourceFlexibleOptions; }, operator: string) => boolean; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }> | string[] | FlexibleOption<string>[] | string | FlexibleOption<string>[]; placeholder?: string; subproperties?: FlexibleOptionList<{[key: string]: unknown; className?: Classname | undefined; comparator?: string | (f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string | FlexibleOpt..., operator: string) => boolean; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null | undefined; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<string>[] | (string | FlexibleOption<...>)[] | undefined; placeholder?: string; subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (s...; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | ((operator: string) => ValueEditorType) | undefined; values?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | undefined; valueSources?: ValueSources | ValueSourceFlexibleOptions | ((operator: string) => ValueSources | ValueSourceFlexibleOptions) | undefined; }>; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | (operator: string) => ValueEditorType; values?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>; valueSources?: ValueSources | ValueSourceFlexibleOptions | (operator: string) => ValueSources | ValueSourceFlexibleOptions; } | - |
misc.fieldData.className? | Classname | - |
misc.fieldData.comparator? | string | (f: {[key: string]: unknown; className?: Classname; comparator?: string | ((f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string...; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }> | string[] | FlexibleOption<string>[] | string | FlexibleOption<string>[]; placeholder?: string; subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string | FlexibleOpt...>; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | (operator: string) => ValueEditorType; values?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>; valueSources?: ValueSources | ValueSourceFlexibleOptions | (operator: string) => ValueSources | ValueSourceFlexibleOptions; }, operator: string) => boolean | - |
misc.fieldData.defaultOperator? | string | - |
misc.fieldData.defaultValue? | any | - |
misc.fieldData.disabled? | boolean | - |
misc.fieldData.id? | string | - |
misc.fieldData.inputType? | InputType | null | - |
misc.fieldData.label | string | - |
misc.fieldData.matchModes? | boolean | MatchMode[] | FlexibleOption<MatchMode>[] | - |
misc.fieldData.name | string | - |
misc.fieldData.operators? | FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }> | string[] | FlexibleOption<string>[] | string | FlexibleOption<string>[] | - |
misc.fieldData.placeholder? | string | - |
misc.fieldData.subproperties? | FlexibleOptionList<{[key: string]: unknown; className?: Classname | undefined; comparator?: string | (f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string | FlexibleOpt..., operator: string) => boolean; defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null | undefined; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<string>[] | (string | FlexibleOption<...>)[] | undefined; placeholder?: string; subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (s...; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | ((operator: string) => ValueEditorType) | undefined; values?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | undefined; valueSources?: ValueSources | ValueSourceFlexibleOptions | ((operator: string) => ValueSources | ValueSourceFlexibleOptions) | undefined; }> | Properties of items in the value. |
misc.fieldData.validator? | RuleValidator | - |
misc.fieldData.value | string | - |
misc.fieldData.valueEditorType? | ValueEditorType | (operator: string) => ValueEditorType | - |
misc.fieldData.values? | FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }> | - |
misc.fieldData.valueSources? | ValueSources | ValueSourceFlexibleOptions | (operator: string) => ValueSources | ValueSourceFlexibleOptions | - |
Returns
FlexibleOptionList<FullOperator<string>> | null
Properties
concatOperator?
optionalconcatOperator:string& { } | "||" |"+"|"CONCAT"
Defined in: packages/core/src/types/export.ts:254
Operator to use when concatenating wildcard characters and field names in "sql" format.
The ANSI standard is ||, while SQL Server uses +. MySQL does not implement a concatenation
operator by default, and therefore requires use of the CONCAT function.
If concatOperator is set to "CONCAT" (case-insensitive), the CONCAT function will be
used. Note that Oracle SQL does not support more than two values in the CONCAT function,
so this option should not be used in that context. The default setting ("||") is already
compatible with Oracle SQL.
Default
'||'
context?
optionalcontext:Record<string,any>
Defined in: packages/core/src/types/export.ts:281
fallbackExpression?
optionalfallbackExpression:string
Defined in: packages/core/src/types/export.ts:179
This string will be inserted in place of invalid groups for non-JSON formats.
Defaults to '(1 = 1)' for "sql"/"parameterized"/"parameterized_named" and
'$and:[{$expr:true}]' for "mongodb".
fieldIdentifierSeparator?
optionalfieldIdentifierSeparator:string
Defined in: packages/core/src/types/export.ts:145
When used in conjunction with the quoteFieldNamesWith option, field names will
be split by this string, each part being individually processed as per the rules
of the quoteFieldNamesWith configuration. The parts will then be re-joined
by the same string.
A common value for this option is '.'.
A value of '' (the empty string) will disable splitting/rejoining.
Default
''
Example
formatQuery(query, {
format: 'sql',
quoteFieldNamesWith: ['[', ']'],
fieldIdentifierSeparator: '.',
})
// "[dbo].[Musicians].[First name] = 'Steve'"
fields?
optionalfields:FlexibleOptionList<{[key:string]:unknown;className?: Classname | undefined;comparator?:string| (f: {[key:string]:unknown;className?: Classname | undefined;comparator?: string | ((f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (string...;defaultOperator?:string;defaultValue?:any;disabled?:boolean;id?:string;inputType?: InputType | null | undefined;label:string;matchModes?:boolean|MatchMode[] |FlexibleOption<MatchMode>[];name:string;operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<string>[] | (string | FlexibleOption<...>)[] | undefined;placeholder?:string;subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (s...;validator?:RuleValidator;value:string;valueEditorType?: ValueEditorType | ((operator: string) => ValueEditorType) | undefined;values?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | undefined;valueSources?: ValueSources | ValueSourceFlexibleOptions | ((operator: string) => ValueSources | ValueSourceFlexibleOptions) | undefined; },operator:string) =>boolean;defaultOperator?:string;defaultValue?:any;disabled?:boolean;id?:string;inputType?: InputType | null | undefined;label:string;matchModes?:boolean|MatchMode[] |FlexibleOption<MatchMode>[];name:string;operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<string>[] | (string | FlexibleOption<...>)[] | undefined;placeholder?:string;subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | string[] | FlexibleOption<...>[] | (s...;validator?:RuleValidator;value:string;valueEditorType?: ValueEditorType | ((operator: string) => ValueEditorType) | undefined;values?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | undefined;valueSources?: ValueSources | ValueSourceFlexibleOptions | ((operator: string) => ValueSources | ValueSourceFlexibleOptions) | undefined; }>
Defined in: packages/core/src/types/export.ts:163
This can be the same FullField array passed to QueryBuilder, but
really all you need to provide is the name and validator for each field.
The full field object from this array, where the field's identifying property
matches the rule's field, will be passed to the rule processor.
format?
optionalformat:ExportFormat
Defined in: packages/core/src/types/export.ts:80
The ExportFormat.
numberedParams?
optionalnumberedParams:boolean
Defined in: packages/core/src/types/export.ts:211
Renders parameter placeholders as a series of sequential numbers
instead of '?' like the default. This option will respect the
paramPrefix option like the 'parameterized_named' format.
Default
false
operatorMap?
optionaloperatorMap:Partial<Record<DefaultOperatorName|"endswith"|"beginswith"|"doesnotcontain"|"doesnotbeginwith"|"doesnotendwith"|"notnull"|"notin"|"notbetween",string| [string,string]>>
Defined in: packages/core/src/types/export.ts:265
Map of operators to their translations for the "natural_language" format. If the
result can differ based on the valueSource, the key should map to an array where the
second element represents the string to be used when valueSource is "field". The first
element will be used in all other cases.
operatorProcessor?
optionaloperatorProcessor:RuleProcessor
Defined in: packages/core/src/types/export.ts:86
This function will be used to process the operator from each rule
for query language formats. If not defined, the appropriate
defaultOperatorProcessor* for the format will be used.
paramPrefix?
optionalparamPrefix:string
Defined in: packages/core/src/types/export.ts:186
This string will be placed in front of named parameters (aka bind variables) when using the "parameterized_named" export format.
Default
":"
paramsKeepPrefix?
optionalparamsKeepPrefix:boolean
Defined in: packages/core/src/types/export.ts:203
Maintains the parameter prefix in the params object keys when using the
"parameterized_named" export format. Recommended when using SQLite.
Default
false
Example
console.log(formatQuery(query, {
format: "parameterized_named",
paramPrefix: "$",
paramsKeepPrefix: true
}).params)
// { $firstName: "Stev" }
// Default (`paramsKeepPrefix` is `false`):
// { firstName: "Stev" }
parseNumbers?
optionalparseNumbers:ParseNumbersPropConfig
Defined in: packages/core/src/types/export.ts:223
Renders values as either number-types or unquoted strings, as
appropriate and when possible. Each string-type value is evaluated
against numericRegex to determine if it can be represented as a
plain numeric value. If so, parseFloat is used to convert it to a number.
placeholderFieldName?
optionalplaceholderFieldName:string
Defined in: packages/core/src/types/export.ts:229
Any rules where the field is equal to this value will be ignored.
Default
'~'
placeholderOperatorName?
optionalplaceholderOperatorName:string
Defined in: packages/core/src/types/export.ts:235
Any rules where the operator is equal to this value will be ignored.
Default
'~'
placeholderValueName?
optionalplaceholderValueName:string
Defined in: packages/core/src/types/export.ts:241
Any rules where the value is equal to this value will be ignored.
Default
'~'
preserveValueOrder?
optionalpreserveValueOrder:boolean
Defined in: packages/core/src/types/export.ts:216
Preserves the order of values for "between" and "notBetween" rules, even if a larger value comes before a smaller value (which will always evaluate to false).
preset?
optionalpreset:SQLPreset
Defined in: packages/core/src/types/export.ts:258
Option presets to maximize compatibility with various SQL dialects.
quoteFieldNamesWith?
optionalquoteFieldNamesWith:string| [string,string]
Defined in: packages/core/src/types/export.ts:124
In the "sql", "parameterized", "parameterized_named", and "jsonata" export formats, field names will be bracketed by this string. If an array of strings is passed, field names will be preceded by the first element and succeeded by the second element.
Tip: Use fieldIdentifierSeparator to bracket identifiers individually within field names.
Default
'' // the empty string
Examples
formatQuery(query, { format: 'sql', quoteFieldNamesWith: '"' })
// `"First name" = 'Steve'`
formatQuery(query, { format: 'sql', quoteFieldNamesWith: ['[', ']'] })
// "[First name] = 'Steve'"
quoteValuesWith?
optionalquoteValuesWith:string
Defined in: packages/core/src/types/export.ts:150
Character to use for quoting string values in the SQL format.
Default
'
ruleGroupProcessor?
optionalruleGroupProcessor:RuleGroupProcessor<unknown>
Defined in: packages/core/src/types/export.ts:105
This function will be used to process each rule group. If not defined, the appropriate
defaultRuleGroupProcessor* for the format will be used.
If this function is defined, it will override the format option. This also allows
formatQuery to produce completely custom output formats.
ruleProcessor?
optionalruleProcessor:RuleProcessor
Defined in: packages/core/src/types/export.ts:97
This function will be used to process each rule. If not defined, the appropriate
defaultRuleProcessor* for the given format will be used.
translations?
optionaltranslations:Partial<Record<NLTranslationKey,string>>
Defined in: packages/core/src/types/export.ts:279
Translatable strings used by the "natural_language" format.
validator?
optionalvalidator:QueryValidator
Defined in: packages/core/src/types/export.ts:155
Validator function for the entire query. Can be the same function passed
as validator prop to QueryBuilder.
valueProcessor?
optionalvalueProcessor:ValueProcessorLegacy|ValueProcessorByRule
Defined in: packages/core/src/types/export.ts:92
This function will be used to process the value from each rule
for query language formats. If not defined, the appropriate
defaultValueProcessor* for the format will be used.
wordOrder?
optionalwordOrder:ConstituentWordOrderString|"svo"|"sov"|"osv"|"ovs"|"vso"|"vos"| { } &string
Defined in: packages/core/src/types/export.ts:275
Constituent word order for the "natural_language" format. Can be abbreviated like "SVO" or spelled out like "subject-verb-object".
- Subject = field
- Verb = operator
- Object = value
API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.