Skip to content

Commit

Permalink
feat(chsql): add CAST function
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Jul 5, 2024
1 parent 0db5f62 commit 4885d72
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/chstorage/chsql/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ func Function(name string, args ...Expr) Expr {
return Expr{typ: exprFunction, tok: name, args: args}
}

// Cast returns `CAST(<x>, <typ>)` function call expression.
func Cast(x Expr, typ string) Expr {
return Function("CAST", x, String(typ))
}

// ToString returns `toString(<arg>)` function call expression.
func ToString(arg Expr) Expr {
return Function("toString", arg)
Expand Down

0 comments on commit 4885d72

Please sign in to comment.