@medusajs/index
Version:
Medusa Index module
59 lines • 1.69 kB
TypeScript
import { IndexTypes } from "@medusajs/framework/types";
import { Knex } from "@mikro-orm/knex";
import { QueryFormat, QueryOptions } from "../types";
export declare const OPERATOR_MAP: {
$eq: string;
$lt: string;
$gt: string;
$lte: string;
$gte: string;
$ne: string;
$in: string;
$is: string;
$like: string;
$ilike: string;
};
export declare class QueryBuilder {
#private;
private readonly structure;
private readonly entityMap;
private readonly knex;
private readonly selector;
private readonly options?;
private readonly schema;
private readonly allSchemaFields;
private readonly rawConfig?;
private readonly requestedFields;
private readonly idsOnly?;
constructor(args: {
schema: IndexTypes.SchemaObjectRepresentation;
entityMap: Record<string, any>;
knex: Knex;
selector: QueryFormat;
options?: QueryOptions;
rawConfig?: IndexTypes.IndexQueryConfig<any>;
requestedFields: {
[key: string]: any;
};
idsOnly?: boolean;
});
private getStructureKeys;
private getEntity;
private getGraphQLType;
private transformValueToType;
private getPostgresCastType;
private parseWhere;
private getShortAlias;
private buildQueryParts;
private buildSelectParts;
private transformOrderBy;
buildQuery({ hasPagination, hasCount, }: {
hasPagination?: boolean;
hasCount?: boolean;
}): {
sql: string;
sqlCount?: string;
};
buildObjectFromResultset(resultSet: Record<string, any>[]): Record<string, any>[];
}
//# sourceMappingURL=query-builder.d.ts.map