MCPcopy Create free account
hub / github.com/PRQL/prql / translate_sstring

Function translate_sstring

prqlc/prqlc/src/sql/gen_expr.rs:709–723  ·  view source on GitHub ↗
(
    items: Vec<InterpolateItem<rq::Expr>>,
    ctx: &mut Context,
)

Source from the content-addressed store, hash-verified

707}
708
709pub(super) fn translate_sstring(
710 items: Vec<InterpolateItem<rq::Expr>>,
711 ctx: &mut Context,
712) -> Result<String> {
713 Ok(items
714 .into_iter()
715 .map(|s_string_item| match s_string_item {
716 InterpolateItem::String(string) => Ok(string),
717 InterpolateItem::Expr { expr, .. } => {
718 translate_expr(*expr, ctx).map(|expr| expr.into_source())
719 }
720 })
721 .collect::<Result<Vec<String>>>()?
722 .join(""))
723}
724
725/// Aggregate several ordered ranges into one, computing the intersection.
726///

Callers 2

translate_exprFunction · 0.85
translate_query_sstringFunction · 0.85

Calls 4

translate_exprFunction · 0.85
mapMethod · 0.80
into_iterMethod · 0.80
into_sourceMethod · 0.80

Tested by

no test coverage detected