All Projects → taocpp → Taopq

taocpp / Taopq

Licence: mit
C++ client library for PostgreSQL

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Taopq

Pg stat monitor
PostgreSQL Statistics Collector
Stars: ✭ 145 (-5.23%)
Mutual labels:  postgresql
Querybuilder
SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
Stars: ✭ 2,111 (+1279.74%)
Mutual labels:  postgresql
Rust Webapp Starter
Rust single page webapp written in actix-web with vuejs.
Stars: ✭ 151 (-1.31%)
Mutual labels:  postgresql
Lapidus
Stream your PostgreSQL, MySQL or MongoDB databases anywhere, fast.
Stars: ✭ 145 (-5.23%)
Mutual labels:  postgresql
Node Express Postgresql Sequelize
Node.js, Express.js, Sequelize.js and PostgreSQL RESTful API
Stars: ✭ 148 (-3.27%)
Mutual labels:  postgresql
Pg2ch
Data streaming from postgresql to clickhouse via logical replication mechanism
Stars: ✭ 149 (-2.61%)
Mutual labels:  postgresql
Go Cache
This project encapsulates multiple db servers, redis、ledis、memcache、file、memory、nosql、postgresql
Stars: ✭ 143 (-6.54%)
Mutual labels:  postgresql
Tortoise Orm
Familiar asyncio ORM for python, built with relations in mind
Stars: ✭ 2,558 (+1571.9%)
Mutual labels:  postgresql
Algernon
🎩 Small self-contained pure-Go web server with Lua, Markdown, HTTP/2, QUIC, Redis and PostgreSQL support
Stars: ✭ 1,880 (+1128.76%)
Mutual labels:  postgresql
Pg qualstats
A PostgreSQL extension for collecting statistics about predicates, helping find what indices are missing
Stars: ✭ 150 (-1.96%)
Mutual labels:  postgresql
Postgres Meta
A RESTful API for managing your Postgres. Fetch tables, add roles, and run queries
Stars: ✭ 146 (-4.58%)
Mutual labels:  postgresql
Indigo
Universal cheminformatics libraries, utilities and database search tools
Stars: ✭ 146 (-4.58%)
Mutual labels:  postgresql
Libzbxpgsql
Monitor PostgreSQL with Zabbix
Stars: ✭ 150 (-1.96%)
Mutual labels:  postgresql
Sqlcell
SQLCell is a magic function for the Jupyter Notebook that executes raw, parallel, parameterized SQL queries with the ability to accept Python values as parameters and assign output data to Python variables while concurrently running Python code. And *much* more.
Stars: ✭ 145 (-5.23%)
Mutual labels:  postgresql
Serendipity
A PHP blog software
Stars: ✭ 151 (-1.31%)
Mutual labels:  postgresql
Dapper.fsharp
Lightweight F# extension for StackOverflow Dapper with support for MSSQL, MySQL and PostgreSQL
Stars: ✭ 145 (-5.23%)
Mutual labels:  postgresql
Hangfire.postgresql
PostgreSql Storage Provider for Hangfire
Stars: ✭ 149 (-2.61%)
Mutual labels:  postgresql
Web Budget
Sistema web para controle financeiro pessoal ou de pequenas empresas
Stars: ✭ 152 (-0.65%)
Mutual labels:  postgresql
Jsonschema2db
Generate tables dynamically from a JSON Schema and insert data
Stars: ✭ 152 (-0.65%)
Mutual labels:  postgresql
Pos
Stars: ✭ 150 (-1.96%)
Mutual labels:  postgresql

Welcome to taoPQ

Windows CI macOS CI Linux CI
clang-analyze clang-tidy Sanitizer CodeQL Code Coverage

taoPQ is a light-weight C++ client library for accessing a PostgreSQL database, providing a modern wrapper for libpq. It has no dependencies beyond a C++17 compatible compiler and the PostgreSQL libpq client library.

Documentation

Contact

Join us on Discord

For questions and suggestions regarding taoPQ, success or failure stories, and any other kind of feedback, please feel free to join our Discord server, open a discussion, an issue or a pull request on GitHub or contact the authors at taocpp(at)icemx.net.

Introduction

This library provides classes for database connections and transactions, as well as connection pools and table writers. It also supports for prepared statements and nested transaction. An extensible traits mechanism is used to convert C++ types into SQL statement parameters, and conversely to convert query results into arbitrary C++ types. The following example shows the basic look and feel of the library.

#include <cassert>
#include <iostream>

#include <tao/pq.hpp>

int main()
{
  // Open connection
  const auto conn = tao::pq::connection::create( "dbname=template1" );

  // Execute SQL statement
  conn->execute( "DROP TABLE IF EXISTS taopq_example" );
  conn->execute( "CREATE TABLE taopq_example ( a INTEGER PRIMARY KEY, b INTEGER, c TEXT NOT NULL )" );

  // Prepare statement
  conn->prepare( "my_stmt", "INSERT INTO taopq_example VALUES ( $1, $2, $3 )" );

  {
    // Begin transaction
    const auto tr = conn->transaction();

    // Execute statement with parameters
    tr->execute( "INSERT INTO taopq_example VALUES ( $1, $2, $3 )", 1, 42, "foo" );

    // Execute previously prepared statement with parameters (recommended)
    tr->execute( "my_stmt", 2, tao::pq::null, "Hello, world!" );

    // Commit transaction
    tr->commit();
  }

  // insert/update/delete statements return an object that contains the number of rows affected
  {
    const auto res = conn->execute( "insert", 3, 3, "drei" );
    assert( res.rows_affected() == 1 );
  }

  // Queries return object with result set
  const auto res = conn->execute( "SELECT * FROM taopq_example" );
  assert( res.size() == 3 );

  // Conveniently convert result into C++ container
  const auto v = res.vector< std::tuple< int, std::optional< int >, std::string > >();
}

The Art of C++

taoPQ is part of The Art of C++.

colinh d-frey uilianries

License

taoPQ is certified Open Source software. It may be used for any purpose, including commercial purposes, at absolutely no cost. It is distributed under the terms of the MIT license reproduced here.

Copyright (c) 2016-2021 Daniel Frey and Dr. Colin Hirsch

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].