randolf.ca
1.00
Randolf Richardson's C++ classes
|
The row class is part of the object-oriented interface to the PostgreSQL C library API's PGresult structure that provides specialized access to a single row. More...
#include <pq/result>
Public Member Functions | |
row (pq::result *_result, int ROW) | |
Constructor. | |
~row () noexcept | |
Destructor, which automatically performs the following actions once the instantiated object of this class goes out of scope: | |
char * | at (const char *COL_NAME) |
Obtain column data. | |
char * | at (const int COL) |
Obtain column data. | |
bool | binaryTuples () noexcept |
Find out whether all columns contain binary data. | |
int | current_row () noexcept |
Obtain the row number (0 = first row) that this row object references. | |
bool | exists () noexcept |
Indicates whether this is a valid row (same as the operator const bool() method). | |
int | fformat (const char *COL_NAME) |
Obtain the format code indicating the format of the given column. | |
int | fformat (const int COL) |
Obtain the format code indicating the format of the given column. | |
int | fmod (const char *COL_NAME) |
Obtain the type modifier of the column associated with the given column number. | |
int | fmod (const int COL) |
Obtain the type modifier of the column associated with the given column number. | |
const char * | fname (const char *COL_NAME) |
Obtain the case-sensitive name of a specific column (field). | |
const char * | fname (const int COL) |
Obtain the case-sensitive name of a specific column (field). | |
int | fnumber (const char *COL_NAME) |
Obtain the column (field) number for the specified case-insensitive name (if the name is enclosed within quotation marks, it will become case-sensitive). | |
int | fsize (const char *COL_NAME) |
Obtain the size in bytes of the column associated with the given column number as it is stored internally in the database. | |
int | fsize (const int COL) |
Obtain the size in bytes of the column associated with the given column number as it is stored internally in the database. | |
Oid | ftable (const char *COL_NAME) |
Obtain the OID of the table from which the given column was fetched. | |
Oid | ftable (const int COL) |
Obtain the OID of the table from which the given column was fetched. | |
uint | ftablecol (const char *COL_NAME) |
Obtain the column number (within its table) of the column making up the result column. | |
uint | ftablecol (const int COL) |
Obtain the column number (within its table) of the column making up the result column. | |
Oid | ftype (const char *COL_NAME) |
Obtain the OID of the data type associated with the given column number. | |
Oid | ftype (const int COL) |
Obtain the OID of the data type associated with the given column number. | |
bool | getisnull (const char *COL_NAME) |
Find out whether the current row's specified column is NULL in the database. | |
bool | getisnull (const int COL) |
Find out whether the current row's specified column is NULL in the database. | |
size_t | getlength (const char *COL_NAME) |
Obtain the length of the data at the specified column. | |
size_t | getlength (const int COL) |
Obtain the length of the data at the specified column. | |
char * | getvalue (const char *COL_NAME) |
Obtain column data. | |
char * | getvalue (const int COL) |
Obtain column data. | |
uint | nfields () noexcept |
Obtain the total number of columns (fields). | |
operator const bool () noexcept | |
Indicates whether this is a valid row (same as the exists() method). | |
const char * | operator[] (const char *COL_NAME) |
Array-style access to columns by name. Names are case-sensitive, and PostgreSQL normally presents all the letters in lower-case. | |
const char * | operator[] (const int COL) |
Array-style access to columns. The first column is at index 0. | |
bool | to_bool (const char *COL_NAME, const std::optional< const bool > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
bool | to_bool (const int COL, const std::optional< const bool > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
char | to_char (const char *COL_NAME, const std::optional< const char > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
char | to_char (const int COL, const std::optional< const char > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
const char * | to_cstr (const char *COL_NAME, const std::optional< const char * > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
const char * | to_cstr (const int COL, const std::optional< const char * > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
double | to_double (const char *COL_NAME, const std::optional< const double > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
double | to_double (const int COL, const std::optional< const double > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
float | to_float (const char *COL_NAME, const std::optional< const float > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
float | to_float (const int COL, const std::optional< const float > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
int32_t | to_int (const char *COL_NAME, const std::optional< const int32_t > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
int32_t | to_int (const int COL, const std::optional< const int32_t > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
int64_t | to_long (const char *COL_NAME, const std::optional< const int64_t > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
int64_t | to_long (const int COL, const std::optional< const int64_t > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
int16_t | to_short (const char *COL_NAME, const std::optional< const int16_t > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
int16_t | to_short (const int COL, const std::optional< const int16_t > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
std::string | to_string (const char *COL_NAME, const std::optional< const std::string > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
std::string | to_string (const int COL, const std::optional< const std::string > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
std::string_view | to_string_view (const char *COL_NAME, const std::optional< const std::string_view > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
std::string_view | to_string_view (const int COL, const std::optional< const std::string_view > null_fallback={}) |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported). | |
The row class is part of the object-oriented interface to the PostgreSQL C library API's PGresult structure that provides specialized access to a single row.
An ASCIIZ string is a C-string (char* array) that includes a terminating null (0) character at the end.
I use the term "ASCIIZ string" to indicate an array of characters that's terminated by a 0 (a.k.a., null). Although this is very much the same as a C-string, the difference is that in many API functions a C-string must often be accompanied by its length value. When referring to an ASCIIZ string, I'm intentionally indicating that the length of the string is not needed because the string is null-terminated. (This term was also commonly used in assembly language programming in the 1970s, 1980s, and 1990s, and as far as I know is still used by machine language programmers today.)
Parameter stacking is also supported (with methods that return result&
).
|
inline |
Constructor.
_result | Reference to pq::result source |
ROW | Row number |
|
inlinenoexcept |
Destructor, which automatically performs the following actions once the instantiated object of this class goes out of scope:
|
inline |
Obtain column data.
pq::errors::position | If the column number is out of range |
COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain column data.
pq::errors::position | If the column name doesn't exist |
COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlinenoexceptLIBPQ |
Find out whether all columns contain binary data.
COPY
), because it is possible for a single PGresult
to contain text data in some columns and binary data in others; fformat is preferred. TRUE
= all columns are binary (a.k.a., format 1) FALSE
= at least one column contains non-binary/text data
|
inlinenoexcept |
Obtain the row number (0 = first row) that this row object references.
|
inlinenoexcept |
Indicates whether this is a valid row (same as the operator const bool() method).
TRUE
= this row existsFALSE
= this row doesn't exist
|
inlineLIBPQ |
Obtain the format code indicating the format of the given column.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column (PQfformat doesn't return a different error code when an out-of-range column is specified, so we perform an additional check for this beforehand.) |
0
= textual data representation1
= binary data representationCOL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain the format code indicating the format of the given column.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column (PQfformat doesn't return a different error code when an out-of-range column is specified, so we perform an additional check for this beforehand.) |
0
= textual data representation1
= binary data representationCOL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Obtain the type modifier of the column associated with the given column number.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column (PQfmod doesn't return a different error code when an out-of-range column is specified, so we perform an additional check for this beforehand.) |
n
= type modifier-1
= indicates "no information available" (typically because most types do not use modifiers) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain the type modifier of the column associated with the given column number.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column (PQfmod doesn't return a different error code when an out-of-range column is specified, so we perform an additional check for this beforehand.) |
n
= type modifier-1
= indicates "no information available" (typically because most types do not use modifiers) COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Obtain the case-sensitive name of a specific column (field).
pq::errors::position | If the column number is out of range |
COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain the case-sensitive name of a specific column (field).
pq::errors::position | If the column number is out of range |
COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Obtain the column (field) number for the specified case-insensitive name (if the name is enclosed within quotation marks, it will become case-sensitive).
pq::errors::position | If the column name doesn't exist |
COL_NAME | ASCIIZ column name (case-sensitive) |
|
inlineLIBPQ |
Obtain the size in bytes of the column associated with the given column number as it is stored internally in the database.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column (PQfsize doesn't return a different error code when an out-of-range column is specified, so we perform an additional check for this beforehand.) |
COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain the size in bytes of the column associated with the given column number as it is stored internally in the database.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column (PQfsize doesn't return a different error code when an out-of-range column is specified, so we perform an additional check for this beforehand.) |
COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Obtain the OID of the table from which the given column was fetched.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column |
COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain the OID of the table from which the given column was fetched.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column |
COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Obtain the column number (within its table) of the column making up the result column.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column |
COL | Table Column number (1 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain the column number (within its table) of the column making up the result column.
pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column |
COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Obtain the OID of the data type associated with the given column number.
pg_type
to obtain the names and properties of the various data types. The OIDs of the built-in data types are defined in the file catalog/pg_type_d.h
(which can be found in the PostgreSQL installation's include/
directory). pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column (PQftype doesn't return a different error code when an out-of-range column is specified, so we perform an additional check for this beforehand.) |
COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain the OID of the data type associated with the given column number.
pg_type
to obtain the names and properties of the various data types. The OIDs of the built-in data types are defined in the file catalog/pg_type_d.h
(which can be found in the PostgreSQL installation's include/
directory). pq::errors::position | If the column number is out of range, or if the specified column is not a simple reference to a table column (PQftype doesn't return a different error code when an out-of-range column is specified, so we perform an additional check for this beforehand.) |
COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Find out whether the current row's specified column is NULL in the database.
pq::errors::position | If the row or column number is out of range |
TRUE
= column is NULLFALSE
= column contains 0 or more bytes of data COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Find out whether the current row's specified column is NULL in the database.
pq::errors::position | If the row or column number is out of range |
TRUE
= column is NULLFALSE
= column contains 0 or more bytes of data COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Obtain the length of the data at the specified column.
pq::errors::position | If the column number is out of range |
COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain the length of the data at the specified column.
pq::errors::position | If the column number is out of range |
COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlineLIBPQ |
Obtain column data.
pq::errors::position | If the column number is out of range |
COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Obtain column data.
pq::errors::position | If the column number is out of range |
COL_NAME | ASCIIZ column name (case-insensitive) |
|
inlinenoexceptLIBPQ |
Obtain the total number of columns (fields).
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
BOOL
data type in PostgreSQL) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
BOOL
data type in PostgreSQL) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
CHAR
data type in PostgreSQL) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
CHAR
data type in PostgreSQL) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
Do not attempt to free the data the returned pointer addresses because it's part of a larger structure that is managed by this class's destructor.
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
cstring
in PostgreSQL, which is used internally for the CHAR[n]
, VARCHAR
, and TEXT
data types) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
Do not attempt to free the data the returned pointer addresses because it's part of a larger structure that is managed by this class's destructor.
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
cstring
in PostgreSQL, which is used internally for the CHAR[n]
, VARCHAR
, and TEXT
data types) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
FLOAT8
data type in PostgreSQL) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
FLOAT8
data type in PostgreSQL) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
FLOAT4
data type in PostgreSQL) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
FLOAT4
data type in PostgreSQL) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
int
; the INT4
data type in PostgreSQL) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
int
; the INT4
data type in PostgreSQL) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
long
; the INT8
data type in PostgreSQL) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
long
; the INT8
data type in PostgreSQL) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
short
; the INT2
data type in PostgreSQL) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
std::invalid_argument | If the column data could not be converted (e.g., text contained invalid characters) |
std::out_of_range | If the column data could not be converted because it is out of range |
short
; the INT2
data type in PostgreSQL) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
cstring
in PostgreSQL, which is used internally for the CHAR[n]
, VARCHAR
, and TEXT
data types) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
cstring
in PostgreSQL, which is used internally for the CHAR[n]
, VARCHAR
, and TEXT
data types) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
cstring
in PostgreSQL, which is used internally for the CHAR[n]
, VARCHAR
, and TEXT
data types) COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inline |
Retrieves data from the column and converts it to the required datatype (both binary and text result formats are supported).
std::domain_error | If the column data is NULL |
std::length_error | If the column is the wrong size |
pq::errors::position | If the column number is out of range |
cstring
in PostgreSQL, which is used internally for the CHAR[n]
, VARCHAR
, and TEXT
data types) COL_NAME | ASCIIZ column name (case-insensitive) |
null_fallback | The value to revert to instead of throwing the std::length_error exception if the binary column data is NULL |
|
inlinenoexcept |
Indicates whether this is a valid row (same as the exists() method).
TRUE
= this row existsFALSE
= this row doesn't exist
|
inline |
Array-style access to columns. The first column is at index 0.
pq::errors::position | If the current row or the column number is out of range |
nullptr
if column data is NULL
. COL | Column number (0 = first column; negative values count backward from the end, wherein -1 = last, -2 = penultimate, etc.) |
|
inline |
Array-style access to columns by name. Names are case-sensitive, and PostgreSQL normally presents all the letters in lower-case.
pq::errors::position | If the current row or the column number is out of range |
nullptr
if column data is NULL
. COL_NAME | ASCIIZ column name (case-sensitive) |