1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#ifndef PQ_HELPERS_H #define PQ_HELPERS_H #include "libpq-fe.h" #include <memory> namespace PQ { template<auto func> struct pq_deleter { void operator()(auto p) const { func(p); } }; using ResultPtr = std::unique_ptr<PGresult, pq_deleter<PQclear>>; } #endif