Files

Class/Module Index [+]

Quicksearch

ArJdbc::HSQLDB::ExplainSupport

Public Instance Methods

explain(arel, binds = []) click to toggle source
# File lib/arjdbc/hsqldb/explain_support.rb, line 6
def explain(arel, binds = [])
  sql = "EXPLAIN PLAN FOR #{to_sql(arel, binds)}"
  raw_result = exec_query_raw(sql, "EXPLAIN", binds)
  # HSQLDB's SqlTool just prints it as it comes :
  #
  #  sql> EXPLAIN PLAN FOR SELECT * FROM entries JOIN users on ... ;
  #
  # isDistinctSelect=[false]
  # isGrouped=[false]
  # isAggregated=[false]
  # columns=[  COLUMN: PUBLIC.ENTRIES.ID
  #  not nullable  COLUMN: PUBLIC.ENTRIES.TITLE
  #  nullable  COLUMN: PUBLIC.ENTRIES.UPDATED_ON
  #  nullable  COLUMN: PUBLIC.ENTRIES.CONTENT
  #  nullable  COLUMN: PUBLIC.ENTRIES.RATING
  #  nullable  COLUMN: PUBLIC.ENTRIES.USER_ID
  #  nullable  COLUMN: PUBLIC.USERS.ID
  #  not nullable  COLUMN: PUBLIC.USERS.LOGIN
  #  nullable
  # ]
  # ...
  # PARAMETERS=[]
  # SUBQUERIES[]
  #
  raw_result.map!(&:values)
  raw_result.join("\n")
end
supports_explain?() click to toggle source
# File lib/arjdbc/hsqldb/explain_support.rb, line 4
def supports_explain?; true; end

[Validate]

Generated with the Darkfish Rdoc Generator 2.