module ROM::SQL::Postgres::Commands::Create
Public Instance Methods
insert(tuples)
click to toggle source
Executes insert statement and returns inserted tuples
@api private
# File lib/rom/sql/extensions/postgres/commands.rb, line 30 def insert(tuples) dataset = tuples.flat_map do |tuple| returning_dataset.insert(tuple) end wrap_dataset(dataset) end
multi_insert(tuples)
click to toggle source
Executes multi_insert
statement and returns inserted tuples
@api private
# File lib/rom/sql/extensions/postgres/commands.rb, line 41 def multi_insert(tuples) returning_dataset.multi_insert(tuples) end
upsert(tuple, opts = EMPTY_HASH)
click to toggle source
Executes upsert statement (INSERT with ON CONFLICT clause) and returns inserted/updated tuples
@api private
# File lib/rom/sql/extensions/postgres/commands.rb, line 49 def upsert(tuple, opts = EMPTY_HASH) returning_dataset.insert_conflict(opts).insert(tuple) end