Example #1
0
 protected virtual SqlStatement VisitCreateExternFunction(CreateExternalFunctionStatement statement)
 {
     return(new CreateExternalFunctionStatement(statement.FunctionName, statement.ReturnType, statement.Parameters,
                                                statement.ExternalReference)
     {
         ReplaceIfExists = statement.ReplaceIfExists
     });
 }
        public static void ExternalWithNoArguments()
        {
            var statement = new CreateExternalFunctionStatement(ObjectName.Parse("SYS.ext_func2"), PrimitiveTypes.String(), "Deveel.Data.ExtFunctions.Func1()");

            var sql = statement.ToString();
            var expected = new StringBuilder();
            expected.Append("CREATE EXTERNAL FUNCTION SYS.ext_func2() ");
            expected.AppendLine("RETURN STRING IS");
            expected.Append("  LANGUAGE DOTNET NAME 'Deveel.Data.ExtFunctions.Func1()'");

            Assert.AreEqual(expected.ToString(), sql);
        }
Example #3
0
        public static void ExternalWithNoArguments()
        {
            var statement = new CreateExternalFunctionStatement(ObjectName.Parse("SYS.ext_func2"), PrimitiveTypes.String(), "Deveel.Data.ExtFunctions.Func1()");

            var sql      = statement.ToString();
            var expected = new StringBuilder();

            expected.Append("CREATE EXTERNAL FUNCTION SYS.ext_func2() ");
            expected.AppendLine("RETURN STRING IS");
            expected.Append("  LANGUAGE DOTNET NAME 'Deveel.Data.ExtFunctions.Func1()'");

            Assert.AreEqual(expected.ToString(), sql);
        }
Example #4
0
 protected virtual SqlStatement VisitCreateExternFunction(CreateExternalFunctionStatement statement)
 {
     return new CreateExternalFunctionStatement(statement.FunctionName, statement.ReturnType, statement.Parameters,
         statement.ExternalReference) {
             ReplaceIfExists = statement.ReplaceIfExists
         };
 }