Class: ROM::SQL::Commands::Delete

Inherits:
Commands::Delete
  • Object
show all
Includes:
ErrorWrapper, Transaction
Defined in:
lib/rom/sql/commands/delete.rb

Overview

SQL delete command

Instance Method Summary collapse

Instance Method Details

#call(*args) ⇒ Object Also known as: [] Originally defined in module ErrorWrapper

Handle Sequel errors and re-raise ROM-specific errors

#executeArray<Hash>

Deletes tuples from a relation

Returns:

  • (Array<Hash>)

    deleted tuples



21
22
23
24
25
# File 'lib/rom/sql/commands/delete.rb', line 21

def execute
  deleted = relation.to_a
  relation.delete
  deleted
end

#transaction(options = {}, &block) ⇒ ROM::Commands::Result::Success, ROM::Commands::Result::Failure Originally defined in module Transaction

Start a transaction

Parameters:

  • options (Hash) (defaults to: {})

    The options hash supported by Sequel

Returns:

  • (ROM::Commands::Result::Success, ROM::Commands::Result::Failure)