lib/adhoq/executor.rb in adhoq-0.0.3 vs lib/adhoq/executor.rb in adhoq-0.0.4
- old
+ new
@@ -5,10 +5,16 @@
with_sandbox do
current_connection.exec_query(query)
end
end
+ def explain(query)
+ with_sandbox do
+ current_connection.explain(query)
+ end
+ end
+
def current_connection
ActiveRecord::Base.connection
end
def with_sandbox
@@ -25,9 +31,13 @@
@query = query
end
def execute
wrap_result(self.class.select(@query))
+ end
+
+ def explain
+ self.class.explain(@query)
end
private
def wrap_result(ar_result)