module SchemaPlus::Functions::Middleware::Dumper::Tables

Public Instance Methods

after(env) click to toggle source

Dump

# File lib/schema_plus/functions/middleware.rb, line 8
        def after(env)
          env.connection.functions.each do |(function_name, params, _options)|
            full_params, definition, function_type = env.connection.function_definition(function_name, params)
            heredelim                              = "END_FUNCTION_#{function_name.upcase}"
            extra_options                          = ", function_type: :#{function_type}" if function_type.present?
            statement                              = <<~ENDFUNCTION
                create_function "#{function_name}", "#{full_params}", <<-'#{heredelim}', :force => true#{extra_options}
              #{definition}
                #{heredelim}
            ENDFUNCTION

            env.dump.final << statement
          end
        end