| Kea 3.0.2-git

pgsql_exchange.h
Go to the documentation of this file.
1// Copyright (C) 2016-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef PGSQL_EXCHANGE_H
8#define PGSQL_EXCHANGE_H
9
10#include <asiolink/io_address.h>
11#include <database/database_connection.h>
12#include <cc/data.h>
13#include <util/triplet.h>
14#include <util/boost_time_utils.h>
15#include <exceptions/exceptions.h>
16
17#include <boost/lexical_cast.hpp>
18#include <boost/noncopyable.hpp>
19#include <boost/shared_ptr.hpp>
20#include <libpq-fe.h>
21
22#include <stdint.h>
23#include <vector>
24#include <iostream>
25
26 namespace isc {
27 namespace db {
28
45
46 class PgSqlResult : public boost::noncopyable {
47 public:
57 PgSqlResult(PGresult *result);
58
62 ~PgSqlResult();
63
65 int getRows() const {
66 return (rows_);
67 }
68
70 int getCols() const {
71 return (cols_);
72 }
73
79 void rowCheck(int row) const;
80
86 void colCheck(int col) const;
87
95 void rowColCheck(int row, int col) const;
96
106 std::string getColumnLabel(const int col) const;
107
112 operator PGresult*() const {
113 return (result_);
114 }
115
119 operator bool() const {
120 return (result_);
121 }
122
123 private:
124 PGresult* result_;
125 int rows_;
126 int cols_;
127};
128
129 typedef boost::shared_ptr<PgSqlResult> PgSqlResultPtr;
130
149 typedef boost::shared_ptr<const std::string> ConstStringPtr;
150
151 struct PsqlBindArray {
153 PsqlBindArray() : values_(0), lengths_(0), formats_(0) {}
154
156 std::vector<const char*> values_;
157
159 std::vector<int> lengths_;
160
163 std::vector<int> formats_;
164
166 static const int TEXT_FMT;
167
169 static const int BINARY_FMT;
170
172 static const char* TRUE_STR;
173
175 static const char* FALSE_STR;
176
179 size_t size() const {
180 return (values_.size());
181 }
182
186 bool empty() const {
187 return (values_.empty());
188 }
189
199 void add(const char* value);
200
209 void add(const std::string& value);
210
224 void insert(const char* value, size_t index);
225
238 void insert(const std::string& value, size_t index);
239
243 void popBack();
244
253 void add(const std::vector<uint8_t>& data);
254
262 void addTempBinary(const std::vector<uint8_t>& data);
263
274 void add(const uint8_t* data, const size_t len);
275
288 void addTempBuffer(const uint8_t* data, const size_t len);
289
297 void add(const bool& value);
298
306 void add(const uint8_t& byte);
307
316 void add(const isc::asiolink::IOAddress& addr);
317
326 template<typename T>
327 void add(const T& value) {
328 addTempString(boost::lexical_cast<std::string>(value));
329 }
330
339 void addTempString(const std::string& str);
340
345 void addNull(const int format = PsqlBindArray::TEXT_FMT);
346
353 void add(const isc::util::Triplet<uint32_t>& triplet);
354
361 void addMin(const isc::util::Triplet<uint32_t>& triplet);
362
369 void addMax(const isc::util::Triplet<uint32_t>& triplet);
370
377 void addOptional(const util::Optional<std::string>& value);
378
384 template<typename T>
385 void addOptional(const util::Optional<T>& value) {
386 if (value.unspecified()) {
387 addNull();
388 } else {
389 add(value.get());
390 }
391 }
392
399 void addInet4(const isc::asiolink::IOAddress& value);
400
407 void addInet6(const isc::asiolink::IOAddress& value);
408
415 void addOptionalInet4(const util::Optional<isc::asiolink::IOAddress>& value);
416
425 void addOptionalInet6(const util::Optional<isc::asiolink::IOAddress>& value);
426
427
434 void addTimestamp(const boost::posix_time::ptime& timestamp);
435
439 void addTimestamp();
440
448 void add(const data::ElementPtr& value);
449
457 void add(const data::ConstElementPtr& value);
458
461 std::string toText() const;
462
463 // --- the following methods are mostly useful for testing -----
464
469 bool amNull(size_t index = 0) const;
470
478 template<typename T>
479 T getInteger(size_t index = 0) {
480 if (values_.size() < index + 1) {
481 isc_throw(OutOfRange, "Invalid index " << index << ", the values array has "
482 << values_.size() << " element(s)");
483 }
484 auto x = values_.at(index);
485 if (!x) {
486 isc_throw(BadValue, "the data in column " << index << " is null");
487 }
488 return (boost::lexical_cast<T>(x));
489 }
490
496 int getType(size_t index = 0 ) {
497 if (formats_.size() < index + 1) {
498 isc_throw(OutOfRange, "Invalid index " << index << ", the formats_ array has "
499 << formats_.size() << " element(s)");
500 }
501 return (formats_.at(index));
502 }
503
504 private:
506 std::vector<ConstStringPtr> bound_strs_;
507};
508
510 typedef boost::shared_ptr<PsqlBindArray> PsqlBindArrayPtr;
511
517 class PgSqlExchange {
518 public:
520 PgSqlExchange(const size_t num_columns = 0) : columns_(num_columns) {}
521
523 virtual ~PgSqlExchange() {}
524
529 static std::string convertToDatabaseTime(const time_t input_time);
530
535 static std::string convertLocalToDatabaseTime(const time_t input_time);
536
559 static std::string convertToDatabaseTime(const time_t cltt,
560 const uint32_t valid_lifetime);
561
571 static time_t convertFromDatabaseTime(const std::string& db_time_val);
572
582 static void convertFromDatabaseTime(const std::string& db_time_val,
583 boost::posix_time::ptime& conv_time);
584
599 static const char* getRawColumnValue(const PgSqlResult& r, const int row,
600 const size_t col);
601
613 static std::string getColumnLabel(const PgSqlResult& r, const size_t col);
614
624 static void getColumnValue(const PgSqlResult& r, const int row,
625 const size_t col, std::string& value);
626
636 static void getColumnValue(const PgSqlResult& r, const int row,
637 const size_t col, bool &value);
638
648 static void getColumnValue(const PgSqlResult& r, const int row,
649 const size_t col, uint8_t &value);
650
662 static isc::asiolink::IOAddress getInetValue4(const PgSqlResult& r,
663 const int row,
664 const size_t col);
665
677 static isc::asiolink::IOAddress getInetValue6(const PgSqlResult& r,
678 const int row,
679 const size_t col);
680
692 static isc::asiolink::IOAddress getIPv6Value(const PgSqlResult& r,
693 const int row,
694 const size_t col);
695
703 static bool isColumnNull(const PgSqlResult& r, const int row,
704 const size_t col);
705
718 template<typename T>
719 static void getColumnValue(const PgSqlResult& r, const int row,
720 const size_t col, T& value) {
721 const char* data = getRawColumnValue(r, row, col);
722 try {
723 value = boost::lexical_cast<T>(data);
724 } catch (const std::exception& ex) {
725 isc_throw(db::DbOperationError, "Invalid data:[" << data
726 << "] for row: " << row << " col: " << col << ","
727 << getColumnLabel(r, col) << " : " << ex.what());
728 }
729 }
730
740 static void getColumnValue(const PgSqlResult& r, const int row,
741 const size_t col, boost::posix_time::ptime& value);
742
752 static void getColumnValue(const PgSqlResult& r, const int row,
753 const size_t col, data::ElementPtr& value);
754
770 static void convertFromBytea(const PgSqlResult& r, const int row,
771 const size_t col, uint8_t* buffer,
772 const size_t buffer_size,
773 size_t &bytes_converted);
774
788 static void convertFromBytea(const PgSqlResult& r, const int row,
789 const size_t col, std::vector<uint8_t>& value);
790
802 static isc::util::Triplet<uint32_t> getTripletValue(const PgSqlResult& r,
803 const int row,
804 const size_t col);
805
822 static isc::util::Triplet<uint32_t> getTripletValue(const PgSqlResult& r,
823 const int row,
824 const size_t def_col,
825 const size_t min_col,
826 const size_t max_col);
827
834 static std::string dumpRow(const PgSqlResult& r, int row);
835
836 protected:
839 std::vector<std::string> columns_;
840};
841
844 class PgSqlResultRowWorker {
845 public:
852 PgSqlResultRowWorker(const PgSqlResult& r, const int row);
853
859 bool isColumnNull(const size_t col);
860
866 std::string getString(const size_t col);
867
873 bool getBool(const size_t col);
874
880 double getDouble(const size_t col);
881
893 const char* getRawColumnValue(const size_t col);
894
900 uint64_t getBigInt(const size_t col);
901
907 uint32_t getInt(const size_t col);
908
914 uint16_t getSmallInt(const size_t col);
915
920 void getBytes(const size_t col, std::vector<uint8_t>& value);
921
928 isc::asiolink::IOAddress getInet4(const size_t col);
929
936 isc::asiolink::IOAddress getInet6(const size_t col);
937
945 template<typename T>
946 void getColumnValue(const size_t col, T& value) {
947 PgSqlExchange::getColumnValue(r_, row_, col, value);
948 }
949
954 boost::posix_time::ptime getTimestamp(const size_t col);
955
960 data::ElementPtr getJSON(const size_t col);
961
968 isc::util::Triplet<uint32_t> getTriplet(const size_t col);
969
981 isc::util::Triplet<uint32_t> getTriplet(const size_t def_col,
982 const size_t min_col,
983 const size_t max_col);
984
988 std::string dumpRow();
989
990 private:
992 const PgSqlResult& r_;
993
995 size_t row_;
996};
997
999 typedef boost::shared_ptr<PgSqlResultRowWorker> PgSqlResultRowWorkerPtr;
1000
1001} // end of isc::db namespace
1002} // end of isc namespace
1003
1004#endif // PGSQL_EXCHANGE_H
boost_time_utils.h
isc::BadValue
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
Definition exceptions/exceptions.h:132
isc::OutOfRange
A generic exception that is thrown if a parameter given to a method would refer to or modify out-of-r...
Definition exceptions/exceptions.h:115
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:45
isc::db::DbOperationError
Exception thrown on failure to execute a database function.
Definition database_connection.h:45
isc::db::PgSqlExchange::getTripletValue
static isc::util::Triplet< uint32_t > getTripletValue(const PgSqlResult &r, const int row, const size_t col)
Fetches a uint32_t value into a Triplet using a single column value.
Definition pgsql_exchange.cc:590
isc::db::PgSqlExchange::getRawColumnValue
static const char * getRawColumnValue(const PgSqlResult &r, const int row, const size_t col)
Gets a pointer to the raw column value in a result set row.
Definition pgsql_exchange.cc:405
isc::db::PgSqlExchange::~PgSqlExchange
virtual ~PgSqlExchange()
Destructor.
Definition pgsql_exchange.h:523
isc::db::PgSqlExchange::PgSqlExchange
PgSqlExchange(const size_t num_columns=0)
Constructor.
Definition pgsql_exchange.h:520
isc::db::PgSqlExchange::convertToDatabaseTime
static std::string convertToDatabaseTime(const time_t input_time)
Converts UTC time_t value to a text representation in local time.
Definition pgsql_exchange.cc:337
isc::db::PgSqlExchange::dumpRow
static std::string dumpRow(const PgSqlResult &r, int row)
Diagnostic tool which dumps the Result row contents as a string.
Definition pgsql_exchange.cc:631
isc::db::PgSqlExchange::getInetValue4
static isc::asiolink::IOAddress getInetValue4(const PgSqlResult &r, const int row, const size_t col)
Converts a column in a row in a result set into IPv4 address.
Definition pgsql_exchange.cc:481
isc::db::PgSqlExchange::getColumnLabel
static std::string getColumnLabel(const PgSqlResult &r, const size_t col)
Fetches the name of the column in a result set.
Definition pgsql_exchange.cc:626
isc::db::PgSqlExchange::convertFromBytea
static void convertFromBytea(const PgSqlResult &r, const int row, const size_t col, uint8_t *buffer, const size_t buffer_size, size_t &bytes_converted)
Converts a column in a row in a result set to a binary bytes.
Definition pgsql_exchange.cc:530
isc::db::PgSqlExchange::convertLocalToDatabaseTime
static std::string convertLocalToDatabaseTime(const time_t input_time)
Converts local time_t value to a text representation in local time.
Definition pgsql_exchange.cc:350
isc::db::PgSqlExchange::isColumnNull
static bool isColumnNull(const PgSqlResult &r, const int row, const size_t col)
Returns true if a column within a row is null.
Definition pgsql_exchange.cc:417
isc::db::PgSqlExchange::getColumnValue
static void getColumnValue(const PgSqlResult &r, const int row, const size_t col, T &value)
Fetches a text column as the given value type.
Definition pgsql_exchange.h:719
isc::db::PgSqlExchange::getColumnValue
static void getColumnValue(const PgSqlResult &r, const int row, const size_t col, std::string &value)
Fetches text column value as a string.
Definition pgsql_exchange.cc:424
isc::db::PgSqlExchange::convertFromDatabaseTime
static time_t convertFromDatabaseTime(const std::string &db_time_val)
Converts time stamp from the database to a time_t.
Definition pgsql_exchange.cc:385
isc::db::PgSqlExchange::getInetValue6
static isc::asiolink::IOAddress getInetValue6(const PgSqlResult &r, const int row, const size_t col)
Converts a column in a row in a result set into IPv6 address.
Definition pgsql_exchange.cc:499
isc::db::PgSqlExchange::columns_
std::vector< std::string > columns_
Stores text labels for columns, currently only used for logging and errors.
Definition pgsql_exchange.h:839
isc::db::PgSqlExchange::getIPv6Value
static isc::asiolink::IOAddress getIPv6Value(const PgSqlResult &r, const int row, const size_t col)
Converts a column in a row in a result set into IPv6 address.
Definition pgsql_exchange.cc:517
isc::db::PgSqlResultRowWorker::getBytes
void getBytes(const size_t col, std::vector< uint8_t > &value)
Fetches binary data at the given column into a vector.
Definition pgsql_exchange.cc:722
isc::db::PgSqlResultRowWorker::getString
std::string getString(const size_t col)
Fetches the column value as a string.
Definition pgsql_exchange.cc:675
isc::db::PgSqlResultRowWorker::getColumnValue
void getColumnValue(const size_t col, T &value)
Fetches a text column as the given value type.
Definition pgsql_exchange.h:946
isc::db::PgSqlResultRowWorker::getTimestamp
boost::posix_time::ptime getTimestamp(const size_t col)
Fetches a timestamp column as a ptime.
Definition pgsql_exchange.cc:737
isc::db::PgSqlResultRowWorker::getBool
bool getBool(const size_t col)
Fetches the boolean value at the given column.
Definition pgsql_exchange.cc:682
isc::db::PgSqlResultRowWorker::PgSqlResultRowWorker
PgSqlResultRowWorker(const PgSqlResult &r, const int row)
Constructor.
Definition pgsql_exchange.cc:663
isc::db::PgSqlResultRowWorker::getRawColumnValue
const char * getRawColumnValue(const size_t col)
Gets a pointer to the raw column value in a result set row.
Definition pgsql_exchange.cc:696
isc::db::PgSqlResultRowWorker::getJSON
data::ElementPtr getJSON(const size_t col)
Fetches a JSON column as an ElementPtr.
Definition pgsql_exchange.cc:744
isc::db::PgSqlResultRowWorker::getTriplet
isc::util::Triplet< uint32_t > getTriplet(const size_t col)
Fetches a uint32_t value into a Triplet using a single column value.
Definition pgsql_exchange.cc:751
isc::db::PgSqlResultRowWorker::getSmallInt
uint16_t getSmallInt(const size_t col)
Fetches the uint16_t value at the given column.
Definition pgsql_exchange.cc:715
isc::db::PgSqlResultRowWorker::getInt
uint32_t getInt(const size_t col)
Fetches the uint32_t value at the given column.
Definition pgsql_exchange.cc:708
isc::db::PgSqlResultRowWorker::getDouble
double getDouble(const size_t col)
Fetches the floating point value at the given column.
Definition pgsql_exchange.cc:689
isc::db::PgSqlResultRowWorker::getBigInt
uint64_t getBigInt(const size_t col)
Fetches the uint64_t value at the given column.
Definition pgsql_exchange.cc:701
isc::db::PgSqlResultRowWorker::getInet4
isc::asiolink::IOAddress getInet4(const size_t col)
Fetches the v4 IP address at the given column.
Definition pgsql_exchange.cc:727
isc::db::PgSqlResultRowWorker::dumpRow
std::string dumpRow()
Diagnostic tool which dumps the Result row contents as a string.
Definition pgsql_exchange.cc:762
isc::db::PgSqlResultRowWorker::getInet6
isc::asiolink::IOAddress getInet6(const size_t col)
Fetches the v6 IP address at the given column.
Definition pgsql_exchange.cc:732
isc::db::PgSqlResultRowWorker::isColumnNull
bool isColumnNull(const size_t col)
Indicates whether or not the given column value is null.
Definition pgsql_exchange.cc:670
isc::db::PgSqlResult
RAII wrapper for PostgreSQL Result sets.
Definition pgsql_exchange.h:46
isc::db::PgSqlResult::colCheck
void colCheck(int col) const
Determines if a column index is valid.
Definition pgsql_connection.cc:75
isc::db::PgSqlResult::rowCheck
void rowCheck(int row) const
Determines if a row index is valid.
Definition pgsql_connection.cc:61
isc::db::PgSqlResult::rowColCheck
void rowColCheck(int row, int col) const
Determines if both a row and column index are valid.
Definition pgsql_connection.cc:83
isc::db::PgSqlResult::~PgSqlResult
~PgSqlResult()
Destructor.
Definition pgsql_connection.cc:68
isc::db::PgSqlResult::getColumnLabel
std::string getColumnLabel(const int col) const
Fetches the name of the column in a result set.
Definition pgsql_connection.cc:89
isc::db::PgSqlResult::getRows
int getRows() const
Returns the number of rows in the result set.
Definition pgsql_exchange.h:65
isc::db::PgSqlResult::getCols
int getCols() const
Returns the number of columns in the result set.
Definition pgsql_exchange.h:70
isc::db::PgSqlResult::PgSqlResult
PgSqlResult(PGresult *result)
Constructor.
Definition pgsql_connection.cc:45
isc::util::Optional
A template representing an optional value.
Definition optional.h:36
isc::util::Optional::get
T get() const
Retrieves the encapsulated value.
Definition optional.h:114
isc::util::Optional::unspecified
void unspecified(bool unspecified)
Modifies the flag that indicates whether the value is specified or unspecified.
Definition optional.h:136
isc::util::Triplet
This template specifies a parameter value.
Definition triplet.h:37
data.h
database_connection.h
exceptions.h
isc_throw
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Definition exceptions/exceptions.h:210
io_address.h
isc::data
Definition base_stamped_element.cc:12
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
isc::db
Definition audit_entry.cc:14
isc::db::PgSqlResultPtr
boost::shared_ptr< PgSqlResult > PgSqlResultPtr
Definition pgsql_exchange.h:129
isc::db::PgSqlResultRowWorkerPtr
boost::shared_ptr< PgSqlResultRowWorker > PgSqlResultRowWorkerPtr
Pointer to a result row worker.
Definition pgsql_exchange.h:999
isc::db::PsqlBindArrayPtr
boost::shared_ptr< PsqlBindArray > PsqlBindArrayPtr
Defines a smart pointer to PsqlBindArray.
Definition pgsql_exchange.h:510
isc::db::ConstStringPtr
boost::shared_ptr< const std::string > ConstStringPtr
Structure used to bind C++ input values to dynamic SQL parameters The structure contains three vector...
Definition pgsql_exchange.h:149
isc
Defines the logger used by the top-level component of kea-lfc.
Definition agent_parser.cc:148
isc::db::PsqlBindArray::insert
void insert(const char *value, size_t index)
Inserts a string value to the bind array before the given index.
Definition pgsql_exchange.cc:47
isc::db::PsqlBindArray::addOptionalInet4
void addOptionalInet4(const util::Optional< isc::asiolink::IOAddress > &value)
Adds an Optional IPv4 address to the bind array.
Definition pgsql_exchange.cc:204
isc::db::PsqlBindArray::getInteger
T getInteger(size_t index=0)
Returns the value as an integer.
Definition pgsql_exchange.h:479
isc::db::PsqlBindArray::getType
int getType(size_t index=0)
Returns the column type.
Definition pgsql_exchange.h:496
isc::db::PsqlBindArray::addTempString
void addTempString(const std::string &str)
Binds the given string to the bind array.
Definition pgsql_exchange.cc:177
isc::db::PsqlBindArray::addInet4
void addInet4(const isc::asiolink::IOAddress &value)
Adds an IPv4 address to the bind array.
Definition pgsql_exchange.cc:193
isc::db::PsqlBindArray::addInet6
void addInet6(const isc::asiolink::IOAddress &value)
Adds an IPv6 address to the bind array.
Definition pgsql_exchange.cc:214
isc::db::PsqlBindArray::values_
std::vector< const char * > values_
Vector of pointers to the data values.
Definition pgsql_exchange.h:156
isc::db::PsqlBindArray::addTempBuffer
void addTempBuffer(const uint8_t *data, const size_t len)
Adds a temporary buffer of binary data to the bind array.
Definition pgsql_exchange.cc:106
isc::db::PsqlBindArray::addOptional
void addOptional(const util::Optional< std::string > &value)
Adds an Optional string to the bind array.
Definition pgsql_exchange.cc:184
isc::db::PsqlBindArray::formats_
std::vector< int > formats_
Vector of "format" for each value.
Definition pgsql_exchange.h:163
isc::db::PsqlBindArray::add
void add(const char *value)
Adds a char array to bind array based.
Definition pgsql_exchange.cc:31
isc::db::PsqlBindArray::size
size_t size() const
Fetches the number of entries in the array.
Definition pgsql_exchange.h:179
isc::db::PsqlBindArray::addNull
void addNull(const int format=PsqlBindArray::TEXT_FMT)
Adds a NULL value to the bind array.
Definition pgsql_exchange.cc:139
isc::db::PsqlBindArray::addMax
void addMax(const isc::util::Triplet< uint32_t > &triplet)
Adds an integer Triplet's maximum value to the bind array.
Definition pgsql_exchange.cc:164
isc::db::PsqlBindArray::TRUE_STR
static const char * TRUE_STR
Constant string passed to DB for boolean true values.
Definition pgsql_exchange.h:172
isc::db::PsqlBindArray::toText
std::string toText() const
Dumps the contents of the array to a string.
Definition pgsql_exchange.cc:291
isc::db::PsqlBindArray::FALSE_STR
static const char * FALSE_STR
Constant string passed to DB for boolean false values.
Definition pgsql_exchange.h:175
isc::db::PsqlBindArray::BINARY_FMT
static const int BINARY_FMT
Format value for binary data.
Definition pgsql_exchange.h:169
isc::db::PsqlBindArray::PsqlBindArray
PsqlBindArray()
Constructor.
Definition pgsql_exchange.h:153
isc::db::PsqlBindArray::addTempBinary
void addTempBinary(const std::vector< uint8_t > &data)
Adds a vector of binary data to the bind array.
Definition pgsql_exchange.cc:87
isc::db::PsqlBindArray::add
void add(const T &value)
Adds the given value to the bind array.
Definition pgsql_exchange.h:327
isc::db::PsqlBindArray::amNull
bool amNull(size_t index=0) const
Determines if specified value is null.
Definition pgsql_exchange.cc:325
isc::db::PsqlBindArray::TEXT_FMT
static const int TEXT_FMT
Format value for text data.
Definition pgsql_exchange.h:166
isc::db::PsqlBindArray::addOptional
void addOptional(const util::Optional< T > &value)
Adds an Optional<type> value to the bind array.
Definition pgsql_exchange.h:385
isc::db::PsqlBindArray::addTimestamp
void addTimestamp()
Adds a timestamp of the current time to the bind array.
Definition pgsql_exchange.cc:260
isc::db::PsqlBindArray::popBack
void popBack()
Removes the last entry in the bind array.
Definition pgsql_exchange.cc:71
isc::db::PsqlBindArray::addOptionalInet6
void addOptionalInet6(const util::Optional< isc::asiolink::IOAddress > &value)
Adds an Optional IPv6 address to the bind array.
Definition pgsql_exchange.cc:225
isc::db::PsqlBindArray::lengths_
std::vector< int > lengths_
Vector of data lengths for each value.
Definition pgsql_exchange.h:159
isc::db::PsqlBindArray::empty
bool empty() const
Indicates it the array is empty.
Definition pgsql_exchange.h:186
isc::db::PsqlBindArray::addMin
void addMin(const isc::util::Triplet< uint32_t > &triplet)
Adds an integer Triplet's minimum value to the bind array.
Definition pgsql_exchange.cc:155
triplet.h