/**
 * Database Query Generation System
 *
 * Automatically generates optimized database queries for entity CRUD operations
 * including child entities, filtering, sorting, and RLS integration.
 */
import type { EntityConfig, ChildEntityDefinition } from './types';
export interface QueryOptions {
    select?: string[];
    where?: WhereClause[];
    orderBy?: OrderByClause[];
    limit?: number;
    offset?: number;
    includeChildren?: string[] | 'all';
    includeDeleted?: boolean;
}
export interface WhereClause {
    field: string;
    operator: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'in' | 'notin' | 'is' | 'isnot';
    value: unknown;
    connector?: 'AND' | 'OR';
}
export interface OrderByClause {
    field: string;
    direction: 'ASC' | 'DESC';
    nulls?: 'FIRST' | 'LAST';
}
export interface QueryResult {
    sql: string;
    params: unknown[];
    estimatedRows?: number;
}
export interface BulkQueryResult {
    mainQuery: QueryResult;
    childQueries: Record<string, QueryResult>;
}
/**
 * Generate SELECT query for entity
 */
export declare function generateSelectQuery(entityConfig: EntityConfig, options?: QueryOptions): QueryResult;
/**
 * Generate INSERT query for entity
 */
export declare function generateInsertQuery(entityConfig: EntityConfig, data: Record<string, unknown>, userId?: string): QueryResult;
/**
 * Generate UPDATE query for entity
 */
export declare function generateUpdateQuery(entityConfig: EntityConfig, id: string, data: Record<string, unknown>, userId?: string): QueryResult;
/**
 * Generate DELETE query for entity
 */
export declare function generateDeleteQuery(entityConfig: EntityConfig, id: string, userId?: string): QueryResult;
/**
 * Generate child entity queries for parent item
 */
export declare function generateChildEntityQueries(parentEntityConfig: EntityConfig, parentId: string, childNames?: string[] | 'all'): Record<string, QueryResult>;
/**
 * Generate INSERT query for child entity
 */
export declare function generateChildInsertQuery(parentEntityName: string, childConfig: ChildEntityDefinition, parentId: string, data: Record<string, unknown>, userId?: string): QueryResult;
/**
 * Generate UPDATE query for child entity
 */
export declare function generateChildUpdateQuery(parentEntityName: string, childConfig: ChildEntityDefinition, childId: string, data: Record<string, unknown>, userId?: string): QueryResult;
/**
 * Generate DELETE query for child entity
 */
export declare function generateChildDeleteQuery(childConfig: ChildEntityDefinition, childId: string, userId?: string): QueryResult;
/**
 * Generate bulk queries for multiple operations
 */
export declare function generateBulkQueries(entityConfig: EntityConfig, operations: Array<{
    type: 'insert' | 'update' | 'delete';
    data?: Record<string, unknown>;
    id?: string;
}>, userId?: string): QueryResult[];
/**
 * Generate count query for pagination
 */
export declare function generateCountQuery(entityConfig: EntityConfig, where?: WhereClause[]): QueryResult;
//# sourceMappingURL=query-generator.d.ts.map