aboutsummaryrefslogtreecommitdiff
path: root/odb/database.ixx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2011-08-21 16:27:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2011-08-21 16:27:34 +0200
commit5b6649e6f7dd256147b48197a007c23001cef647 (patch)
treedebffbb24e00bc485f9675cbc5be08ec1cc8eea9 /odb/database.ixx
parent1e63b60696f2e3012221e3bf6430a0d66ce1ba34 (diff)
Add odb::connection class
This abstract class represents a connection to the database. One can use it to start a transaction or to execute a native statement out of a transaction. Before we had concrete connection classes in the database runtime libraries (e.g., odb::mysql::connection). Now these classes derive from odb::connection.
Diffstat (limited to 'odb/database.ixx')
-rw-r--r--odb/database.ixx12
1 files changed, 12 insertions, 0 deletions
diff --git a/odb/database.ixx b/odb/database.ixx
index bd3fb44..a308bfe 100644
--- a/odb/database.ixx
+++ b/odb/database.ixx
@@ -12,6 +12,18 @@ namespace odb
{
}
+ inline transaction_impl* database::
+ begin ()
+ {
+ return connection ()->begin ();
+ }
+
+ inline connection_ptr database::
+ connection ()
+ {
+ return connection_ptr (connection_ ());
+ }
+
template <typename T>
inline typename object_traits<T>::id_type database::
persist (T* p)