module PgSaurus::ConnectionAdapters::AbstractAdapter::FunctionMethods

Adapter definitions for DB functions.

Public Instance Methods

create_function(function_name, returning, definition, options = {}) click to toggle source

Create a database function.

Example:

# Arguments are: function_name, return_type, function_definition, options (currently, only :schema)
create_function 'pets_not_empty()', :boolean, <<-FUNCTION, schema: 'public'
  BEGIN
    IF (SELECT COUNT(*) FROM pets) > 0
    THEN
    RETURN true;
    ELSE
    RETURN false;
   END IF;
    END;
  FUNCTION

The schema is optional.

# File lib/pg_saurus/connection_adapters/abstract_adapter/function_methods.rb, line 26
def create_function(function_name, returning, definition, options = {})

end
drop_function(function_name, options) click to toggle source

Delete the database function.

Example:

drop_function 'pets_not_empty()', schema: 'public'

The schema is optional.

# File lib/pg_saurus/connection_adapters/abstract_adapter/function_methods.rb, line 37
def drop_function(function_name, options)

end
functions() click to toggle source

Return the listing of currently defined DB functions.

# File lib/pg_saurus/connection_adapters/abstract_adapter/function_methods.rb, line 42
def functions

end
supports_functions?() click to toggle source

:nodoc

# File lib/pg_saurus/connection_adapters/abstract_adapter/function_methods.rb, line 5
def supports_functions?
  false
end