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

Function operator_from_name

prqlc/prqlc/src/sql/gen_expr.rs:461–478  ·  view source on GitHub ↗
(name: &str)

Source from the content-addressed store, hash-verified

459}
460
461fn operator_from_name(name: &str) -> Option<BinaryOperator> {
462 use BinaryOperator::*;
463 match name {
464 "std.mul" => Some(Multiply),
465 "std.add" => Some(Plus),
466 "std.sub" => Some(Minus),
467 "std.eq" => Some(Eq),
468 "std.ne" => Some(NotEq),
469 "std.gt" => Some(Gt),
470 "std.lt" => Some(Lt),
471 "std.gte" => Some(GtEq),
472 "std.lte" => Some(LtEq),
473 "std.and" => Some(And),
474 "std.or" => Some(Or),
475 "std.concat" => Some(StringConcat),
476 _ => None,
477 }
478}
479
480pub(super) fn translate_literal(l: Literal, ctx: &Context) -> Result<sql_ast::Expr> {
481 Ok(match l {

Callers 1

translate_exprFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected