Class: PgPartitions::SQL::Trigger

Inherits:
Struct
  • Object
show all
Defined in:
lib/pg_partitions/sql.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eventObject

Returns the value of attribute event

Returns:

  • (Object)

    the current value of event



72
73
74
# File 'lib/pg_partitions/sql.rb', line 72

def event
  @event
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



72
73
74
# File 'lib/pg_partitions/sql.rb', line 72

def name
  @name
end

#tableObject

Returns the value of attribute table

Returns:

  • (Object)

    the current value of table



72
73
74
# File 'lib/pg_partitions/sql.rb', line 72

def table
  @table
end

Instance Method Details

#to_sqlObject



73
74
75
76
77
78
79
# File 'lib/pg_partitions/sql.rb', line 73

def to_sql
  "    CREATE TRIGGER \#{name}\n    \#{event} ON \#{table}\n    FOR EACH ROW EXECUTE PROCEDURE \#{name}();\n  SQL\nend\n"