export interface SqlFilterableColumn { /** Column name as it appears in the result set. */ column: string; /** The predicate target, alias-qualified when the statement joins more than one relation. */ predicateTarget: string; } /** * A generated block's SQL carries `${param}` placeholders, which no dialect * parser accepts. Replace each with a string literal of the SAME LENGTH so the * statement parses and every offset still maps onto the original text. */ export declare function placeholderSafeSql(sql: string): string; /** * Which result columns may safely become a filter input on this SQL. * Returns [] whenever anything is uncertain. */ export declare function filterableResultColumns(sql: string, resultColumns: string[], dialect?: string): SqlFilterableColumn[]; /** * Filter fields for an App tile whose query is executed behind an outer result * wrapper. Certified blocks may explicitly declare dimensions that are safe to * filter after aggregation (for example `month` from `date_trunc(...) AS * month`). The generic SQL analyser cannot prove computed aliases, so merge * only declared dimensions that actually exist in the returned result. Measure * aliases remain excluded. */ export declare function dashboardFilterableResultColumns(sql: string, resultColumns: string[], declaredDimensions?: string[], dialect?: string): SqlFilterableColumn[]; /** * Write the new SQL back into a generated block, and declare the new parameter * in `params`, `parameterPolicy`, `allowedFilters`, and `filterBindings`. * * Targeted edits rather than regenerating the block: the source carries curated * metadata (terms, grain, outputs, lineage context) that a rebuild would either * lose or re-infer differently. */ export declare function replaceBlockStudioSql(source: string, sql: string, parameterName: string, value: unknown): string; export interface AddSqlResultFilterResult { sql: string; parameterName: string; predicateTarget: string; } /** * Inject ` = ${param}` into the statement's top-level WHERE, adding the * clause when there is none. Throws when the column is not offerable — callers * should have used {@link filterableResultColumns} first, so a throw here means * the artifact and the result disagree. */ export declare function addSqlResultFilter(sql: string, resultColumns: string[], column: string, existingParameterNames?: string[], dialect?: string): AddSqlResultFilterResult; //# sourceMappingURL=sql-result-filter.d.ts.map