Sha256: c0eb3bc9bcca39eb7451dfda38be65fb6cc9763c13545dbcff1194fafc5fd772

Contents?: true

Size: 650 Bytes

Versions: 8

Compression:

Stored size: 650 Bytes

Contents

require 'rom/sql/commands/create'
require 'rom/sql/commands/update'

module ROM
  module SQL
    module Commands
      module Postgres
        module Create
          def insert(tuples)
            tuples.map do |tuple|
              relation.dataset.returning(*relation.columns).insert(tuple)
            end.flatten
          end

          def multi_insert(tuples)
            relation.dataset.returning(*relation.columns).multi_insert(tuples)
          end
        end

        module Update
          def update(tuple)
            relation.dataset.returning(*relation.columns).update(tuple)
          end
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
rom-sql-0.7.0 lib/rom/sql/commands_ext/postgres.rb
rom-sql-0.7.0.rc1 lib/rom/sql/commands_ext/postgres.rb
rom-sql-0.7.0.beta1 lib/rom/sql/commands_ext/postgres.rb
rom-sql-0.6.1 lib/rom/sql/commands_ext/postgres.rb
rom-sql-0.6.0 lib/rom/sql/commands_ext/postgres.rb
rom-sql-0.6.0.rc1 lib/rom/sql/commands_ext/postgres.rb
rom-sql-0.6.0.beta1 lib/rom/sql/commands_ext/postgres.rb
rom-sql-0.5.3 lib/rom/sql/commands_ext/postgres.rb