aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2014-11-21 07:28:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2014-11-21 07:28:16 +0200
commitdb3e2eb604c1d442cf473f2ba1bc95af547464c2 (patch)
treec966a8dfb7855866e7bc89e6d4ef9c5c5fb3560c
parentccc42660af3449d7e30c263014be67bbebab2964 (diff)
Add database-specific persist(const T&)bulk
-rw-r--r--odb/pgsql/database.hxx4
-rw-r--r--odb/pgsql/database.ixx7
2 files changed, 11 insertions, 0 deletions
diff --git a/odb/pgsql/database.hxx b/odb/pgsql/database.hxx
index dda8d31..c6bc05a 100644
--- a/odb/pgsql/database.hxx
+++ b/odb/pgsql/database.hxx
@@ -93,6 +93,10 @@ namespace odb
template <typename T>
typename object_traits<T>::id_type
+ persist (const T& object);
+
+ template <typename T>
+ typename object_traits<T>::id_type
persist (T* obj_ptr);
template <typename T, template <typename> class P>
diff --git a/odb/pgsql/database.ixx b/odb/pgsql/database.ixx
index 21b5729..5324fc8 100644
--- a/odb/pgsql/database.ixx
+++ b/odb/pgsql/database.ixx
@@ -27,6 +27,13 @@ namespace odb
template <typename T>
inline typename object_traits<T>::id_type database::
+ persist (const T& obj)
+ {
+ return persist_<const T, id_pgsql> (obj);
+ }
+
+ template <typename T>
+ inline typename object_traits<T>::id_type database::
persist (T* p)
{
typedef typename object_traits<T>::pointer_type object_pointer;