From 5b6649e6f7dd256147b48197a007c23001cef647 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sun, 21 Aug 2011 16:27:34 +0200 Subject: 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. --- odb/database.ixx | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'odb/database.ixx') 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 inline typename object_traits::id_type database:: persist (T* p) -- cgit v1.1