Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mysql/mysql-connector-cpp

MySQL Connector/C++ is a MySQL database connector for C++. It lets you develop C++ and C applications that connect to MySQL Server.
https://github.com/mysql/mysql-connector-cpp

Last synced: 1 day ago
JSON representation

MySQL Connector/C++ is a MySQL database connector for C++. It lets you develop C++ and C applications that connect to MySQL Server.

Awesome Lists containing this project

README

        

# MySQL Connector/C++

This is a release of MySQL Connector/C++, [the C++ interface](https://dev.mysql.com/doc/dev/connector-cpp/8.0/) for communicating with MySQL servers.

For detailed information please visit the official [MySQL Connector/C++ documentation](https://dev.mysql.com/doc/dev/connector-cpp/8.0/).

## Licensing

Please refer to files README and LICENSE, available in this repository, and [Legal Notices in documentation](https://dev.mysql.com/doc/connector-cpp/8.0/en/preface.html) for further details.

## Download & Install

MySQL Connector/C++ can be installed from pre-compiled packages that can be downloaded from the [MySQL downloads page](https://dev.mysql.com/downloads/connector/cpp/).
The process of installing of Connector/C++ from a binary distribution is described in [MySQL online manuals](https://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp-installation-binary.html)

### Building from sources

MySQL Connector/C++ can be installed from the source. Please check [MySQL online manuals](https://dev.mysql.com/doc/connector-cpp/8.0/en/connector-cpp-installation-source.html)

### GitHub Repository

This repository contains the MySQL Connector/C++ source code as per latest released version. You should expect to see the same contents here and within the latest released Connector/C++ package.

## Sample Code

```
#include
#include

using ::std::cout;
using ::std::endl;
using namespace ::mysqlx;

int main(int argc, const char* argv[])
try {

const char *url = (argc > 1 ? argv[1] : "mysqlx://[email protected]");

cout << "Creating session on " << url
<< " ..." << endl;

Session sess(url);

cout <<"Session accepted, creating collection..." < ids = add.getGeneratedIds();
for (string id : ids)
cout <<"- added doc with id: " << id < 1 and name like 'ba%'").execute();

int i = 0;
for (DbDoc doc : docs)
{
cout <<"doc#" <