class Sequel::JDBC::Postgres::Dataset
Dataset subclass used for datasets that connect to PostgreSQL via JDBC.
Constants
- APOS
- PG_OBJECT_METHOD
Public Instance Methods
prepare(type, name=nil, *values)
click to toggle source
Add the shared PostgreSQL prepared statement methods
# File lib/sequel/adapters/jdbc/postgresql.rb, line 155 def prepare(type, name=nil, *values) ps = to_prepared_statement(type, values) ps.extend(JDBC::Dataset::PreparedStatementMethods) ps.extend(::Sequel::Postgres::DatasetMethods::PreparedStatementMethods) if name ps.prepared_statement_name = name db.set_prepared_statement(name, ps) end ps end
Private Instance Methods
convert_type_proc(v)
click to toggle source
Handle PostgreSQL array and object types. Object types are just turned into strings, similarly to how the native adapter treats the types.
Calls superclass method
Sequel::JDBC::Dataset#convert_type_proc
# File lib/sequel/adapters/jdbc/postgresql.rb, line 171 def convert_type_proc(v) case v when Java::OrgPostgresqlJdbc4::Jdbc4Array PGArrayConverter.new(method(:convert_type_proc)) when Java::OrgPostgresqlUtil::PGobject PG_OBJECT_METHOD else super end end
literal_string_append(sql, v)
click to toggle source
Literalize strings similar to the native postgres adapter
# File lib/sequel/adapters/jdbc/postgresql.rb, line 183 def literal_string_append(sql, v) sql << APOS << db.synchronize{|c| c.escape_string(v)} << APOS end