Skip to content

Latest commit

 

History

History
38 lines (30 loc) · 1.78 KB

README.md

File metadata and controls

38 lines (30 loc) · 1.78 KB

sqlpp11-connector-postgresql

PostgreSQL connector for sqlpp11 library

License:

sqlpp11 is distributed under the BSD 2-Clause License.

Status:

Branch / Compiler gcc 4.8 MSVC 2015/2017
master Build Status Build status
develop Build Status Build status

Examples

An example on how to use this library

auto config = std::make_shared<sqlpp::postgresql::connection_config>();
config->host = "127.0.0.1";
config->user = "someuser";
config->password = "some-random-password";
config->dbname = "somedb";

sqlpp::postgresql::connection db(config);

TabFoo foo;
for(const auto& row: db(select(foo.name, foo.hasFun).from(foo).where(foo.id > 17 and foo.name.like("%bar%"))) {
  std::cerr << row.name << std::endl;
}

Connection configuration

You can use all possible authentication options that are available in PostgreSQL. See here for more information about the options.