开发者

C++ Libraries for abstracting calls against MSSQLS2008 and SQLite?

What are some good options for rendering transparent the small but meanin开发者_如何学JAVAgful differences in parsing and syntax between these two databases? Ideally, I'd like a mature and established library. In generally, in C++, what are some solidly abstracted libraries for high-level data access that don't sacrifice performance?

Optional but super-nice:

The ability to specify a schema for interacting with a set of flat files to be treated as records.


SOCI is a good library for this, it supports SQLite3 and also MSSQL through ODBC. It also has backends for PostgreSQL, MySQL and Oracle if you need to use any of those later on.

Using it results in idiomatic stream code, as shown in their documentation:

int id = ...;
string name;
int salary;

sql << "select name, salary from persons where id = " << id,
       into(name), into(salary);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜