Boost logo

Boost :

Subject: Re: [boost] sqlpp11: SQL for C++
From: Gavin Lambert (gavinl_at_[hidden])
Date: 2013-11-12 19:06:28

On 12/11/2013 19:13, Quoth Christof Donat:
> When you have SQL with its original syntax in your source code, you can
> copy/paste between your source code and your database tool. That way you can
> develop your queries iteratively. Compile time string parsing then adds
> compile time syntax checks, type safety and a intuitive interface to access
> the columns in the result set by using your library.

As long as it's easy to translate from one to the other, it shouldn't be
a big deal either way.

The most important thing in this respect for sqlpp11 would be to have an
easy way to take a chunk of code and extract the actual SQL query from
it, perhaps via inserting an extra line in the development/production
code to write it out to a log or to copy/paste it into some helper
skeleton that does something similar.

Converting back again should be fairly straightforward (albeit more
manual) as long as you've only made minor tweaks to the query while
iteratively testing it in the database tool, which is probably the
common case.

The comparative danger of using direct string parsing is that it's far
too easy to insert something that the parser can't make sense of, and
either way it's likely to increase compile times over an
object-model-based approach.

Boost list run by bdawes at, gregod at, cpdaniel at, john at