Sha256: 3aa61b31f2cdc6c986bae6bf4b9d0b3764afd4f32eff948e9bfedee8f44e4cb1

Contents?: true

Size: 796 Bytes

Versions: 4

Compression:

Stored size: 796 Bytes

Contents

require 'upsert/merge_function/postgresql'

class Upsert
  class MergeFunction
    # @private
    class Java_OrgPostgresqlJdbc_PgConnection < 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 = unique_index_columns.any? do |row|
          row["index_columns"].sort == selector_keys.sort
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
upsert-2.9.10-java lib/upsert/merge_function/Java_OrgPostgresqlJdbc_PgConnection.rb
upsert-2.9.10 lib/upsert/merge_function/Java_OrgPostgresqlJdbc_PgConnection.rb
upsert-2.9.9-universal-java-11 lib/upsert/merge_function/Java_OrgPostgresqlJdbc_PgConnection.rb
upsert-2.9.9 lib/upsert/merge_function/Java_OrgPostgresqlJdbc_PgConnection.rb