aboutsummaryrefslogtreecommitdiff
path: root/odb/tracer/database.hxx
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
commitbde4f5c3bddb437c5238bcb6dd2311bc57600ef1 (patch)
treee25658cc26cf40318847c60e8de01ac1720bd18a /odb/tracer/database.hxx
parent4c78c4b1e1a826a85468a4125813cec3dcbbbd06 (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/tracer/database.hxx')
-rw-r--r--odb/tracer/database.hxx17
1 files changed, 12 insertions, 5 deletions
diff --git a/odb/tracer/database.hxx b/odb/tracer/database.hxx
index 7210681..2468583 100644
--- a/odb/tracer/database.hxx
+++ b/odb/tracer/database.hxx
@@ -9,8 +9,9 @@
#include <odb/pre.hxx>
#include <odb/database.hxx>
-#include <odb/tracer/transaction-impl.hxx>
+#include <odb/tracer/connection.hxx>
+#include <odb/tracer/transaction-impl.hxx>
#include <odb/tracer/details/export.hxx>
namespace odb
@@ -20,14 +21,20 @@ namespace odb
class LIBODB_TRACER_EXPORT database: public odb::database
{
public:
+ typedef tracer::connection connection_type;
+
virtual
~database ();
- virtual unsigned long long
- execute (const char* statement, std::size_t length);
-
- virtual transaction_impl*
+ transaction_impl*
begin ();
+
+ connection_ptr
+ connection ();
+
+ protected:
+ virtual odb::connection*
+ connection_ ();
};
}
}