Lightweight 0.20250904.0
|
#include <QueryBuilders.hpp>
Inherits SqlBasicSelectQueryBuilder< Derived >.
Public Member Functions | |
size_t | Count () |
Executes a SELECT COUNT query and returns the number of records found. | |
std::vector< Record > | All () |
Executes a SELECT query and returns all records found. | |
template<auto Field> | |
auto | All () -> std::vector< ReferencedFieldTypeOf< Field > > |
Executes a SELECT query and returns all records found for the specified field. | |
template<auto... ReferencedFields> requires (sizeof...(ReferencedFields) >= 2) | |
auto | All () -> std::vector< Record > |
Executes a SELECT query and returns all records found for the specified field, only having the specified fields queried and populated. | |
std::optional< Record > | First () |
Executes a SELECT query for the first record found and returns it. | |
template<auto Field> | |
auto | First () -> std::optional< ReferencedFieldTypeOf< Field > > |
Executes the query to get a single scalar value from the first record found. | |
template<auto... ReferencedFields> requires (sizeof...(ReferencedFields) >= 2) | |
auto | First () -> std::optional< Record > |
Executes a SELECT query for the first record found and returns it with only the specified fields populated. | |
std::vector< Record > | First (size_t n) |
Executes a SELECT query for the first n records found and returns them. | |
template<auto... ReferencedFields> | |
std::vector< Record > | First (size_t n) |
std::vector< Record > | Range (size_t offset, size_t limit) |
Executes a SELECT query for a range of records and returns them. | |
template<auto... ReferencedFields> | |
std::vector< Record > | Range (size_t offset, size_t limit) |
Protected Member Functions | |
LIGHTWEIGHT_FORCE_INLINE | SqlCoreDataMapperQueryBuilder (SqlStatement &stmt, std::string fields) noexcept |
Main API for mapping records to C++ from the database using high level C++ syntax.
Definition at line 199 of file QueryBuilders.hpp.
|
inlineexplicitprotectednoexcept |
Definition at line 220 of file QueryBuilders.hpp.
|
inline |
Executes a SELECT COUNT query and returns the number of records found.
Definition at line 229 of file QueryBuilders.hpp.
References Lightweight::SqlStatement::ExecuteDirect(), Lightweight::SqlResultCursor::GetColumn(), Lightweight::SqlStatement::GetResultCursor(), and Lightweight::SqlQueryFormatter::SelectCount().
|
inline |
Executes a SELECT query and returns all records found.
Definition at line 243 of file QueryBuilders.hpp.
References Lightweight::SqlStatement::Connection(), Lightweight::SqlStatement::ExecuteDirect(), Lightweight::SqlStatement::GetResultCursor(), Lightweight::SqlQueryFormatter::SelectAll(), and Lightweight::SqlConnection::ServerType().
|
inline |
Executes a SELECT query and returns all records found for the specified field.
Field | The field to select from the record, in the form of &Record::FieldName. |
Definition at line 271 of file QueryBuilders.hpp.
References Lightweight::SqlStatement::Connection(), Lightweight::SqlStatement::ExecuteDirect(), Lightweight::SqlResultCursor::FetchRow(), Lightweight::SqlResultCursor::GetColumn(), Lightweight::SqlStatement::GetResultCursor(), Lightweight::SqlQueryFormatter::SelectAll(), and Lightweight::SqlConnection::ServerType().
|
inline |
Executes a SELECT query and returns all records found for the specified field, only having the specified fields queried and populated.
ReferencedFields | The fields to select from the record, in the form of &Record::FieldName. |
Definition at line 320 of file QueryBuilders.hpp.
References Lightweight::SqlResultCursor::BindOutputColumns(), and Lightweight::SqlResultCursor::FetchRow().
|
inline |
Executes a SELECT query for the first record found and returns it.
Definition at line 360 of file QueryBuilders.hpp.
|
inline |
Executes the query to get a single scalar value from the first record found.
Field | The field to select from the record, in the form of &Record::FieldName. |
Definition at line 381 of file QueryBuilders.hpp.
|
inline |
Executes a SELECT query for the first record found and returns it with only the specified fields populated.
ReferencedFields | The fields to select from the record, in the form of &Record::FieldName. |
Definition at line 404 of file QueryBuilders.hpp.
References Lightweight::SqlResultCursor::BindOutputColumns(), and Lightweight::SqlResultCursor::FetchRow().
|
inline |
Executes a SELECT query for the first n records found and returns them.
Definition at line 438 of file QueryBuilders.hpp.
|
inline |
Definition at line 455 of file QueryBuilders.hpp.
|
inline |
Executes a SELECT query for a range of records and returns them.
Definition at line 495 of file QueryBuilders.hpp.
References Lightweight::FieldNameAt.
|
inline |
Definition at line 517 of file QueryBuilders.hpp.