Skip to content
arosequist edited this page Dec 31, 2013 · 2 revisions

There are two namespaces for MySQL statements:

compile-select-statement is the function that should be used to translate a select statement data structure into a string. You can provide a map to specify compilation options, including:

  • :validate? is a boolean to indicate whether or not the statement should be validated against the schema when compiled. It defaults to true.
  • :quote-identifiers is either :when-needed (the default) or :always. If this is :always, all schema, table, and column names will be surrounded with `s. If this is :when-needed, this will only be done when the name is a reserved word.
  • :wrap-selects-in-parens is either :when-needed (the default) or :always. This determines when the selects should be surrounded by parentheses, and should only matter when doing certain operations within a statement that uses unions.

Clone this wiki locally