|
Boost : |
Subject: Re: [boost] sqlpp11: SQL for C++
From: Tim Keitt (tkeitt_at_[hidden])
Date: 2013-11-14 15:25:12
On Tue, Nov 12, 2013 at 7:16 AM, Roland Bock <rbock_at_[hidden]> wrote:
> On 2013-11-12 04:26, Tim Keitt wrote:
> > On Sat, Nov 9, 2013 at 4:03 PM, Roland Bock <rbock_at_[hidden]> wrote:
> >
> [snip]
> >>
> >>
> > This is an interesting thread and I thought I'd comment.
> >
> > I am a pretty heavy user of postgresql/postgis (spatial extension) in my
> > work. I wrote the first R package to access postgresql and contributed to
> > the current R DBI package. I did a proof-of-concept (= not very pretty
> ;-)
> > embedding of the Boost Graph Library in postgresql replacing local
> storage
> > with prepared queries called on demand.
> >
> > I have to say when I look at this, I don't really want to learn another
> > SQL. I am perfectly happy to send query strings to the database and let
> it
> > parse them. I can debug these separate from my C++ code. I think for
> > complex queries (recursive with anyone?) it would be quite difficult to
> get
> > the C++ right.
> Could you send me a complex/recursive example? I'd be interested in a
> comparison, of course.
>
Example here
http://jakub.fedyczak.net/post/postgresql-with-recursive-tree-traversing-example/
>
> The debugging topic is interesting. Obviously, sqlpp11 can be used to
> print query strings. The current connectors do that, when used in debug
> mode.
>
> Personally, I believe that the way that sqlpp11 yields results (members
> of a struct instead of positional entries in a container) and the
> compiler support in constructing and maintaining queries outweigh having
> the exact textual representation of the query in the source code. But
> that is certainly a matter of taste.
>
> >
> > What I would really like is a mapping of binary cursors to iterator
> > concepts + easy type-safe endian-aware customizable data conversion. But
> > that's my bias. I've always liked mapping on-demand data to common
> > interfaces.
> I'll have to read up on binary cursors, that is not my core competence...
>
Cursors are not difficult: DECLARE the_cursor CURSOR FOR SELECT ...
Lets you iterate through the results. Binary cursors return the binary
representation as used in the server, which may be different from the
client.
THK
> >
> > But your use cases are probably different and I can see how this would be
> > very useful to some.
>
> Thanks and regards,
>
> Roland
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>
-- http://www.keittlab.org/
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk