Method: Sequel::Postgres::Database#bound_variable_arg

Defined in:
lib/sequel/adapters/postgres.rb

#bound_variable_arg(arg, conn) ⇒ Object

Convert given argument so that it can be used directly by pg. Currently, pg doesn’t handle fractional seconds in Time/DateTime or blobs with “0”. Only public for use by the adapter, shouldn’t be used by external code.


184
185
186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/sequel/adapters/postgres.rb', line 184

def bound_variable_arg(arg, conn)
  case arg
  when Sequel::SQL::Blob
    {:value=>arg, :type=>17, :format=>1}
  # :nocov:
  # Not covered by tests as tests use pg_extended_date_support
  # extension, which has basically the same code.
  when Time, DateTime
    @default_dataset.literal_date_or_time(arg)
  # :nocov:
  else
    arg
  end
end