Sha256: 8bfde97343bad73553c85f87cb7068fb78df1a4018f161177b961fac91364e1b

Contents?: true

Size: 459 Bytes

Versions: 12

Compression:

Stored size: 459 Bytes

Contents

module Adhoq
  class PreviewsController < Adhoq::ApplicationController
    layout false

    def create
      begin
        query = Adhoq::Query.new(query: params[:query])
        raw_query = query.substitute_query(params[:parameters] || {})
        @result = Adhoq::Executor.new(raw_query).execute
      rescue ActiveRecord::StatementInvalid => @statement_invalid
        render 'statement_invalid', status: :unprocessable_entity
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
adhoq-1.0.2 app/controllers/adhoq/previews_controller.rb
adhoq-1.0.1 app/controllers/adhoq/previews_controller.rb
adhoq-1.0.0 app/controllers/adhoq/previews_controller.rb
adhoq-0.5.0 app/controllers/adhoq/previews_controller.rb
adhoq-0.5.0.beta1 app/controllers/adhoq/previews_controller.rb
adhoq-0.4.0 app/controllers/adhoq/previews_controller.rb
adhoq-0.3.0 app/controllers/adhoq/previews_controller.rb
adhoq-0.2.0 app/controllers/adhoq/previews_controller.rb
adhoq-0.1.2 app/controllers/adhoq/previews_controller.rb
adhoq-0.1.1 app/controllers/adhoq/previews_controller.rb
adhoq-0.1.0 app/controllers/adhoq/previews_controller.rb
adhoq-0.0.7 app/controllers/adhoq/previews_controller.rb