![]() |
fb-cpp 0.0.2
A modern C++ wrapper for the Firebird database API
|
Represents a connection to a Firebird database. More...
#include <Attachment.h>
Public Member Functions | |
| Attachment (Client &client, const std::string &uri, const AttachmentOptions &options={}) | |
| Constructs an Attachment object that connects to (or creates) the database specified by the URI using the specified Client object and options. | |
| Attachment (Attachment &&o) noexcept | |
| Move constructor. | |
| Attachment & | operator= (Attachment &&o) noexcept |
| Transfers ownership of another Attachment into this one. | |
| Attachment (const Attachment &)=delete | |
| Attachment & | operator= (const Attachment &)=delete |
| ~Attachment () noexcept | |
| Disconnects from the database. | |
| bool | isValid () noexcept |
| Returns whether the Attachment object is valid. | |
| Client & | getClient () noexcept |
| Returns the Client object reference used to create this Attachment object. | |
| FbRef< fb::IAttachment > | getHandle () noexcept |
| Returns the internal Firebird IAttachment handle. | |
| void | disconnect () |
| Disconnects from the database. | |
| void | dropDatabase () |
| Drops the database. | |
| bool | execute (Transaction &transaction, std::string_view sql, const StatementOptions &options={}) |
| Prepares and executes an SQL statement using the supplied transaction. | |
| template<typename Params > | |
| bool | execute (Transaction &transaction, std::string_view sql, const Params ¶ms) |
| Prepares, binds parameters, and executes an SQL statement using the supplied transaction. | |
| template<typename Params > | |
| bool | execute (Transaction &transaction, std::string_view sql, const StatementOptions &options, const Params ¶ms) |
| Prepares, binds parameters, and executes an SQL statement using the supplied transaction and statement options. | |
| RowSet | queryRowSet (Transaction &transaction, std::string_view sql, unsigned maxRows, const StatementOptions &options={}) |
| Prepares and executes a query using the supplied transaction and returns up to maxRows rows. | |
| template<typename Params > | |
| RowSet | queryRowSet (Transaction &transaction, std::string_view sql, unsigned maxRows, const Params ¶ms) |
| Prepares, binds parameters, and executes a query using the supplied transaction and returns up to maxRows rows. | |
| template<typename Params > | |
| RowSet | queryRowSet (Transaction &transaction, std::string_view sql, unsigned maxRows, const StatementOptions &options, const Params ¶ms) |
| Prepares, binds parameters, and executes a query using the supplied transaction and statement options and returns up to maxRows rows. | |
| template<typename T > | |
| std::optional< T > | queryScalar (Transaction &transaction, std::string_view sql, const StatementOptions &options={}) |
| Prepares and executes a query using the supplied transaction and returns the first column of the first row. | |
| template<typename T , typename Params > | |
| std::optional< T > | queryScalar (Transaction &transaction, std::string_view sql, const Params ¶ms) |
| Prepares, binds parameters, and executes a query using the supplied transaction and returns the first column of the first row. | |
| template<typename T , typename Params > | |
| std::optional< T > | queryScalar (Transaction &transaction, std::string_view sql, const StatementOptions &options, const Params ¶ms) |
| Prepares, binds parameters, and executes a query using the supplied transaction and statement options and returns the first column of the first row. | |
| template<typename T > | |
| std::optional< T > | queryFirstRowAs (Transaction &transaction, std::string_view sql, const StatementOptions &options={}) |
| Prepares and executes a query using the supplied transaction and returns the first row mapped as T. | |
| template<typename T , typename Params > | |
| std::optional< T > | queryFirstRowAs (Transaction &transaction, std::string_view sql, const Params ¶ms) |
| Prepares, binds parameters, and executes a query using the supplied transaction and returns the first row mapped as T. | |
| template<typename T , typename Params > | |
| std::optional< T > | queryFirstRowAs (Transaction &transaction, std::string_view sql, const StatementOptions &options, const Params ¶ms) |
| Prepares, binds parameters, and executes a query using the supplied transaction and statement options and returns the first row mapped as T. | |
Represents a connection to a Firebird database.
The Attachment must exist and remain valid while there are other objects using it, such as Transaction and Statement.
Definition at line 217 of file Attachment.h.
|
explicit |
Constructs an Attachment object that connects to (or creates) the database specified by the URI using the specified Client object and options.
Definition at line 36 of file Attachment.cpp.
|
inlinenoexcept |
Move constructor.
A moved Attachment object becomes invalid.
Definition at line 230 of file Attachment.h.
|
inlinenoexcept |
Disconnects from the database.
Definition at line 259 of file Attachment.h.
| void Attachment::disconnect | ( | ) |
Disconnects from the database.
Definition at line 90 of file Attachment.cpp.
| void Attachment::dropDatabase | ( | ) |
Drops the database.
Definition at line 95 of file Attachment.cpp.
| bool fbcpp::Attachment::execute | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const Params & | params | ||
| ) |
Prepares, binds parameters, and executes an SQL statement using the supplied transaction.
Definition at line 432 of file Attachment.h.
| bool fbcpp::Attachment::execute | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const StatementOptions & | options, | ||
| const Params & | params | ||
| ) |
Prepares, binds parameters, and executes an SQL statement using the supplied transaction and statement options.
Definition at line 438 of file Attachment.h.
| bool Attachment::execute | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const StatementOptions & | options = {} |
||
| ) |
Prepares and executes an SQL statement using the supplied transaction.
Definition at line 100 of file Attachment.cpp.
|
inlinenoexcept |
Returns the Client object reference used to create this Attachment object.
Definition at line 286 of file Attachment.h.
|
inlinenoexcept |
Returns the internal Firebird IAttachment handle.
Definition at line 294 of file Attachment.h.
|
inlinenoexcept |
Returns whether the Attachment object is valid.
Definition at line 278 of file Attachment.h.
|
inlinenoexcept |
Transfers ownership of another Attachment into this one.
The old handle is released via FbRef::operator=(FbRef&&). After the assignment, this is valid (with o's handle) and o is invalid.
Definition at line 242 of file Attachment.h.
| std::optional< T > fbcpp::Attachment::queryFirstRowAs | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const Params & | params | ||
| ) |
Prepares, binds parameters, and executes a query using the supplied transaction and returns the first row mapped as T.
Definition at line 486 of file Attachment.h.
| std::optional< T > fbcpp::Attachment::queryFirstRowAs | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const StatementOptions & | options, | ||
| const Params & | params | ||
| ) |
Prepares, binds parameters, and executes a query using the supplied transaction and statement options and returns the first row mapped as T.
Definition at line 497 of file Attachment.h.
| std::optional< T > fbcpp::Attachment::queryFirstRowAs | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const StatementOptions & | options = {} |
||
| ) |
Prepares and executes a query using the supplied transaction and returns the first row mapped as T.
Definition at line 415 of file Attachment.h.
| RowSet fbcpp::Attachment::queryRowSet | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| unsigned | maxRows, | ||
| const Params & | params | ||
| ) |
Prepares, binds parameters, and executes a query using the supplied transaction and returns up to maxRows rows.
Definition at line 447 of file Attachment.h.
| RowSet fbcpp::Attachment::queryRowSet | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| unsigned | maxRows, | ||
| const StatementOptions & | options, | ||
| const Params & | params | ||
| ) |
Prepares, binds parameters, and executes a query using the supplied transaction and statement options and returns up to maxRows rows.
Definition at line 454 of file Attachment.h.
| RowSet Attachment::queryRowSet | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| unsigned | maxRows, | ||
| const StatementOptions & | options = {} |
||
| ) |
Prepares and executes a query using the supplied transaction and returns up to maxRows rows.
Definition at line 106 of file Attachment.cpp.
| std::optional< T > fbcpp::Attachment::queryScalar | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const Params & | params | ||
| ) |
Prepares, binds parameters, and executes a query using the supplied transaction and returns the first column of the first row.
Definition at line 463 of file Attachment.h.
| std::optional< T > fbcpp::Attachment::queryScalar | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const StatementOptions & | options, | ||
| const Params & | params | ||
| ) |
Prepares, binds parameters, and executes a query using the supplied transaction and statement options and returns the first column of the first row.
Definition at line 474 of file Attachment.h.
| std::optional< T > fbcpp::Attachment::queryScalar | ( | Transaction & | transaction, |
| std::string_view | sql, | ||
| const StatementOptions & | options = {} |
||
| ) |
Prepares and executes a query using the supplied transaction and returns the first column of the first row.
Definition at line 403 of file Attachment.h.