views:

2576

answers:

11

I'd like to find a good object oriented C++ (as opposed to C) wrapper for sqlite. What do people recommend? If you have several suggestions please put them in separate replies for voting purposes. Also, please indicate whether you have any experience of the wrapper you are suggesting and how you found it to use.

+1  A: 

I've used this one http://www.codeproject.com/KB/database/CppSQLite.aspx but I've moved to C#, so their may be newer/better ones now

Brad Bruce
+3  A: 

This library is brilliant.

http://www.sqlapi.com/

There are Windows and Linux versions of the library available and I was up and running in minutes.

Rob
I'm curious what's so brilliant about it?
Chris Kaminski
+8  A: 

Another good wraper for databases in C++ is SOCI. It's not very OO, but the more Modern C++.

It supports Oracle, PostgreSQL and MySQL. A SQLite backend is in the CVS.

jk
A: 

YEap ! I'm also a fun of SOCI... it is very flexible....I recommend it !

Eddie
A: 

http://www.codeproject.com/KB/database/CppSQLite.aspx is just fantastic, it is very easy to port, I had it working on bcb5 (omg) in half an hour or so. It is about as thin as you can get and easy to understand. There are a goodly number of examples that cover just about every thing you need to know. It uses exceptions for error handling - I modified it to provide return codes in a mater of minutes. Only tricky issue is to create your own lib file none are provided.

try {

CppSQLite3DB db;

db.open(asFileName.c_str());

db.execDML("Update data set hrx = 0");

} // try

catch (...) {

} // catch

Could not be much simpler than this.....

A: 

no ports for mingw, but it was so straight forward, make a lib file from the dll, compile code... done - no changes required.

A: 

Perhaps you can take a look at

http://pocoproject.org

or

Platinum C++ Framework

SebastianK
+1  A: 

Use Qt - it has great binding for SQLite that fits well into its overall design

zaharpopov
A: 

I wasn't pleased with any I could find either, so I wrote my own: sqlite3cc.

edam
A: 

This is really inviting down-votes, but here goes...

I use sqlite directly from C++, and don't see any value with an added C++ abstraction layer. It's quite good (and efficient) as is.

kotlinski