bcosca/fatfree — pull request #328 by ikkez (2013-05-07 13:41:29+00:00)
Title: more extensive sql identifier quotation

I added some more quotes around table and column identifiers, using a more suitable and reusable new function. I think this will work better again hitting preserved words and special chars in their names (even i would never ever recommend using them).

I setup the following quotations:
**MySQL**: backticks (`)
http://dev.mysql.com/doc/refman/5.0/en/identifier-qualifiers.html

**SQlite**: double-quotes (") (better than backticks)
http://www.sqlite.org/lang_keywords.html

**PostgreSQL**: double-quotes (")
http://www.postgresql.org/docs/8.2/static/sql-syntax-lexical.html

**MS SQL, SQL Server**: brackets ( [ ] )
http://stackoverflow.com/questions/695578/creating-table-names-that-are-reserved-words-keywords-in-ms-sql-server

**Oracle**: (if we add this someday) double-quotes (") and uppercase
http://stackoverflow.com/questions/563090/oracle-what-exactly-do-quotation-marks-around-the-table-name-do

**TransactSQL**: for the rest like sybase,dblib,odbc: single-quotes (')

I tested these changes with mysql, sqlite and postgre, using the F3 sql and my schemabuilder unit tests.