summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpqpp/column.cpp2
-rw-r--r--libpqpp/command.cpp7
-rw-r--r--libpqpp/command.h8
3 files changed, 13 insertions, 4 deletions
diff --git a/libpqpp/column.cpp b/libpqpp/column.cpp
index 745fdd5..c43e4ab 100644
--- a/libpqpp/column.cpp
+++ b/libpqpp/column.cpp
@@ -32,7 +32,7 @@ PQ::Column::apply(DB::HandleField & h) const
h.string(PQgetvalue(sc->execRes, sc->tuple, colNo), PQgetlength(sc->execRes, sc->tuple, colNo));
break;
case 16: //BOOLOID:
- h.integer(PQgetvalue(sc->execRes, sc->tuple, colNo)[0] == 't' ? 1 : 0);
+ h.boolean(PQgetvalue(sc->execRes, sc->tuple, colNo)[0] == 't' ? 1 : 0);
break;
case 21: //INT2OID:
case 23: //INT4OID:
diff --git a/libpqpp/command.cpp b/libpqpp/command.cpp
index abd37e6..ba12574 100644
--- a/libpqpp/command.cpp
+++ b/libpqpp/command.cpp
@@ -81,6 +81,13 @@ PQ::Command::bindParamI(unsigned int n, long long unsigned int v)
formats[n] = 0;
}
void
+PQ::Command::bindParamB(unsigned int n, bool v)
+{
+ paramsAtLeast(n);
+ lengths[n] = asprintf(&values[n], "%s", v ? "true" : "false");
+ formats[n] = 0;
+}
+void
PQ::Command::bindParamF(unsigned int n, double v)
{
paramsAtLeast(n);
diff --git a/libpqpp/command.h b/libpqpp/command.h
index e78722b..a3601c4 100644
--- a/libpqpp/command.h
+++ b/libpqpp/command.h
@@ -19,14 +19,16 @@ namespace PQ {
void bindParamI(unsigned int, long unsigned int);
void bindParamI(unsigned int, long long unsigned int);
+ void bindParamB(unsigned int, bool);
+
void bindParamF(unsigned int, double);
void bindParamF(unsigned int, float);
-
+
void bindParamS(unsigned int, const Glib::ustring&);
-
+
void bindParamT(unsigned int, const boost::posix_time::time_duration &);
void bindParamT(unsigned int, const boost::posix_time::ptime &);
-
+
void bindNull(unsigned int);
protected:
const std::string stmntName;