Sha256: cd1f6db6c0ea40c078b465f47d00b827796f374b7a5b4f9862218e1b4a25ca30

Contents?: true

Size: 535 Bytes

Versions: 12

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

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

12 entries across 12 versions & 1 rubygems

Version Path
rom-sql-3.6.4 lib/rom/sql/commands/delete.rb
rom-sql-3.6.3 lib/rom/sql/commands/delete.rb
rom-sql-3.6.2 lib/rom/sql/commands/delete.rb
rom-sql-3.6.1 lib/rom/sql/commands/delete.rb
rom-sql-3.6.0 lib/rom/sql/commands/delete.rb
rom-sql-3.5.0 lib/rom/sql/commands/delete.rb
rom-sql-3.4.0 lib/rom/sql/commands/delete.rb
rom-sql-3.3.3 lib/rom/sql/commands/delete.rb
rom-sql-3.3.2 lib/rom/sql/commands/delete.rb
rom-sql-3.3.1 lib/rom/sql/commands/delete.rb
rom-sql-3.3.0 lib/rom/sql/commands/delete.rb
rom-sql-3.2.0 lib/rom/sql/commands/delete.rb