pub struct WindowSql {
pub raw_sql: String,
pub parameters: Vec<Value>,
}Expand description
Generated SQL for window function query
Fields§
§raw_sql: StringParameterized SQL template. WHERE-clause values use dialect-specific
placeholders ($1, ?, @P1) and are never interpolated.
Identifiers here are user-controlled. Aliases and dimension paths come from the
request, so they are constrained rather than trusted: every one is rejected unless
it matches [_A-Za-z][_0-9A-Za-z]* (WindowPlanner::validate_identifier_charset),
and dimension paths are additionally checked against
crate::compiler::window_allowlist::WindowAllowlist wherever the schema
enumerates them. The FROM target is the resolved fact table, not the request’s
table key.
This comment previously claimed the identifiers were “schema-derived”, “allowlist-validated” and “not user-controlled at runtime”. All three were false on this path: the allowlist was only ever consulted by a second planner that nothing outside tests called (deleted in #881), and four sinks interpolated request strings verbatim (#794). Keep this description honest — it is load-bearing for anyone auditing the emitters below.
parameters: Vec<Value>Bind parameters in placeholder order, passed to
execute_parameterized_aggregate.