class PostgresUpsert::Result

Attributes

inserted[R]
updated[R]

Public Class Methods

new(insert_result, update_result, copy_result) click to toggle source
# File lib/postgres_upsert/result.rb, line 5
def initialize(insert_result, update_result, copy_result)
  @inserted = insert_result ? insert_result.cmd_tuples : 0
  @updated = update_result ? update_result.cmd_tuples : 0 
  @copied = copy_result ? copy_result.cmd_tuples : 0
end

Public Instance Methods

changed_rows() click to toggle source
# File lib/postgres_upsert/result.rb, line 11
def changed_rows
  @inserted + @updated
end
copied_rows() click to toggle source
# File lib/postgres_upsert/result.rb, line 15
def copied_rows
  @copied
end
updated_rows() click to toggle source
# File lib/postgres_upsert/result.rb, line 19
def updated_rows
  @updated
end