Module | Sequel::Plugins::PgRow::DatabaseMethods
In: | lib/sequel/plugins/pg_row.rb

### Methods

bound_variable_arg row_type

### Constants

ESCAPE_RE | = | /("|\\)/.freeze
ESCAPE_REPLACEMENT | = | '\\\\\1'.freeze
COMMA | = | ','

### Public Instance methods

bound_variable_arg(arg, conn)

Handle Sequel::Model instances in bound variables.

[Source]

        # File lib/sequel/plugins/pg_row.rb, line 68
    68:         def bound_variable_arg(arg, conn)
    69:           case arg
    70:           when Sequel::Model
    71:             "(#{arg.values.values_at(*arg.columns).map{|v| bound_variable_array(v)}.join(COMMA)})"
    72:           else
    73:             super
    74:           end
    75:         end

row_type(db_type, v)

If a Sequel::Model instance is given, return it as-is instead of attempting to convert it.

[Source]

        # File lib/sequel/plugins/pg_row.rb, line 79
    79:         def row_type(db_type, v)
    80:           if v.is_a?(Sequel::Model)
    81:             v
    82:           else
    83:             super
    84:           end
    85:         end

[Validate]