找回密码
 用户注册

QQ登录

只需一步,快速开始

查看: 7056|回复: 0

SOCI - The C++ Database Access Library

[复制链接]
发表于 2009-7-15 21:34:52 | 显示全部楼层 |阅读模式
http://soci.sourceforge.net/
SOCI is a database access library for C++ that makes the illusion of embedding SQL queries in the regular C++ code, staying entirely within the Standard C++.
The idea is to provide C++ programmers a way to access SQL databases in the most natural and intuitive way. If you find existing libraries too difficult for your needs or just distracting, SOCI can be a good alternative.
The simplest motivating code example for the SQL query that is supposed to 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-relational mapping:
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 support for user-defined datatypes.
Starting from its 2.0.0 release, SOCI uses the plug-in architecture for backends - this allows to target various database servers. Currently (3.0.0), the following database servers are supported:
  • Oracle
  • PostgreSQL
  • MySQL
Other (unsupported) backends exist in the CVS repository: ODBC, SQLite and Firebird.
The intent of the library is to cover as many database technologies as possible. For this, the project has to rely on volunteer contributions from other programmers, who have expertise with the existing database interfaces 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 Boost Software License.
The latest and experimental version of the code is always available from the Git repository.
Anonymous clone of this repository can be obtained with:
$ git clone git://soci.git.sourceforge.net/gitroot/sociTo meet other users, please consider subscribing to the SOCI mailing list.
您需要登录后才可以回帖 登录 | 用户注册

本版积分规则

Archiver|手机版|小黑屋|ACE Developer ( 京ICP备06055248号 )

GMT+8, 2024-12-22 16:45 , Processed in 0.013492 second(s), 5 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表