module PGTrunk::Statements

@private The module adds commands to execute DDL operations in PostgreSQL.

Public Class Methods

register(klass) click to toggle source

@param [PGTrunk::Operation] klass

# File lib/pg_trunk/core/railtie/statements.rb, line 8
def self.register(klass)
  define_method(klass.ruby_name) do |*args, &block|
    operation = klass.from_ruby(*args, &block)
    operation.validate!
    PGTrunk.database.execute_operation(operation)
  end
end

Public Instance Methods

skip_inversion(*) click to toggle source

A command does nothing when a unidirectional command is inverted (for example, when a foreign key validation is inverted). This case is different from those when an inversion cannot be made.

# File lib/pg_trunk/core/railtie/statements.rb, line 19
def skip_inversion(*); end