25#ifndef FBCPP_STATEMENT_H
26#define FBCPP_STATEMENT_H
34#include "StatementOptions.h"
35#include "NumericConverter.h"
36#include "CalendarConverter.h"
37#include "Descriptor.h"
40#include "StructBinding.h"
41#include "VariantTypeTraits.h"
58#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
59#include <boost/multiprecision/cpp_int.hpp>
60#include <boost/multiprecision/cpp_dec_float.hpp>
79 SELECT = isc_info_sql_stmt_select,
83 INSERT = isc_info_sql_stmt_insert,
87 UPDATE = isc_info_sql_stmt_update,
91 DELETE = isc_info_sql_stmt_delete,
95 DDL = isc_info_sql_stmt_ddl,
115 COMMIT = isc_info_sql_stmt_commit,
119 ROLLBACK = isc_info_sql_stmt_rollback,
204 return statementHandle !=
nullptr;
213 return statementHandle;
222 return resultSetHandle;
280 return inDescriptors;
288 return outDescriptors;
366 const auto message = inMessage.data();
380 const auto&
descriptor = getInDescriptor(index);
381 const auto message = inMessage.data();
401 const auto& value =
optValue.value();
402 const auto&
descriptor = getInDescriptor(index);
403 const auto message = inMessage.data();
408 message[
descriptor.offset] = value ? std::byte{1} : std::byte{0};
412 throwInvalidType(
"bool",
descriptor.adjustedType);
443 const auto& value =
optValue.value();
472 const auto& value =
optValue.value();
501 const auto& value =
optValue.value();
518 const auto& value =
optValue.value();
519 const auto&
descriptor = getInDescriptor(index);
520 const auto message = inMessage.data();
529 throwInvalidType(
"OpaqueInt128",
descriptor.adjustedType);
535#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
561 const auto& value =
optValue.value();
607 const auto& value =
optValue.value();
608 const auto&
descriptor = getInDescriptor(index);
609 const auto message = inMessage.data();
618 throwInvalidType(
"OpaqueDecFloat16",
descriptor.adjustedType);
624#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
653 const auto& value =
optValue.value();
654 const auto&
descriptor = getInDescriptor(index);
655 const auto message = inMessage.data();
664 throwInvalidType(
"OpaqueDecFloat34",
descriptor.adjustedType);
670#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
699 const auto& value =
optValue.value();
700 const auto&
descriptor = getInDescriptor(index);
701 const auto message = inMessage.data();
707 calendarConverter.dateToOpaqueDate(value);
711 throwInvalidType(
"Date",
descriptor.adjustedType);
730 const auto& value =
optValue.value();
731 const auto&
descriptor = getInDescriptor(index);
732 const auto message = inMessage.data();
741 throwInvalidType(
"OpaqueDate",
descriptor.adjustedType);
760 const auto& value =
optValue.value();
761 const auto&
descriptor = getInDescriptor(index);
762 const auto message = inMessage.data();
768 calendarConverter.timeToOpaqueTime(value);
772 throwInvalidType(
"Time",
descriptor.adjustedType);
791 const auto& value =
optValue.value();
792 const auto&
descriptor = getInDescriptor(index);
793 const auto message = inMessage.data();
802 throwInvalidType(
"OpaqueTime",
descriptor.adjustedType);
821 const auto& value =
optValue.value();
822 const auto&
descriptor = getInDescriptor(index);
823 const auto message = inMessage.data();
829 calendarConverter.timestampToOpaqueTimestamp(value);
833 throwInvalidType(
"Timestamp",
descriptor.adjustedType);
852 const auto& value =
optValue.value();
853 const auto&
descriptor = getInDescriptor(index);
854 const auto message = inMessage.data();
863 throwInvalidType(
"OpaqueTimestamp",
descriptor.adjustedType);
882 const auto& value =
optValue.value();
883 const auto&
descriptor = getInDescriptor(index);
884 auto*
const message = inMessage.data();
890 calendarConverter.timeTzToOpaqueTimeTz(&statusWrapper, value);
894 throwInvalidType(
"TimeTz",
descriptor.adjustedType);
913 const auto& value =
optValue.value();
914 const auto&
descriptor = getInDescriptor(index);
915 auto*
const message = inMessage.data();
924 throwInvalidType(
"OpaqueTimeTz",
descriptor.adjustedType);
943 const auto& value =
optValue.value();
944 const auto&
descriptor = getInDescriptor(index);
945 auto*
const message = inMessage.data();
951 calendarConverter.timestampTzToOpaqueTimestampTz(&statusWrapper, value);
955 throwInvalidType(
"TimestampTz",
descriptor.adjustedType);
974 const auto& value =
optValue.value();
975 const auto&
descriptor = getInDescriptor(index);
976 auto*
const message = inMessage.data();
985 throwInvalidType(
"OpaqueTimestampTz",
descriptor.adjustedType);
1004 auto& client = getClient();
1005 const auto value =
optValue.value();
1006 const auto&
descriptor = getInDescriptor(index);
1007 const auto message = inMessage.data();
1013 message[
descriptor.offset] = numericConverter.stringToBoolean(value);
1027 const char c = value[
pos];
1029 if (
c <
'0' ||
c >
'9')
1038 static_assert(
sizeof(
long long) ==
sizeof(std::int64_t));
1043 numericConverter.throwConversionErrorFromString(
strValue);
1060 client.getInt128Util(&statusWrapper)
1070#if defined(__APPLE__)
1076 numericConverter.throwConversionErrorFromString(std::move(
valueString));
1080 numericConverter.throwConversionErrorFromString(std::string{value});
1087 *
reinterpret_cast<OpaqueDate*
>(
data) = calendarConverter.stringToOpaqueDate(value);
1091 *
reinterpret_cast<OpaqueTime*
>(
data) = calendarConverter.stringToOpaqueTime(value);
1095 *
reinterpret_cast<OpaqueTimestamp*
>(
data) = calendarConverter.stringToOpaqueTimestamp(value);
1100 calendarConverter.stringToOpaqueTimeTz(&statusWrapper, value);
1105 calendarConverter.stringToOpaqueTimestampTz(&statusWrapper, value);
1108#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1112 client.getDecFloat16Util(&statusWrapper)
1120 client.getDecFloat34Util(&statusWrapper)
1138 *
reinterpret_cast<std::uint16_t*
>(
data) =
static_cast<std::uint16_t
>(value.length());
1139 std::copy(value.begin(), value.end(),
1140 reinterpret_cast<char*
>(&message[
descriptor.offset +
sizeof(std::uint16_t)]));
1144 throwInvalidType(
"std::string_view",
descriptor.adjustedType);
1163 const auto& value =
optValue.value();
1164 const auto&
descriptor = getInDescriptor(index);
1165 auto*
const message = inMessage.data();
1174 throwInvalidType(
"BlobId",
descriptor.adjustedType);
1182 void set(
unsigned index, std::nullopt_t)
1198 void set(
unsigned index, std::optional<BlobId> value)
1206 void set(
unsigned index,
bool value)
1214 void set(
unsigned index, std::int16_t value)
1230 void set(
unsigned index, std::int32_t value)
1246 void set(
unsigned index, std::int64_t value)
1267#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1288 void set(
unsigned index,
float value)
1296 void set(
unsigned index,
double value)
1309#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1327#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1420 void set(
unsigned index, std::string_view value)
1428 template <
typename T>
1429 void set(
unsigned index, std::optional<T> value)
1431 if (value.has_value())
1432 set(index, value.value());
1451 return outRow->isNull(index);
1460 return outRow->getBool(index);
1469 return outRow->getInt16(index);
1478 return outRow->getScaledInt16(index);
1487 return outRow->getInt32(index);
1496 return outRow->getScaledInt32(index);
1505 return outRow->getInt64(index);
1514 return outRow->getScaledInt64(index);
1523 return outRow->getScaledOpaqueInt128(index);
1526#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1533 return outRow->getBoostInt128(index);
1542 return outRow->getScaledBoostInt128(index);
1552 return outRow->getFloat(index);
1561 return outRow->getDouble(index);
1570 return outRow->getOpaqueDecFloat16(index);
1573#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1580 return outRow->getBoostDecFloat16(index);
1590 return outRow->getOpaqueDecFloat34(index);
1593#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1600 return outRow->getBoostDecFloat34(index);
1610 return outRow->getDate(index);
1619 return outRow->getOpaqueDate(index);
1628 return outRow->getTime(index);
1637 return outRow->getOpaqueTime(index);
1646 return outRow->getTimestamp(index);
1655 return outRow->getOpaqueTimestamp(index);
1664 return outRow->getTimeTz(index);
1673 return outRow->getOpaqueTimeTz(index);
1682 return outRow->getTimestampTz(index);
1691 return outRow->getOpaqueTimestampTz(index);
1700 return outRow->getBlobId(index);
1709 return outRow->getString(index);
1719 template <
typename T>
1723 return outRow->get<T>(index);
1733 template <Aggregate T>
1737 return outRow->get<T>();
1746 template <Aggregate T>
1749 using namespace impl::reflection;
1753 if (
N != inDescriptors.size())
1756 ") does not match input parameter count (" + std::to_string(inDescriptors.size()) +
")");
1759 setStruct(value, std::make_index_sequence<N>{});
1769 template <TupleLike T>
1773 return outRow->get<T>();
1782 template <TupleLike T>
1785 constexpr std::size_t
N = std::tuple_size_v<T>;
1787 if (
N != inDescriptors.size())
1790 ") does not match input parameter count (" + std::to_string(inDescriptors.size()) +
")");
1793 setTuple(value, std::make_index_sequence<N>{});
1804 template <VariantLike V>
1808 return outRow->get<
V>(index);
1817 template <VariantLike V>
1818 void set(
unsigned index,
const V& value)
1820 using namespace impl::reflection;
1823 "Variant contains unsupported types. All variant alternatives must be types supported by fb-cpp "
1824 "(e.g., std::int32_t, std::string, Date, ScaledOpaqueInt128, etc.). Check VariantTypeTraits.h for the "
1825 "complete list of supported types.");
1828 [
this, index](
const auto&
v)
1830 using T = std::decay_t<
decltype(
v)>;
1832 if constexpr (std::is_same_v<T, std::monostate>)
1844 const Descriptor& getInDescriptor(
unsigned index)
1846 if (index >= inDescriptors.size())
1847 throw std::out_of_range(
"index out of range");
1849 return inDescriptors[index];
1855 template <
typename T, std::size_t...
Is>
1856 void setStruct(
const T& value, std::index_sequence<Is...>)
1858 using namespace impl::reflection;
1860 const auto tuple = toTupleRef(value);
1861 (
set(
static_cast<unsigned>(
Is), std::get<Is>(
tuple)), ...);
1867 template <
typename T, std::size_t...
Is>
1868 void setTuple(
const T& value, std::index_sequence<Is...>)
1870 (
set(
static_cast<unsigned>(
Is), std::get<Is>(value)), ...);
1876 template <
typename T>
1881 const auto&
descriptor = getInDescriptor(index);
1882 auto*
const message = inMessage.data();
1891 const auto valueAddress =
reinterpret_cast<const std::byte*
>(&value);
1910#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1916 numericConverter.boostInt128ToOpaqueInt128(
boostInt128);
1931#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
1937 numericConverter.boostDecFloat16ToOpaqueDecFloat16(&statusWrapper,
boostDecFloat16);
1946 numericConverter.boostDecFloat34ToOpaqueDecFloat34(&statusWrapper,
boostDecFloat34);
1960 throw FbCppException(
"Invalid type: actual type " + std::string(
actualType) +
", descriptor type " +
1964 template <
typename T>
1988 return numericConverter.numberToNumber<T>(
1993 return numericConverter.numberToNumber<T>(
1997 return numericConverter.numberToNumber<T>(
2000#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
2002 return numericConverter.numberToNumber<T>(
2007 return numericConverter.numberToNumber<T>(
2011 return numericConverter.numberToNumber<T>(
2016 return numericConverter.numberToNumber<T>(*
reinterpret_cast<const float*
>(
data),
toScale.value());
2020 return numericConverter.numberToNumber<T>(*
reinterpret_cast<const double*
>(
data),
toScale.value());
2032 Attachment* attachment;
2033 impl::StatusWrapper statusWrapper;
2034 impl::CalendarConverter calendarConverter;
2035 impl::NumericConverter numericConverter;
2039 std::vector<Descriptor> inDescriptors;
2040 std::vector<std::
byte> inMessage;
2042 std::vector<Descriptor> outDescriptors;
2043 std::vector<std::
byte> outMessage;
2044 std::unique_ptr<Row> outRow;
2046 unsigned cursorFlags = 0;
2108#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
2140#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
2154#if FB_CPP_USE_BOOST_MULTIPRECISION != 0
Represents a connection to a Firebird database.
Represents a Firebird blob identifier.
Exception thrown when a Firebird database operation fails.
Base exception class for all fb-cpp exceptions.
Reference-counted smart pointer for Firebird objects using addRef/release semantics.
Represents options used when preparing a Statement.
Prepares, executes, and fetches SQL statements against a Firebird attachment.
void set(unsigned index, OpaqueInt128 value)
Convenience overload that binds a Firebird 128-bit integer.
void setScaledInt16(unsigned index, std::optional< ScaledInt16 > optValue)
Binds a scaled 16-bit signed integer value or null.
V get(unsigned index)
Retrieves a column value as a user-defined variant type.
bool fetchAbsolute(unsigned position)
Positions the cursor on the given absolute row number.
void setNull(unsigned index)
Marks the specified parameter as null.
bool fetchRelative(int offset)
Moves the cursor by the requested relative offset.
void setScaledBoostInt128(unsigned index, std::optional< ScaledBoostInt128 > optValue)
Binds a scaled 128-bit integer value expressed with Boost.Multiprecision or null.
std::optional< OpaqueTime > getOpaqueTime(unsigned index)
Reads a raw time-of-day column in Firebird's representation.
std::optional< OpaqueDecFloat34 > getOpaqueDecFloat34(unsigned index)
Reads a Firebird 34-digit decimal floating-point column.
std::vector< std::byte > & getOutputMessage() noexcept
Provides direct access to the raw output message buffer.
void setDate(unsigned index, std::optional< Date > optValue)
Binds a date value or null.
std::string getLegacyPlan()
Retrieves the textual legacy plan if the server produced one.
const std::vector< Descriptor > & getInputDescriptors() noexcept
Provides cached descriptors for each input column.
void free()
Releases the prepared handle and any associated result set.
const std::vector< Descriptor > & getOutputDescriptors() noexcept
Provides cached descriptors for each output column.
bool isValid() noexcept
Returns whether the Statement object is valid.
StatementType getType() noexcept
Returns the type classification reported by the server.
void set(unsigned index, BoostDecFloat16 value)
Convenience overload that binds a Boost 16-digit decimal floating-point value.
std::optional< TimeTz > getTimeTz(unsigned index)
Reads a time-of-day column with timezone.
void setTime(unsigned index, std::optional< Time > optValue)
Binds a time-of-day value without timezone or null.
void set(unsigned index, std::string_view value)
Convenience overload that binds a textual value.
std::optional< BoostDecFloat34 > getBoostDecFloat34(unsigned index)
Reads a Boost-based 34-digit decimal floating-point column.
void setBlobId(unsigned index, std::optional< BlobId > optValue)
Binds a blob identifier to the specified parameter or null.
void setInt16(unsigned index, std::optional< std::int16_t > optValue)
Binds a 16-bit signed integer value or null.
void setString(unsigned index, std::optional< std::string_view > optValue)
Binds a textual parameter or null, performing direct conversions where supported.
void set(unsigned index, std::int32_t value)
Convenience overload that binds a 32-bit signed integer.
std::optional< Time > getTime(unsigned index)
Reads a time-of-day column without timezone.
std::optional< Date > getDate(unsigned index)
Reads a date column.
FbRef< fb::IResultSet > getResultSetHandle() noexcept
Provides access to the underlying Firebird currently open result set handle, if any.
bool isNull(unsigned index)
Reports whether the most recently fetched row has a null at the given column.
void set(unsigned index, double value)
Convenience overload that binds a double precision floating-point value.
void clearParameters()
Marks all bound parameters as null values.
void set(unsigned index, ScaledInt64 value)
Convenience overload that binds a scaled 64-bit signed integer.
std::optional< OpaqueDate > getOpaqueDate(unsigned index)
Reads a raw date column in Firebird's representation.
T get()
Retrieves all output columns into a user-defined aggregate struct.
void setScaledInt32(unsigned index, std::optional< ScaledInt32 > optValue)
Binds a scaled 32-bit signed integer value or null.
void set(unsigned index, std::int64_t value)
Convenience overload that binds a 64-bit signed integer.
void setTimestampTz(unsigned index, std::optional< TimestampTz > optValue)
Binds a timestamp value with timezone or null.
std::optional< std::int64_t > getInt64(unsigned index)
Reads a 64-bit signed integer column.
FbRef< fb::IStatement > getStatementHandle() noexcept
Provides direct access to the underlying Firebird statement handle.
std::optional< ScaledInt32 > getScaledInt32(unsigned index)
Reads a scaled 32-bit signed integer column.
void set(unsigned index, OpaqueTimestampTz value)
Convenience overload that binds a Firebird timestamp with timezone value.
void setOpaqueTime(unsigned index, std::optional< OpaqueTime > optValue)
Binds a raw time-of-day value in Firebird's representation or null.
std::optional< float > getFloat(unsigned index)
Reads a single precision floating-point column.
std::optional< double > getDouble(unsigned index)
Reads a double precision floating-point column.
std::optional< OpaqueTimestampTz > getOpaqueTimestampTz(unsigned index)
Reads a raw timestamp-with-time-zone column in Firebird's representation.
std::optional< ScaledInt16 > getScaledInt16(unsigned index)
Reads a scaled 16-bit signed integer column.
std::optional< BlobId > getBlobId(unsigned index)
Reads a blob identifier column.
void setInt64(unsigned index, std::optional< std::int64_t > optValue)
Binds a 64-bit signed integer value or null.
std::optional< ScaledOpaqueInt128 > getScaledOpaqueInt128(unsigned index)
Reads a Firebird scaled 128-bit integer column.
FbRef< fb::IMessageMetadata > getOutputMetadata() noexcept
Returns the metadata describing columns produced by the statement.
void set(unsigned index, TimeTz value)
Convenience overload that binds a Firebird time with timezone value.
void setOpaqueDecFloat16(unsigned index, std::optional< OpaqueDecFloat16 > optValue)
Binds a 16-digit decimal floating-point value in Firebird's representation or null.
void setOpaqueInt128(unsigned index, std::optional< OpaqueInt128 > optValue)
Binds a raw 128-bit integer value in Firebird's representation or null.
std::optional< OpaqueTimeTz > getOpaqueTimeTz(unsigned index)
Reads a raw time-of-day column with timezone in Firebird's representation.
void setBoostInt128(unsigned index, std::optional< BoostInt128 > optValue)
Binds a 128-bit integer value expressed with Boost.Multiprecision or null.
Statement & operator=(Statement &&o) noexcept
Transfers ownership of another prepared statement into this one.
void set(unsigned index, Date value)
Convenience overload that binds a Firebird date value.
void set(unsigned index, Timestamp value)
Convenience overload that binds a Firebird timestamp value.
void setOpaqueTimeTz(unsigned index, std::optional< OpaqueTimeTz > optValue)
Binds a raw time-of-day value with timezone in Firebird's representation or null.
void setTimestamp(unsigned index, std::optional< Timestamp > optValue)
Binds a timestamp value without timezone or null.
std::optional< std::string > getString(unsigned index)
Reads a textual column, applying number-to-string conversions when needed.
std::optional< std::int32_t > getInt32(unsigned index)
Reads a 32-bit signed integer column.
void set(unsigned index, OpaqueDecFloat16 value)
Convenience overload that binds a Firebird 16-digit decimal floating-point value.
void setOpaqueTimestampTz(unsigned index, std::optional< OpaqueTimestampTz > optValue)
Binds a raw timestamp value with timezone in Firebird's representation or null.
FbRef< fb::IMessageMetadata > getInputMetadata() noexcept
Returns the metadata describing prepared input parameters.
~Statement() noexcept
Releases resources; ignores failures to keep destructor noexcept.
void set(unsigned index, OpaqueTimeTz value)
Convenience overload that binds a Firebird time with timezone value.
void setBoostDecFloat16(unsigned index, std::optional< BoostDecFloat16 > optValue)
Binds a 16-digit decimal floating-point value using Boost.Multiprecision or null.
std::optional< ScaledBoostInt128 > getScaledBoostInt128(unsigned index)
Reads a scaled Boost 128-bit integer column.
std::string getPlan()
Retrieves the structured textual plan if the server produced one.
void set(unsigned index, BlobId value)
Convenience overload that binds a blob identifier.
void set(unsigned index, BoostDecFloat34 value)
Convenience overload that binds a Boost 34-digit decimal floating-point value.
bool fetchNext()
Fetches the next row in the current result set.
void set(unsigned index, OpaqueDecFloat34 value)
Convenience overload that binds a Firebird 34-digit decimal floating-point value.
void set(unsigned index, Time value)
Convenience overload that binds a Firebird time value.
T get(unsigned index)
Retrieves a column using the most appropriate typed accessor specialization.
void set(unsigned index, ScaledInt16 value)
Convenience overload that binds a scaled 16-bit signed integer.
std::optional< BoostInt128 > getBoostInt128(unsigned index)
Reads a Boost 128-bit integer column.
std::optional< bool > getBool(unsigned index)
Reads a boolean column from the current row.
void setOpaqueDecFloat34(unsigned index, std::optional< OpaqueDecFloat34 > optValue)
Binds a 34-digit decimal floating-point value in Firebird's representation or null.
void set(unsigned index, OpaqueTimestamp value)
Convenience overload that binds a Firebird timestamp value.
void setInt32(unsigned index, std::optional< std::int32_t > optValue)
Binds a 32-bit signed integer value or null.
void set(unsigned index, std::optional< BlobId > value)
Convenience overload that binds an optional blob identifier.
void setBool(unsigned index, std::optional< bool > optValue)
Binds a boolean parameter value or null.
void set(unsigned index, const V &value)
Sets a parameter from a variant value.
void set(unsigned index, TimestampTz value)
Convenience overload that binds a Firebird timestamp with timezone value.
void setDouble(unsigned index, std::optional< double > optValue)
Binds a double precision floating-point value or null.
void set(unsigned index, OpaqueDate value)
Convenience overload that binds a Firebird date value.
void set(unsigned index, std::int16_t value)
Convenience overload that binds a 16-bit signed integer.
void set(unsigned index, std::optional< T > value)
Convenience template that forwards optional values to specialized overloads.
std::optional< OpaqueTimestamp > getOpaqueTimestamp(unsigned index)
Reads a raw timestamp column in Firebird's representation.
void setScaledInt64(unsigned index, std::optional< ScaledInt64 > optValue)
Binds a scaled 64-bit signed integer value or null.
Attachment & getAttachment() noexcept
Returns the Attachment object reference used to create this Statement.
void set(unsigned index, std::nullopt_t)
Convenience overload that binds a null value.
void setFloat(unsigned index, std::optional< float > optValue)
Binds a single precision floating-point value or null.
void setOpaqueDate(unsigned index, std::optional< OpaqueDate > optValue)
Binds a raw date value in Firebird's representation or null.
bool fetchLast()
Positions the cursor on the last row.
bool execute(Transaction &transaction)
Executes a prepared statement using the supplied transaction.
void set(unsigned index, OpaqueTime value)
Convenience overload that binds a Firebird time value.
void set(unsigned index, ScaledInt32 value)
Convenience overload that binds a scaled 32-bit signed integer.
bool fetchPrior()
Fetches the previous row in the current result set.
std::optional< std::int16_t > getInt16(unsigned index)
Reads a 16-bit signed integer column.
void set(unsigned index, ScaledBoostInt128 value)
Convenience overload that binds a scaled Boost-provided 128-bit integer.
bool fetchFirst()
Positions the cursor on the first row.
std::optional< TimestampTz > getTimestampTz(unsigned index)
Reads a timestamp-with-time-zone column.
void set(unsigned index, BoostInt128 value)
Convenience overload that binds a Boost-provided 128-bit integer.
std::vector< std::byte > & getInputMessage() noexcept
Provides direct access to the raw input message buffer.
std::optional< OpaqueDecFloat16 > getOpaqueDecFloat16(unsigned index)
Reads a Firebird 16-digit decimal floating-point column.
std::optional< Timestamp > getTimestamp(unsigned index)
Reads a timestamp column without timezone.
std::optional< BoostDecFloat16 > getBoostDecFloat16(unsigned index)
Reads a Boost-based 16-digit decimal floating-point column.
void setTimeTz(unsigned index, std::optional< TimeTz > optValue)
Binds a time-of-day value with timezone or null.
void setBoostDecFloat34(unsigned index, std::optional< BoostDecFloat34 > optValue)
Binds a 34-digit decimal floating-point value using Boost.Multiprecision or null.
std::optional< ScaledInt64 > getScaledInt64(unsigned index)
Reads a scaled 64-bit signed integer column.
void set(unsigned index, bool value)
Convenience overload that binds a boolean value.
void setOpaqueTimestamp(unsigned index, std::optional< OpaqueTimestamp > optValue)
Binds a raw timestamp value in Firebird's representation or null.
void set(unsigned index, float value)
Convenience overload that binds a single precision floating-point value.
void set(const T &value)
Sets all input parameters from fields of a user-defined aggregate struct.
Represents a transaction in one or more Firebird databases.
ScaledNumber< std::int64_t > ScaledInt64
Signed 64-bit scaled number.
ScaledNumber< std::int32_t > ScaledInt32
Signed 32-bit scaled number.
boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 34 > > BoostDecFloat34
34-digit decimal floating point using Boost.Multiprecision.
FB_DEC16 OpaqueDecFloat16
Opaque 16-digit decimal floating point exposed by the Firebird API.
ScaledNumber< std::int16_t > ScaledInt16
Signed 16-bit scaled number.
boost::multiprecision::number< boost::multiprecision::cpp_dec_float< 16 > > BoostDecFloat16
16-digit decimal floating point using Boost.Multiprecision.
DescriptorAdjustedType
Descriptor adjusted type.
@ BLOB
Binary large object.
@ TIME
Time of day without time zone.
@ DECFLOAT34
34-digit decimal floating point.
@ INT64
64-bit signed integer.
@ TIME_TZ
Time of day with time zone.
@ DECFLOAT16
16-digit decimal floating point.
@ INT16
16-bit signed integer.
@ STRING
String type (variable-length).
@ INT32
32-bit signed integer.
@ TIMESTAMP
Timestamp without time zone.
@ TIMESTAMP_TZ
Timestamp with time zone.
@ INT128
128-bit signed integer.
@ FLOAT
Single-precision floating point.
@ DOUBLE
Double-precision floating point.
StatementType
Distinguishes the semantic category of the prepared SQL statement.
@ SAVEPOINT
Statement manages a savepoint.
@ PUT_SEGMENT
Statement writes a blob segment - legacy feature.
@ UPDATE
Server classified the statement as an UPDATE.
@ COMMIT
Statement commits a transaction.
@ ROLLBACK
Statement rolls back a transaction.
@ EXEC_PROCEDURE
Statement executes a stored procedure.
@ DELETE
Server classified the statement as a DELETE.
@ DDL
Statement performs data definition operations.
@ GET_SEGMENT
Statement reads a blob segment - legacy feature.
@ INSERT
Server classified the statement as an INSERT.
@ SELECT
Server classified the statement as a SELECT.
@ SET_GENERATOR
Statement sets a generator (sequence) value.
@ START_TRANSACTION
Statement starts a new transaction.
@ SELECT_FOR_UPDATE
Cursor-based SELECT that allows updates.
FB_I128 OpaqueInt128
Opaque 128-bit integer exposed by the Firebird API.
std::chrono::year_month_day Date
Firebird SQL calendar date.
FB_DEC34 OpaqueDecFloat34
Opaque 34-digit decimal floating point exposed by the Firebird API.
boost::multiprecision::int128_t BoostInt128
128-bit integer using Boost.Multiprecision.
ScaledNumber< BoostInt128 > ScaledBoostInt128
Scaled 128-bit integer backed by Boost.Multiprecision.
std::chrono::hh_mm_ss< std::chrono::microseconds > Time
Firebird SQL time-of-day with microsecond resolution.
Describes a parameter or column.
Wrapper for Firebird date values.
Wrapper for Firebird time-with-time-zone values.
Wrapper for Firebird time values.
Wrapper for Firebird timestamp-with-time-zone values.
Wrapper for Firebird timestamp values.
Represents a numeric value with an explicit decimal scale.
T value
Unscaled numeric value.
Local time bound to a time zone.
Timestamp bound to a time zone.
Combined date and time with microsecond precision.