aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--odb/sqlite/statement.cxx15
-rw-r--r--odb/sqlite/statement.hxx6
2 files changed, 18 insertions, 3 deletions
diff --git a/odb/sqlite/statement.cxx b/odb/sqlite/statement.cxx
index d0020d5..6417b3a 100644
--- a/odb/sqlite/statement.cxx
+++ b/odb/sqlite/statement.cxx
@@ -239,7 +239,15 @@ namespace odb
const string& s,
binding& cond,
binding& data)
- : statement (conn, s), cond_ (cond), data_ (data)
+ : statement (conn, s), cond_ (&cond), data_ (data)
+ {
+ }
+
+ select_statement::
+ select_statement (connection& conn,
+ const string& s,
+ binding& data)
+ : statement (conn, s), cond_ (0), data_ (data)
{
}
@@ -250,7 +258,10 @@ namespace odb
reset ();
done_ = false;
- bind_param (cond_.bind, cond_.count);
+
+ if (cond_ != 0)
+ bind_param (cond_->bind, cond_->count);
+
active (true);
}
diff --git a/odb/sqlite/statement.hxx b/odb/sqlite/statement.hxx
index 1d48cd4..69f5a95 100644
--- a/odb/sqlite/statement.hxx
+++ b/odb/sqlite/statement.hxx
@@ -216,6 +216,10 @@ namespace odb
binding& cond,
binding& data);
+ select_statement (connection& conn,
+ const std::string& statement,
+ binding& data);
+
// Common select interface expected by the generated code.
//
public:
@@ -273,7 +277,7 @@ namespace odb
private:
bool done_;
- binding& cond_;
+ binding* cond_;
binding& data_;
};