Sha256: 427347934ec88733b4b162c88a445db5420eb5eecf1be4201ba2c14338b1d75e

Contents?: true

Size: 1.15 KB

Versions: 3

Compression:

Stored size: 1.15 KB

Contents

# frozen_string_literal: true

module ActiveRecord
  module ConnectionAdapters
    module OracleEnhanced
      module JDBCQuoting
        def type_cast(value)
          case value
          when ActiveModel::Type::Binary::Data
            blob = Java::OracleSql::BLOB.createTemporary(@raw_connection.raw_connection, false, Java::OracleSql::BLOB::DURATION_SESSION)
            blob.setBytes(1, value.to_s.to_java_bytes)
            blob
          when Type::OracleEnhanced::Text::Data
            clob = Java::OracleSql::CLOB.createTemporary(@raw_connection.raw_connection, false, Java::OracleSql::CLOB::DURATION_SESSION)
            clob.setString(1, value.to_s)
            clob
          when Type::OracleEnhanced::NationalCharacterText::Data
            clob = Java::OracleSql::NCLOB.createTemporary(@raw_connection.raw_connection, false, Java::OracleSql::NCLOB::DURATION_SESSION)
            clob.setString(1, value.to_s)
            clob
          else
            super
          end
        end
      end
    end
  end
end

module ActiveRecord
  module ConnectionAdapters
    module OracleEnhanced
      module Quoting
        prepend JDBCQuoting
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
activerecord-oracle_enhanced-adapter-7.1.0 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-7.1.0.beta2 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb
activerecord-oracle_enhanced-adapter-7.1.0.beta1 lib/active_record/connection_adapters/oracle_enhanced/jdbc_quoting.rb