SOCI is a very simple library for C++ programmers that makes the illusion of embedding SQL queries in regular C++ code, staying entirely within the Standard C++.
The idea is to provide C++ programmers (including those who are learning) 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 choice.
The 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 person "
<< "where id = " << id,
into(name), into(salary);
(No, there is no magic. Yes, it works.)
At the beginning, the SOCI library supported only Oracle databases through the OCI interface (hence the name).
This is also what you can already use (), tested with g++ (various versions) and MS Visual C++ 7.1.
Now, the intent of this project is to create the whole collection of free libraries for different databases, reusing the syntax ideas developed in the original SOCI library. The set of features is also extending.
If you know how to access other database servers using their native libraries (PostgreSQL, MySQL, etc.), you can take part in the SOCI project by porting existing code. In the majority of cases it should be enough to just replace existing OCI calls with what is required by other target servers.
If you are interested in participating, please contact the .
The latest and experimental version of the code is always available via .
To meet other users, please consider subscribing to the .
Feel invited!
--------------------next---------------------
阅读(617) | 评论(0) | 转发(0) |