import type { SQLQuery } from '@databases/sql';
import type { Condition, Ordering } from '../../zero-protocol/src/ast.ts';
import type { SchemaValue, ValueType } from '../../zero-schema/src/table-schema.ts';
import type { Constraint } from '../../zql/src/ivm/constraint.ts';
import type { Start } from '../../zql/src/ivm/operator.ts';
/**
 * Condition type without correlated subqueries.
 * This matches the output of transformFilters from zql/builder/filter.ts
 */
export type NoSubqueryCondition = Exclude<Condition, {
    type: 'correlatedSubquery';
}>;
export declare function buildSelectQuery(tableName: string, columns: Record<string, SchemaValue>, constraint: Constraint | undefined, filters: NoSubqueryCondition | undefined, order: Ordering, reverse: boolean | undefined, start: Start | undefined): SQLQuery;
export declare function constraintsToSQL(constraint: Constraint | undefined, columns: Record<string, SchemaValue>): SQLQuery[];
export declare function orderByToSQL(order: Ordering, reverse: boolean): SQLQuery;
/**
 * Converts filters (conditions) to SQL WHERE clause.
 * This applies all filters present in the AST for a query to the source.
 */
export declare function filtersToSQL(filters: NoSubqueryCondition): SQLQuery;
export declare function toSQLiteType(v: unknown, type: ValueType): unknown;
//# sourceMappingURL=query-builder.d.ts.map