Represents a read/write query to an archive database. Statements are expensive to create and must be cached for as long as possible. More...
#include <archive_statement.h>
Classes | |
| struct | Handle |
Public Types | |
| enum | Result { Result::kDone, Result::kRow, Result::kFailure } |
Public Member Functions | |
| ~ArchiveStatement () | |
| bool | IsValid () const |
| Result | Execute () |
| Execute the given statement with the provided data. More... | |
| bool | Reset () |
All writes after the last successfull Run call are reset. Since statements are expensive to create, reset them for new writes instead of creating new statements. More... | |
| bool | WriteValue (size_t index, const std::string &item) |
| template<class T , class = std::enable_if<std::is_integral<T>::value>> | |
| bool | WriteValue (size_t index, T item) |
| bool | WriteValue (size_t index, double item) |
| bool | WriteValue (size_t index, const Allocation &item) |
| template<class T , class = std::enable_if<std::is_integral<T>::value>> | |
| bool | ReadValue (size_t index, T &item) |
| bool | ReadValue (size_t index, double &item) |
| bool | ReadValue (size_t index, std::string &item) |
| bool | ReadValue (size_t index, Allocation &item) |
| size_t | GetColumnCount () |
Friends | |
| class | ArchiveDatabase |
Represents a read/write query to an archive database. Statements are expensive to create and must be cached for as long as possible.
Definition at line 20 of file archive_statement.h.
|
strong |
| Enumerator | |
|---|---|
| kDone | The statement is done executing. |
| kRow | The statement found a row of information ready for reading. |
| kFailure | Statement execution was a failure. |
Definition at line 26 of file archive_statement.h.
|
default |
| ArchiveStatement::Result impeller::ArchiveStatement::Execute | ( | ) |
Execute the given statement with the provided data.
Definition at line 215 of file archive_statement.cc.
References IsValid(), kDone, kFailure, and kRow.
Referenced by impeller::ArchiveTransaction::~ArchiveTransaction().
| size_t impeller::ArchiveStatement::GetColumnCount | ( | ) |
| bool impeller::ArchiveStatement::IsValid | ( | ) | const |
Definition at line 56 of file archive_statement.cc.
Referenced by Execute(), GetColumnCount(), ReadValue(), Reset(), and WriteValue().
| bool impeller::ArchiveStatement::ReadValue | ( | size_t | index, |
| Allocation & | item | ||
| ) |
Definition at line 188 of file archive_statement.cc.
References impeller::Allocation::GetBuffer(), IsValid(), impeller::ToColumn(), and impeller::Allocation::Truncate().
| bool impeller::ArchiveStatement::ReadValue | ( | size_t | index, |
| double & | item | ||
| ) |
Definition at line 150 of file archive_statement.cc.
References IsValid(), and impeller::ToColumn().
| bool impeller::ArchiveStatement::ReadValue | ( | size_t | index, |
| std::string & | item | ||
| ) |
Definition at line 166 of file archive_statement.cc.
References IsValid(), and impeller::ToColumn().
|
inline |
Definition at line 69 of file archive_statement.h.
Referenced by impeller::ArchiveLocation::Read().
| bool impeller::ArchiveStatement::Reset | ( | ) |
All writes after the last successfull Run call are reset. Since statements are expensive to create, reset them for new writes instead of creating new statements.
Definition at line 60 of file archive_statement.cc.
References IsValid().
| bool impeller::ArchiveStatement::WriteValue | ( | size_t | index, |
| const Allocation & | item | ||
| ) |
Definition at line 128 of file archive_statement.cc.
References impeller::Allocation::GetBuffer(), impeller::Allocation::GetLength(), IsValid(), and impeller::ToParam().
| bool impeller::ArchiveStatement::WriteValue | ( | size_t | index, |
| const std::string & | item | ||
| ) |
Definition at line 99 of file archive_statement.cc.
References IsValid(), and impeller::ToParam().
Referenced by impeller::ArchiveLocation::Write().
| bool impeller::ArchiveStatement::WriteValue | ( | size_t | index, |
| double | item | ||
| ) |
|
inline |
Definition at line 60 of file archive_statement.h.
|
friend |
Definition at line 85 of file archive_statement.h.