diff options
author | Jude Melton-Houghton <jwmhjwmh@gmail.com> | 2022-10-20 16:14:33 -0400 |
---|---|---|
committer | Loïc Blot <nerzhul@users.noreply.github.com> | 2022-11-10 18:56:48 +0100 |
commit | 00eb65915fb31539d747b57282f7383e8996af6a (patch) | |
tree | f108dd8ace09add4df82ada5061932d2ec5aedbe /src/database/database-postgresql.h | |
parent | f8c781b46c693d8b1109d28f1105db18110d6e77 (diff) | |
download | minetest-00eb65915fb31539d747b57282f7383e8996af6a.tar.xz |
Add PostgreSQL helper pg_to_string
Diffstat (limited to 'src/database/database-postgresql.h')
-rw-r--r-- | src/database/database-postgresql.h | 5 |
1 files changed, 5 insertions, 0 deletions
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, |