/**
 * Relation Path Resolver
 *
 * Resolves nested relation paths (e.g., "userRoles.role.name") into table joins
 * and column references for use in WHERE clauses.
 *
 */
import type { JoinDefinition, ResolvedPath } from '../types/index.js';
export type { JoinDefinition, ResolvedPath };
export declare function isSafeIdentifier(segment: string): boolean;
/**
 * True when every dot-separated segment of a field path is a safe SQL identifier.
 * Use to validate field/group-by names before they reach any sql.raw interpolation.
 */
export declare function isSafeFieldPath(fieldPath: string): boolean;
/**
 * Resolve a relation path into joins and column reference
 *
 * Example: "userRoles.role.name" becomes:
 * - JOIN userRoles table
 * - JOIN roles table through userRoles
 * - Return roles.name column
 *
 * SECURITY: every path segment is validated against SAFE_IDENTIFIER and the final
 * column must actually exist on the resolved table. An unsafe segment or an
 * unresolvable column yields a null column/columnPath so the caller skips the
 * condition — a crafted segment can never reach sql.raw.
 */
export declare function resolveRelationPath(basePath: string, baseTable: any, baseTableName: string, baseAlias?: string, forPermissionCheck?: boolean): ResolvedPath;
/**
 * Check if a field path contains relations (has dots)
 */
export declare function isRelationPath(fieldPath: string): boolean;
/**
 * Apply joins to a Drizzle query builder
 *
 * Note: Drizzle doesn't support aliasing in joins directly with the leftJoin() API,
 * so we need to use raw SQL for the joins when aliases are needed.
 */
export declare function applyJoins(baseQuery: any, joins: JoinDefinition[]): any;
//# sourceMappingURL=relationPathResolver.d.ts.map