Sha256: 68709ac9868cf2b1f238b7e107386aa92a52fdf43292055720e75067b5685ec2

Contents?: true

Size: 450 Bytes

Versions: 13

Compression:

Stored size: 450 Bytes

Contents

module Adhoq
  class Executor
    autoload 'ConnectionWrapper', 'adhoq/executor/connection_wrapper'

    def initialize(query)
      @connection = ConnectionWrapper.new
      @query = query
    end

    def execute
      wrap_result(@connection.select(@query))
    end

    def explain
      @connection.explain(@query)
    end

    private

    def wrap_result(ar_result)
      Adhoq::Result.new(ar_result.columns, ar_result.rows)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
adhoq-1.0.2 lib/adhoq/executor.rb
adhoq-1.0.1 lib/adhoq/executor.rb
adhoq-1.0.0 lib/adhoq/executor.rb
adhoq-0.5.0 lib/adhoq/executor.rb
adhoq-0.5.0.beta1 lib/adhoq/executor.rb
adhoq-0.4.0 lib/adhoq/executor.rb
adhoq-0.3.0 lib/adhoq/executor.rb
adhoq-0.2.0 lib/adhoq/executor.rb
adhoq-0.1.2 lib/adhoq/executor.rb
adhoq-0.1.1 lib/adhoq/executor.rb
adhoq-0.1.0 lib/adhoq/executor.rb
adhoq-0.0.7 lib/adhoq/executor.rb
adhoq-0.0.6 lib/adhoq/executor.rb