sdk/dotnet/src/Microsoft.Datasync.Client.SQLiteStore/Utils/SqlQueryFormatter.cs
/// <summary>
/// Visitor for a function call node.
/// </summary>
/// <param name="node">The incoming node</param>
/// <returns>the processed node.</returns>
/// <exception cref="InvalidOperationException">if the function is not recognized or supported.</exception>
Visitor for a function call node.
Visitor for a function call node .
public override QueryNode Visit(FunctionCallNode node) => node.Name switch
        {
            "day" => FormatDateFunction(node, "%d"),
            "month" => FormatDateFunction(node, "%m"),
            "year" => FormatDateFunction(node, "%Y"),
            "hour" => FormatDateFunction(node, "%H"),
            "minute" => FormatDateFunction(node, "%M"),
            "second" => FormatDateFunction(node, "%S"),
            "floor" => FormatFloorFunction(node),
            "ceiling" => FormatCeilingFunction(node),
            "round" => FormatMathFunction(node, "ROUND", ",0"),
            "tolower" => FormatStringFunction(node, "LOWER"),
            "toupper" => FormatStringFunction(node, "UPPER"),
            "length" => FormatStringFunction(node, "LENGTH"),
            "trim" => FormatStringFunction(node, "TRIM"),
            "contains" => FormatLikeFunction(node, true, 1, 0, true),
            "startswith" => FormatLikeFunction(node, false, 1, 0, true),
            "endswith" => FormatLikeFunction(node, true, 1, 0, false),
            "concat" => FormatConcatFunction(node),
            "indexof" => FormatIndexOfFunction(node),
            "replace" => FormatStringFunction(node, "REPLACE"),
            "substring" => FormatSubstringFunction(node),
            _ => throw new InvalidOperationException($"Function call '{node.Name}' not valid with SQLite driver")
        };
public override QueryNode Visit ( FunctionCallNode node ) => node . Name switch { " " => FormatDateFunction ( node , " " ) , " " => FormatDateFunction ( node , " " ) , " " => FormatDateFunction ( node , " " ) , " " => FormatDateFunction ( node , " " ) , " " => FormatDateFunction ( node , " " ) , " " => FormatDateFunction ( node , " " ) , " " => FormatFloorFunction ( node ) , " " => FormatCeilingFunction ( node ) , " " => FormatMathFunction ( node , " " , " " ) , " " => FormatStringFunction ( node , " " ) , " " => FormatStringFunction ( node , " " ) , " " => FormatStringFunction ( node , " " ) , " " => FormatStringFunction ( node , " " ) , " " => FormatLikeFunction ( node , true , 1 , 0 , true ) , " " => FormatLikeFunction ( node , false , 1 , 0 , true ) , " " => FormatLikeFunction ( node , true , 1 , 0 , false ) , " " => FormatConcatFunction ( node ) , " " => FormatIndexOfFunction ( node ) , " " => FormatStringFunction ( node , " " ) , " " => FormatSubstringFunction ( node ) , _ => throw new InvalidOperationException ( $" Function call ' { node . Name } ' not valid with SQLite driver " ) } ;
Visitor for a function call node.
Visitor for a function call node .
the processed node.
the processed node .
if the function is not recognized or supported.
if the function is not recognized or supported .
node
FunctionCallNode
The incoming node
The incoming node