private void AddMiscFunctions()
        {
            Register(config => config.Named("iif")
                     .WithBooleanParameter("condition")
                     .WithDynamicParameter("ifTrue")
                     .WithDynamicParameter("ifFalse")
                     .WhenExecute(context => SystemFunctions.Iif(context))
                     .ReturnsType(IifReturnType));

            Register(config => config.Named("i_frule_convert")
                     .WithDynamicParameter("rule")
                     .WhenExecute(context => Simple(context, args => SystemFunctions.FRuleConvert(args[0])))
                     .ReturnsType(context => {
                var argType = ReturnType(context.Arguments[0], context);
                return(argType is StringType ? (SqlType)PrimitiveTypes.Numeric() : (SqlType)PrimitiveTypes.String());
            }));
        }