# File lib/sequel/adapters/jdbc/db2.rb, line 39 def DB2Clob(r, i) if v = r.getClob(i) v = v.getSubString(1, v.length) v = Sequel::SQL::Blob.new(v) if ::Sequel::DB2::use_clob_as_blob v end end
# File lib/sequel/adapters/jdbc/sqlserver.rb, line 18 def MSSQLRubyTime(r, i) # MSSQL-Server TIME should be fetched as string to keep the precision intact, see: # https://docs.microsoft.com/en-us/sql/t-sql/data-types/time-transact-sql#a-namebackwardcompatibilityfordownlevelclientsa-backward-compatibility-for-down-level-clients if v = r.getString(i) Sequel.string_to_time("#{v}") end end
# File lib/sequel/adapters/jdbc/oracle.rb, line 20 def OracleDecimal(r, i) if v = r.getBigDecimal(i) i = v.long_value if v == JAVA_BIG_DECIMAL_CONSTRUCTOR.call(i) i else BigDecimal.new(v.to_string) end end end
# File lib/sequel/adapters/jdbc.rb, line 85 def RubyBigDecimal(r, i) if v = r.getBigDecimal(i) BigDecimal.new(v.to_string) end end
# File lib/sequel/adapters/jdbc.rb, line 90 def RubyBlob(r, i) if v = r.getBytes(i) Sequel::SQL::Blob.new(String.from_java_bytes(v)) end end
# File lib/sequel/adapters/jdbc.rb, line 95 def RubyClob(r, i) if v = r.getClob(i) v.getSubString(1, v.length) end end
# File lib/sequel/adapters/jdbc.rb, line 75 def RubyDate(r, i) if v = r.getDate(i) Date.civil(v.getYear + 1900, v.getMonth + 1, v.getDate) end end
Return PostgreSQL array types as ruby Arrays instead of JDBC PostgreSQL driver-specific array type. Only used if the database does not have a conversion proc for the type.
# File lib/sequel/adapters/jdbc/postgresql.rb, line 22 def RubyPGArray(r, i) if v = r.getArray(i) v.array.to_ary end end
Return PostgreSQL hstore types as ruby Hashes instead of Java HashMaps. Only used if the database does not have a conversion proc for the type.
# File lib/sequel/adapters/jdbc/postgresql.rb, line 31 def RubyPGHstore(r, i) if v = r.getObject(i) v.to_hash end end
# File lib/sequel/adapters/jdbc.rb, line 70 def RubyTime(r, i) if v = r.getTime(i) Sequel.string_to_time("#{v.to_string}.#{sprintf('%03i', v.getTime.divmod(1000).last)}") end end
# File lib/sequel/adapters/jdbc.rb, line 80 def RubyTimestamp(r, i) if v = r.getTimestamp(i) Sequel.database_to_application_timestamp([v.getYear + 1900, v.getMonth + 1, v.getDate, v.getHours, v.getMinutes, v.getSeconds, v.getNanos]) end end
# File lib/sequel/adapters/jdbc/sqlanywhere.rb, line 32 def SqlAnywhereBoolean(r, i) if v = Short(r, i) v != 0 end end