On Tue, Mar 22, 2016 at 12:36 AM, James K. Lowden <jklowden at schemamania.org>
wrote:

> Roger's APSW is SQLIte specific.  It's pretty easy to imagine, isn't
> it, that
>
>         char sql[] = "select [col] from [foo]";
>
> is easier for him to use than
>
>         char sql[] = "select \"col\" from \"foo\"";
>
> even if he's not using C?
>

Then I'd advise https://www.sqlite.org/c3ref/mprintf.html and %q or %Q :)


> I would certainly advise (and often do) anyone using SQL to learn to
> distinguish between standard SQL and any given product's deviations
> from it.  Favoring standard constructs helps avoid weird corners and style.
>

Exactly the reason I wanted to emphasize it's non-standard, and not good
general advice IMHO.


> But machine-generated code inside a driver specifically for SQLite?
> Hard to see who benefits, one way or the other.


To each his own of course. But just like one shouldn't use double-quotes
for string literal,
despite's SQLite support for them, one shouldn't use (IMHO) square-brackets
for idents. --DD

Reply via email to