Sha256: 5c2c113c123bc1bedbeac98ca1ff2de789be481abf7c23ed6c7185e7a7b0451d

Contents?: true

Size: 504 Bytes

Versions: 13

Compression:

Stored size: 504 Bytes

Contents

require 'rom/sql/commands/error_wrapper'

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

        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

13 entries across 13 versions & 1 rubygems

Version Path
rom-sql-3.1.0 lib/rom/sql/commands/delete.rb
rom-sql-3.0.1 lib/rom/sql/commands/delete.rb
rom-sql-3.0.0 lib/rom/sql/commands/delete.rb
rom-sql-2.5.0 lib/rom/sql/commands/delete.rb
rom-sql-2.4.0 lib/rom/sql/commands/delete.rb
rom-sql-2.3.0 lib/rom/sql/commands/delete.rb
rom-sql-2.2.1 lib/rom/sql/commands/delete.rb
rom-sql-2.2.0 lib/rom/sql/commands/delete.rb
rom-sql-2.1.0 lib/rom/sql/commands/delete.rb
rom-sql-2.0.0 lib/rom/sql/commands/delete.rb
rom-sql-2.0.0.rc1 lib/rom/sql/commands/delete.rb
rom-sql-2.0.0.beta3 lib/rom/sql/commands/delete.rb
rom-sql-2.0.0.beta2 lib/rom/sql/commands/delete.rb