diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2021-06-16 11:28:56 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2021-06-29 11:11:44 +0200 |
commit | 7b51842728b6ee99945afe401fca317c703a12d9 (patch) | |
tree | 7ed893517f793928679254a74cd7b28479556f4f /odb/pgsql/database.hxx | |
parent | c6019273a7564be9ed772d45aa95e09aaff37a23 (diff) |
Add support for bulk operations using pipeline mode in libpq 14
Diffstat (limited to 'odb/pgsql/database.hxx')
-rw-r--r-- | odb/pgsql/database.hxx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/odb/pgsql/database.hxx b/odb/pgsql/database.hxx index d3b805d..fcb3ad3 100644 --- a/odb/pgsql/database.hxx +++ b/odb/pgsql/database.hxx @@ -124,6 +124,13 @@ namespace odb typename object_traits<T>::id_type persist (const typename object_traits<T>::pointer_type& obj_ptr); + // Bulk persist. Can be a range of references or pointers (including + // smart pointers) to objects. + // + template <typename I> + void + persist (I begin, I end, bool continue_failed = true); + // Load an object. Throw object_not_persistent if not found. // template <typename T> @@ -210,6 +217,13 @@ namespace odb void update (const typename object_traits<T>::pointer_type& obj_ptr); + // Bulk update. Can be a range of references or pointers (including + // smart pointers) to objects. + // + template <typename I> + void + update (I begin, I end, bool continue_failed = true); + // Update a section of an object. Throws the section_not_loaded // exception if the section is not loaded. Note also that this // function does not clear the changed flag if it is set. @@ -253,6 +267,19 @@ namespace odb void erase (const typename object_traits<T>::pointer_type& obj_ptr); + // Bulk erase. + // + template <typename T, typename I> + void + erase (I id_begin, I id_end, bool continue_failed = true); + + // Can be a range of references or pointers (including smart pointers) + // to objects. + // + template <typename I> + void + erase (I obj_begin, I obj_end, bool continue_failed = true); + // Erase multiple objects matching a query predicate. // template <typename T> |