Skip to content
This repository was archived by the owner on May 6, 2026. It is now read-only.
Nicuvëo edited this page Mar 29, 2014 · 3 revisions

A Row is a representation of an underlying database row. It uses caching in order not to fetch twice the same column. Although, beware: the caching method are not const, which means that a const Row& is unable to cache any value.

Row constructors are not publicly exposed, as only query execution methods can yield a row.

--

Row accessors

Name Description
int index() const This row's index in the query result.
int columns_number() const The number of columns in this row.
bool outdated() const Whether this row can still fetch values.
Statement statement() const The query statement that yielded this row.
Database database() const The database on which the query was run.

--

Cache accessors

Name Description
bool all_cached() const Whether all rows values were fetched and cached.
bool cached(int index) const Whether a given column was fetched and cached.
int size() const The number of columns in this row.

--

Cache access

Name Description
Value const& operator[](int index) Caches (if needed) and returns the nth column.
Value const& get(int index) Caches (if needed) and returns the nth column.
Values const& values() Returns a fully loaded value vector reference.

--

Cache const access

Name Description
Value operator[](int index) const Fetches (if not cached) the nth column.
Value get(int index) const Fetches (if not cached) the nth column.
Values values() const Returns a fully loaded vector copy.

--

Cache mutators

Name Description
Row& load() Caches (if needed) all the values.
Row& load(int index) Caches (if needed) the desired value.

Clone this wiki locally