From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-12-06 14:52:29
Beman Dawes wrote:
> Nicola Musatti wrote:
>>> In other words, in order to do this:
>>> Session sql(oracle, "some params");
>>> you need to #include "soci.h" (for Session and other independent
>>> stuff) and "soci-oracle.h" (so that you see oracle as the name of
>>> the singleton factory).
>> As I said I think that even this can and should be done away with.
> I'm also concerned, although I want to understand more before
> absolutely saying that the approach should be changed.
I haven't followed the thread in detail, so apologies if this was already
covered, but FWIW, when I had to design a db layer, I used
Connection conn = createConnection( "mysql://user:password_at_host/database" );
The advantage of this approach is that the URL-like thing can come from a
configuration file, so you don't need to recompile to change the backend. In
a typical scenario, createConnection would need to look for
backend_mysql.dll/.so unless the support for the 'mysql' backend has been
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk