More flexible array retrieval + *vector support.

This commit is contained in:
eelke 2017-12-17 11:27:42 +01:00
parent d9854d81fa
commit db75d9ed50
5 changed files with 119 additions and 8 deletions

View file

@ -12,10 +12,39 @@ namespace Pgsql {
{}
void reset() { col = -1; }
Pgsql::Value nextValue()
{
return row.get(++col);
}
template <typename E, typename I>
Col& getAsArray(I insert_iter, NullHandling nullhandling = NullHandling::Throw)
{
nextValue().getAsArray<E, I>(insert_iter, nullhandling);
return *this;
}
template <typename E, typename I>
void getAsArray(I insert_iter, const E &value_for_nulls) const
{
nextValue().getAsArray<E, I>(insert_iter, value_for_nulls);
return *this;
}
template <typename E, typename I>
void getAsArrayOfOptional(I insert_iter) const
{
nextValue().getAsArrayOfOptional<E, I>(insert_iter);
return *this;
}
template <typename E, typename I>
Col& getAsVector(I insert_iter)
{
nextValue().getAsVector<E, I>(insert_iter);
return *this;
}
private:
const Pgsql::Row &row;
int col = -1;
@ -28,6 +57,7 @@ namespace Pgsql {
return c;
}
} // end namespace Pgsql
#endif // PGSQL_COL_H