From 00eb65915fb31539d747b57282f7383e8996af6a Mon Sep 17 00:00:00 2001 From: Jude Melton-Houghton Date: Thu, 20 Oct 2022 16:14:33 -0400 Subject: Add PostgreSQL helper pg_to_string --- src/database/database-postgresql.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/database/database-postgresql.h') diff --git a/src/database/database-postgresql.h b/src/database/database-postgresql.h index 22269d362..278379f5d 100644 --- a/src/database/database-postgresql.h +++ b/src/database/database-postgresql.h @@ -65,6 +65,11 @@ protected: ); } + inline std::string pg_to_string(PGresult *res, int row, int col) + { + return std::string(PQgetvalue(res, row, col), PQgetlength(res, row, col)); + } + inline PGresult *execPrepared(const char *stmtName, const int paramsNumber, const void **params, const int *paramsLengths = NULL, const int *paramsFormats = NULL, -- cgit v1.2.3