aboutsummaryrefslogtreecommitdiff
path: root/odb/database.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-01-18 11:21:02 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-01-18 11:22:56 +0200
commitec43590b14924bdb2ab2afe4b9b705ab05a52901 (patch)
tree6a37f5c31caf2d2016e94461923ea9c60da4b34d /odb/database.ixx
parentfad90d1a9c1498e5cf749022a07d1830005e4594 (diff)
Add support for native SQL statement execution
New test: mysql/native. New manual section: 3.9, "Executing Native SQL Statements".
Diffstat (limited to 'odb/database.ixx')
-rw-r--r--odb/database.ixx14
1 files changed, 14 insertions, 0 deletions
diff --git a/odb/database.ixx b/odb/database.ixx
index 42e8ac7..252f866 100644
--- a/odb/database.ixx
+++ b/odb/database.ixx
@@ -3,6 +3,8 @@
// copyright : Copyright (c) 2009-2011 Code Synthesis Tools CC
// license : GNU GPL v2; see accompanying LICENSE file
+#include <cstring> // std::string
+
namespace odb
{
inline database::
@@ -204,4 +206,16 @@ namespace odb
return query<T> (odb::query<object_type> (q), cache);
}
+
+ inline unsigned long long database::
+ execute (const char* statement)
+ {
+ return execute (statement, std::strlen (statement));
+ }
+
+ inline unsigned long long database::
+ execute (const std::string& statement)
+ {
+ return execute (statement.c_str (), statement.size ());
+ }
}