diff options
author | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2017-01-03 14:40:47 +0000 |
---|---|---|
committer | Dan Goodliffe <daniel.goodliffe@pressassociation.com> | 2017-01-03 14:40:47 +0000 |
commit | 06ca5f98f400abb308ea7f9e1df5251a2693e970 (patch) | |
tree | 5f38e3dcbc3310e627acf4cdd7c74e4527c4ac8a /libpqpp | |
parent | Add missing PQ connection specific typedef (diff) | |
download | libdbpp-postgresql-06ca5f98f400abb308ea7f9e1df5251a2693e970.tar.bz2 libdbpp-postgresql-06ca5f98f400abb308ea7f9e1df5251a2693e970.tar.xz libdbpp-postgresql-06ca5f98f400abb308ea7f9e1df5251a2693e970.zip |
Add function for retrieving server version number
Diffstat (limited to 'libpqpp')
-rw-r--r-- | libpqpp/pq-connection.cpp | 6 | ||||
-rw-r--r-- | libpqpp/pq-connection.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/libpqpp/pq-connection.cpp b/libpqpp/pq-connection.cpp index 590435e..21cbb5d 100644 --- a/libpqpp/pq-connection.cpp +++ b/libpqpp/pq-connection.cpp @@ -186,3 +186,9 @@ PQ::Connection::insertId() return id; } +int +PQ::Connection::serverVersion() const +{ + return PQserverVersion(conn); +} + diff --git a/libpqpp/pq-connection.h b/libpqpp/pq-connection.h index dee1117..d5cbde6 100644 --- a/libpqpp/pq-connection.h +++ b/libpqpp/pq-connection.h @@ -33,6 +33,7 @@ namespace PQ { DB::ModifyCommand * newModifyCommand(const std::string & sql, const DB::CommandOptions *) override; int64_t insertId() override; + int serverVersion() const; void beginBulkUpload(const char *, const char *) override; void endBulkUpload(const char *) override; |