Sha256: eb230ede080ad3633e03fd3385cf5b4eb96e4f2b982523420a6f0b3835f1571b

Contents?: true

Size: 571 Bytes

Versions: 25

Compression:

Stored size: 571 Bytes

Contents

require 'rom/sql/commands/error_wrapper'
require 'rom/sql/commands/transaction'

module ROM
  module SQL
    module Commands
      # SQL delete command
      #
      # @api public
      class Delete < ROM::Commands::Delete
        adapter :sql

        include Transaction
        include ErrorWrapper

        # Deletes tuples from a relation
        #
        # @return [Array<Hash>] deleted tuples
        #
        # @api public
        def execute
          deleted = relation.to_a
          relation.delete
          deleted
        end
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
rom-sql-1.3.5 lib/rom/sql/commands/delete.rb
rom-sql-1.3.4 lib/rom/sql/commands/delete.rb
rom-sql-2.0.0.beta1 lib/rom/sql/commands/delete.rb
rom-sql-1.3.3 lib/rom/sql/commands/delete.rb
rom-sql-1.3.2 lib/rom/sql/commands/delete.rb
rom-sql-1.3.1 lib/rom/sql/commands/delete.rb
rom-sql-1.3.0 lib/rom/sql/commands/delete.rb
rom-sql-1.2.2 lib/rom/sql/commands/delete.rb
rom-sql-1.2.1 lib/rom/sql/commands/delete.rb
rom-sql-1.2.0 lib/rom/sql/commands/delete.rb
rom-sql-1.1.2 lib/rom/sql/commands/delete.rb
rom-sql-1.1.1 lib/rom/sql/commands/delete.rb
rom-sql-1.1.0 lib/rom/sql/commands/delete.rb
rom-sql-1.0.3 lib/rom/sql/commands/delete.rb
rom-sql-1.0.2 lib/rom/sql/commands/delete.rb
rom-sql-1.0.1 lib/rom/sql/commands/delete.rb
rom-sql-1.0.0 lib/rom/sql/commands/delete.rb
rom-sql-1.0.0.rc2 lib/rom/sql/commands/delete.rb
rom-sql-1.0.0.rc1 lib/rom/sql/commands/delete.rb
rom-sql-1.0.0.beta3 lib/rom/sql/commands/delete.rb