SOCI - The C++ Database Access Library

SOCI is a database access libraryfor C++ that makes the illusion of embeddingSQL queries in the regularC++ code, staying entirely within the Standard C++.

The idea is to provide C++ programmers a way to access SQLdatabases in the most natural and intuitive way. If you find existinglibraries too difficult for your needs or just distracting, SOCI can bea good alternative.

The simplest motivating code example for the SQL query that is supposedto retrieve a single row is:

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

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

and the following benefits from extensive support for object-relationalmapping:

int id = ...;
Person p;

sql << "select first_name, last_name, date_of_birth "
       "from persons where id = " << id,
       into(p);

Integration with STL is also supported:

Rowset<string> rs = (sql.prepare << "select name from persons");
copy(rs.begin(), rs.end(), ostream_iterator<string>(cout, "\n"));

SOCI offers also extensive integration with Boost datatypes (optional, tuple and fusion) and flexible supportfor user-defined datatypes.

Even though SOCI is mainly a C++ library, it also allows to use it from other programming languages. Currently the package contains the Ada binding, with more bindings likely to come in the future.

Starting from its 2.0.0 release, SOCI uses the plug-in architecture forbackends - this allows to target various database servers. Currently (3.1.0),the following database servers are supported:

  • MySQL
  • ODBC (generic backend)
  • Oracle
  • PostgreSQL
  • SQLite3

The intent of the library is to cover as many database technologies aspossible. For this, the project has to rely on volunteer contributionsfrom other programmers, who have expertise with the existing databaseinterfaces and would like to help writing dedicated backends.
If you are interested in participating, please contact the project admin.

The SOCI library is distributed under the terms of the BoostSoftware License.

The current stable release (3.1.0) can be downloaded here, and all previous releases are available here.

The latest and experimental version of the code is always available fromthe Git repository.

Anonymous clone of this repository can be obtained with:

$ git clone git://soci.git.sourceforge.net/gitroot/soci/soci

To meet other users, please consider subscribing to the SOCImailing list.


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值