tgriesser/knex — pull request #473 by vschoettke (2014-09-10 20:06:26+00:00)
Title: Added option to enable or disable quoting (quote)

Added an option per client and per query to disable/enable quoting (`.quote(false/true)`) of non-reserved lowercase names (only a-z 0-9 and underscore) for table names, aliases and column names. Names may not start with a number. If quote(false) and the name does not match the criteria then it's automatically quoted.

In case of the oracle dialect this also adds automatic conversion of all uppercase result-column-names to lowercase because oracle converts case insensitive names to uppercase.

To allow the possibility to turn quotes on/off per query I had to remove the memoization in the Formatter. And pass the *Builder to the Formatter. Currently the formatter is reused for subqueries (because of the bindings) therefore changing the quote option in a subquery does not work correctly.

@tgriesser This is only beneficial if someone always wants to use lowercase for names and wants oracle compatibility. However there's really no need for this if all uppercase names are used instead.