0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

Update Database.md

Replace outdated doc, partially addressing #404.
This commit is contained in:
Roland Bock 2021-12-31 16:54:38 +01:00 committed by GitHub
parent a80b1d178c
commit a9cd886139
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,11 +1,16 @@
#Introduction # Introduction
sqlpp11 is a library mainly for constructing queries and interpreting results. It does not know how to talk to a database on its own. It needs database connectors for that. Depending on the database you want to use, you can use an existing connector, for instance
* MySQL: https://github.com/rbock/sqlpp11-connector-mysql Using sqlpp11 requires of three logical parts:
* sqlite3: https://github.com/rbock/sqlpp11-connector-sqlite3 1. The actual tables of a database are represented structs, usually generated by sql2cpp. These structs contain compile-time information about each colum such as name and data type.
* PostgreSQL: https://github.com/matthijs/sqlpp11-connector-postgresql 2. The core library provides SQL as embedded language for C++. It allows you to write SQL statements for those tables and analyse results in a compile-time checked manner.
* STL Container (highly experimental): https://github.com/rbock/sqlpp11-connector-stl 3. The connector library that allows you to connect to an actual database, send queries and obtain results.
Or you have to write your own connector. Don't worry, it is not that hard. Three connector libraries are included in this repository:
* MySQL / MariaBD
* sqlite3 / SQLCipher
* PostgreSQL
If you want to use other databases, you would have to write your own connector. Don't worry, it is not that hard.
The api is documented [here](https://github.com/rbock/sqlpp11/blob/master/connector_api/connection.h). The api is documented [here](https://github.com/rbock/sqlpp11/blob/master/connector_api/connection.h).