diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-21 16:27:34 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-08-21 16:27:34 +0200 |
commit | 5b6649e6f7dd256147b48197a007c23001cef647 (patch) | |
tree | debffbb24e00bc485f9675cbc5be08ec1cc8eea9 /odb/database.ixx | |
parent | 1e63b60696f2e3012221e3bf6430a0d66ce1ba34 (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.ixx | 12 |
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) |