-
Notifications
You must be signed in to change notification settings - Fork 0
MySQL
arosequist edited this page Dec 31, 2013
·
2 revisions
There are two namespaces for MySQL statements:
- com.arosequist.patois.mysql.schema contains schema definitions for the MySQL structures
- com.arosequist.patois.mysql.compile contains functions for generating SQL strings out of those data structures
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 totrue. -
:quote-identifiersis 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-parensis 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.