I am searching for a library which will simplify dealing with SQL in C++. I am conscious that you will find different ORM solutions (like individuals listed here), and that i were built with a quick go over them, but I am most likely searching for different things (not quite ORM), if you may help...

I would like something which will not encapsulate accessibility database etc, and can act a lot more like request builder and binder, and that i run the demands myself. I expect this would let me simplify SQL handling and simultaneously get access to run custom queries, without always remaining inside the object model.

For now the nearest factor I have found is this Database Template Library, which enables to define binding such as this:

   boundIOs["INT_VALUE"]    == rowbuf.exampleInt;
   boundIOs["STRING_VALUE"] == rowbuf.exampleStr;

(column INT_VALUE is certain to exampleInt area from the object) after which run queries using such bindings, that we find quite convenient and versatile enough simultaneously.

I'll certainly have a closer turn to this library, but most likely you might suggest another library/framework that utilizes similar ideas, and it is popularOrolderOrbacked etc, or share your knowledge about this DTL library? Thanks.

OTL includes a prety nice interface that does not come with an ORM model.

It uses streams to createOrget bind variables. An easy example is proven below

otl_stream i(50, // buffer size
              "select * from test_tab where f1>=:f<int>" // SELECT statement,
              db // connect object
             ); 
i<<8; // assigning :f = 8

//execute query
while(!i.eof()){ // while not end-of-data
    i>>f1>>f2;
    cout<<"f1="<<f1<<", f2="<<f2<<endl;
}

You can observe more good examples here

Edit, showing how binding multiple variables is trivial

otl_stream i(50, // buffer size
              "select * from test_tab where f1>=:f<int> AND f2=:g<int> and f3=:h<int> and f4=:i<int>" // SELECT statement,
              db // connect object
             ); 
i << 8 << 10 << 12 << 42;

//execute query
while(!i.eof()){ // while not end-of-data
    i>>f1>>f2;
    cout<<"f1="<<f1<<", f2="<<f2<<endl;
}

As you can tell, you define your placeholders as well as their types once f1>=:f<int> AND f2=:g<int>. After this you stream your values in to the query (that is typesafe) before performing it.

Finally I did not find any library not attempting to hide the database access, the majority of the libraries play the role of an excessive amount of ORM-like. And So I just required the DTL bind approach and authored some text-processing assistants to construct SQL demands which i need.