Class: PgPartitions::SQL::Partition

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#checkObject

Returns the value of attribute check

Returns:

  • (Object)

    the current value of check



3
4
5
# File 'lib/pg_partitions/sql.rb', line 3

def check
  @check
end

#tableObject

Returns the value of attribute table

Returns:

  • (Object)

    the current value of table



3
4
5
# File 'lib/pg_partitions/sql.rb', line 3

def table
  @table
end

Instance Method Details

#to_sqlObject



4
5
6
# File 'lib/pg_partitions/sql.rb', line 4

def to_sql
  "(LIKE #{table} INCLUDING ALL, CHECK (#{check})) INHERITS (#{table})"
end