summaryrefslogtreecommitdiff
path: root/libpqpp/pq-selectbase.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libpqpp/pq-selectbase.cpp')
-rw-r--r--libpqpp/pq-selectbase.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libpqpp/pq-selectbase.cpp b/libpqpp/pq-selectbase.cpp
index 7dbdb4f..1024e5a 100644
--- a/libpqpp/pq-selectbase.cpp
+++ b/libpqpp/pq-selectbase.cpp
@@ -1,12 +1,15 @@
#include "pq-selectbase.h"
#include "pq-column.h"
+#include "pq-binarycolumn.h"
+#include "pq-command.h"
-PQ::SelectBase::SelectBase(const std::string & sql) :
+PQ::SelectBase::SelectBase(const std::string & sql, const PQ::CommandOptions * pqco) :
DB::Command(sql),
DB::SelectCommand(sql),
nTuples(0),
tuple(0),
- execRes(NULL)
+ execRes(NULL),
+ binary(pqco ? pqco->fetchBinary : false)
{
}
@@ -22,7 +25,7 @@ PQ::SelectBase::createColumns(PGresult * execRes)
{
unsigned int nFields = PQnfields(execRes);
for (unsigned int f = 0; f < nFields; f += 1) {
- insertColumn(DB::ColumnPtr(new Column(this, f)));
+ insertColumn(DB::ColumnPtr(binary ? new BinaryColumn(this, f) : new Column(this, f)));
}
}