Static Methods
create()
Creates a new instance ofRequestQueryBuilder.
CreateQueryParams
Optional parameters to initialize the query builder
setOptions()
Sets global configuration options for allRequestQueryBuilder instances.
RequestQueryBuilderOptions
required
Configuration options including delimiters and parameter name mappings
getOptions()
Returns the current global configuration options.Instance Methods
query()
Generates the final query string from the built query object.boolean
default:true
Whether to URL-encode the query string
If
search() has been called, the filter and or parameters will be removed from the query object before generating the string.select()
Specifies which fields to include in the response.string[]
required
Array of field names to select
search()
Sets a complex search condition with support for nested AND/OR logic.SCondition
required
Search condition object with field operators and logical combinations
setFilter()
Adds filter conditions (all must match - AND logic).QueryFilter | QueryFilterArr | Array
Single filter, filter array, or array of filters
QueryFilter:{ field: string, operator: ComparisonOperator, value?: any }QueryFilterArr:[string, ComparisonOperator, any?]
setOr()
Adds OR filter conditions (at least one must match).QueryFilter | QueryFilterArr | Array
Single filter, filter array, or array of filters
setJoin()
Joins related entities and optionally selects specific fields from them.QueryJoin | QueryJoinArr | Array
Join configuration(s)
QueryJoin:{ field: string, select?: string[] }QueryJoinArr:[string, string[]?]
sortBy()
Sorts results by one or more fields.QuerySort | QuerySortArr | Array
Sort configuration(s)
QuerySort:{ field: string, order: 'ASC' | 'DESC' }QuerySortArr:[string, 'ASC' | 'DESC']
setLimit()
Limits the number of results returned.number
required
Maximum number of records to return
setOffset()
Sets the offset for pagination (number of records to skip).number
required
Number of records to skip
setPage()
Sets the page number for page-based pagination.number
required
Page number (1-based)
Use either
setOffset() or setPage() for pagination, not both. Page-based pagination is often more intuitive for users.resetCache()
Resets the cache by setting the cache parameter to 0.setIncludeDeleted()
Includes soft-deleted records in the results.number
required
Value to set (typically 1 to include deleted records)
cond()
Converts a filter object to a condition string. This is mainly used internally but can be useful for custom implementations.QueryFilter | QueryFilterArr
required
Filter to convert
'filter' | 'or' | 'search'
default:"search"
Condition type for validation
Method Chaining
All instance methods (exceptquery() and cond()) return this, allowing for fluent method chaining: