|
Boost : |
Subject: Re: [boost] Boost.SQL?
From: Roland Bock (rbock_at_[hidden])
Date: 2010-09-14 11:17:53
On 09/14/2010 04:36 PM, Torri, Stephen CIV NSWCDD, W15 wrote:
> I am interested in a SQL library. Making the sql statements should be pretty straight forward. How do you plan on
Making SQL statements is pretty straight forward, if you do something like
string query = string("select * from my_table where id>1000 and
first_name='") + name + "'";
But this construction is prone to errors, and the interpretation of the
results as well. How can you determine, if the first item in a
result_set is in fact the first_name that you expected?
Therefore, the building of SQL statements is what I am concentrating on.
Also as was pointed out by Dominique (and in earlier discussions on this
list), various vendors support various dialects of SQL. This could turn
the generation of queries into a major headache ;-)
> dealing with communicating with the SQL server? I have used two methods before. First is how a web server does it by sending SQL commands to a IP address / hostname for the database server. Second is using the database server's API and linking against a library. Obviously the first is more portable.
>
>
I am not sure about this yet. As of now, the project is not much more
than a prototype (although we have started to migrate code already).
Currently I am using libpqxx (a C++ wrapper for libpq) which connects
via TCP.
It might be a good idea to create a second library which provides a
unified communication interface for a variety of vendors and and use
that as basis for the stuff I am currently working on.
Regards,
Roland
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk