Sha256: 829a2fc6b98701607040a06987a2e2d451b8e995172a58b807d6b4dfc160d06e

Contents?: true

Size: 792 Bytes

Versions: 2

Compression:

Stored size: 792 Bytes

Contents

require 'upsert/merge_function/postgresql'

class Upsert
  class MergeFunction
    # @private
    class Java_OrgPostgresqlJdbc4_Jdbc4Connection < MergeFunction
      ERROR_CLASS = org.postgresql.util.PSQLException
      include Postgresql

      def execute_parameterized(query, args = [])
        query_args = []
        query = query.gsub(/\$(\d+)/) do |str|
          query_args << args[Regexp.last_match[1].to_i - 1]
          "?"
        end
        controller.connection.execute(query, query_args)
      end

      def unique_index_on_selector?
        return @unique_index_on_selector if defined?(@unique_index_on_selector)
        @unique_index_on_selector = schema_query.any? do |row|
          row["index_columns"].sort == selector_keys.sort
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
upsert-2.2.1 lib/upsert/merge_function/Java_OrgPostgresqlJdbc4_Jdbc4Connection.rb
upsert-2.2.0 lib/upsert/merge_function/Java_OrgPostgresqlJdbc4_Jdbc4Connection.rb