diff options
Diffstat (limited to 'odb/database.hxx')
-rw-r--r-- | odb/database.hxx | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/odb/database.hxx b/odb/database.hxx index bc7a10b..c4458d9 100644 --- a/odb/database.hxx +++ b/odb/database.hxx @@ -15,6 +15,7 @@ #include <odb/forward.hxx> #include <odb/query.hxx> #include <odb/result.hxx> +#include <odb/connection.hxx> #include <odb/exceptions.hxx> #include <odb/details/export.hxx> @@ -152,19 +153,31 @@ namespace odb unsigned long long execute (const std::string& statement); - virtual unsigned long long - execute (const char* statement, std::size_t length) = 0; + unsigned long long + execute (const char* statement, std::size_t length); + + // Transactions. + // + public: + transaction_impl* + begin (); - // Transaction API. + // Connections. // public: - virtual transaction_impl* - begin () = 0; + connection_ptr + connection (); protected: database (); protected: + typedef odb::connection connection_type; + + virtual connection_type* + connection_ () = 0; + + protected: template <typename T> typename object_traits<T>::id_type persist_ (const typename object_traits<T>::pointer_type&); |