Class: Adhoq::ExplainsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/adhoq/explains_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

before_action

Instance Method Details

#createObject



5
6
7
8
9
10
11
# File 'app/controllers/adhoq/explains_controller.rb', line 5

def create
  begin
    @result = Adhoq::Executor.new(params[:query]).explain
  rescue ActiveRecord::StatementInvalid => @statement_invalid
    render 'statement_invalid', status: :unprocessable_entity
  end
end