1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-02 16:38:41 +00:00

Add PostgreSQL helper pg_to_string

This commit is contained in:
Jude Melton-Houghton 2022-10-20 16:14:33 -04:00 committed by Loïc Blot
parent f8c781b46c
commit 00eb65915f
2 changed files with 13 additions and 11 deletions

View file

@ -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,