import { AnyObject, DataObject, PropertyDefinition, PropertyType } from '@loopback/repository'; import { Model } from '@loopback/rest'; import { ModelProperties } from '../..'; import { SearchQuery } from '../../models'; import { ColumnMap, PredicateComparison, PredicateValueType, Queries, Query, SearchWhereFilter, SearchableModel, ShortHandEqualType } from '../../types'; export declare abstract class SearchQueryBuilder { protected baseQueryList: Query[]; protected limitQuery: string; protected orderQuery: string; protected query: DataObject; protected schema?: string; protected idType?: string; protected _placeholderIndex: number; protected modelNameMap: Map; protected get placeholder(): string; protected set placeholder(val: string | number); constructor(query: DataObject, schema?: string); abstract search(model: typeof Model, columns: Array | ColumnMap, ignoredColumns: (keyof T)[]): void; abstract unionString: string; build(models: (SearchableModel | typeof Model)[], ignoredColumns?: ModelProperties[], type?: typeof Model, idType?: string): { query: string; params: AnyObject | (string | AnyObject)[]; }; limit(): void; order(columns: Array): void; getColumnListFromArrayOrMap(model: typeof Model, columns: Array | ColumnMap, filter: (keyof T)[]): { columnList: string; selectors: string; }; getColumnListFromMap(model: typeof Model, columns: ColumnMap, filter: (keyof T)[]): { columnList: string; selectors: string; }; getColumnListFromArray(model: typeof Model, columns: Array, filter: (keyof T)[]): { columnList: string; selectors: string; }; paramsBuild(param: string): AnyObject | Array; paramString(index: number): string; queryBuild(models: (SearchableModel | typeof Model)[], ignoredColumns?: (keyof T)[], type?: typeof Model): string; whereBuild(model: S, where?: SearchWhereFilter): { sql: string; params: ShortHandEqualType[]; }; handleKeys(model: typeof Model, key: keyof SearchWhereFilter, where: SearchWhereFilter): Query | Queries | undefined; private buildStatement; handleAndOr(where: SearchWhereFilter, key: never, model: S): Query | undefined; handleObjectValue(expression: PredicateComparison, p: PropertyDefinition, key: never, model: S): Query | undefined; buildColumnValueForExpression(expressionValue: PredicateValueType, p: PropertyDefinition): any[]; parseIdPlaceholder(prop: PropertyDefinition): string; getColumnName(model: typeof Model, name: keyof T): any; toColumnValue(prop: PropertyDefinition, val: PredicateValueType): any; isStringType(type: PropertyType, val: PredicateValueType): boolean; isDateType(type: PropertyType): boolean; isNumberType(type: PropertyType, val: PredicateValueType): boolean; toDateType(val: Date | string): { sql: string; params: string[]; }; toArrayPropTypes(prop: PropertyDefinition, val: R[] | R): any; buildExpression(columnName: keyof T, prop: PropertyDefinition, operator: string, value: (Query | ShortHandEqualType)[] | ShortHandEqualType | Query, model: typeof Model): { sql: string; params: ShortHandEqualType[]; }; /** * The function `buildClauseFromExpress` constructs a SQL clause from an array of values, a separator, * and other parameters. * @param {(Query | ShortHandEqualType)[] | ShortHandEqualType | Query} values - The `values` * parameter in the `buildClauseFromExpress` function can be one of the following types: * @param {string} separator - The `separator` parameter is a string that will be used to separate the * values in the resulting clause. * @param {boolean} grouping - The `grouping` parameter in the `buildClauseFromExpress` function is a * boolean flag that determines whether the generated SQL clause should be wrapped in parentheses for * grouping purposes. If `grouping` is set to `true`, the SQL clause will be enclosed in parentheses. * If `grouping` * @param getPlaceholder - The `buildClauseFromExpress` function takes in four parameters: * @returns The `buildClauseFromExpress` function returns an object with `sql` and `params` * properties. The `sql` property contains the generated SQL clause based on the input values, * separator, and grouping settings. The `params` property contains an array of parameters used in the * SQL clause. */ buildClauseFromExpress(values: (Query | ShortHandEqualType)[] | ShortHandEqualType | Query, separator: string, grouping: boolean, getPlaceholder: () => string): Query; getTableName(model: typeof Model): string; getSchemaName(model: typeof Model): string; getModelName(model: typeof Model): string; private _isQuery; private _formatColumnSameInDb; }