Class Sequel::Postgres::PGRow::ArrayRow
In: lib/sequel/extensions/pg_row.rb
Parent: DelegateClass(Array)

Class for row-valued/composite types that are treated as arrays. By default, this is only used for generic PostgreSQL record types, as registered types use HashRow by default.

Methods

External Aliases

new -> call
  Alias new to call, so that the class itself can be used directly as a converter.

Attributes

db_type  [RW]  The database type for this class. May be nil if this class done not have a specific database type.
db_type  [W]  Sets the database type associated with this instance. This is used to override the class‘s default database type.

Public Class methods

Create a subclass associated with a specific database type. This is done so that instances of this subclass are automatically casted to the database type when literalizing.

[Source]

     # File lib/sequel/extensions/pg_row.rb, line 97
 97:         def self.subclass(db_type)
 98:           sc = Class.new(self) do
 99:             @db_type = db_type
100:           end
101:         end

Public Instance methods

Return the instance‘s database type, or the class‘s database type if the instance has not overridden it.

[Source]

     # File lib/sequel/extensions/pg_row.rb, line 109
109:         def db_type
110:           @db_type || self.class.db_type
111:         end

Append SQL fragment related to this object to the sql.

[Source]

     # File lib/sequel/extensions/pg_row.rb, line 114
114:         def sql_literal_append(ds, sql)
115:           sql << ROW
116:           ds.literal_append(sql, to_a)
117:           if db_type
118:             sql << CAST
119:             ds.quote_schema_table_append(sql, db_type)
120:           end
121:         end

[Validate]