libpqxx  7.2.0
prepared_statement.hxx
1 /* Helper classes for defining and executing prepared statements.
2  *
3  * See the connection class for more about prepared statements.
4  *
5  * Copyright (c) 2000-2020, Jeroen T. Vermeulen.
6  *
7  * See COPYING for copyright license. If you did not receive a file called
8  * COPYING with this source code, please notify the distributor of this
9  * mistake, or contact the author.
10  */
11 #ifndef PQXX_H_PREPARED_STATEMENT
12 #define PQXX_H_PREPARED_STATEMENT
13 
14 #include "pqxx/compiler-public.hxx"
15 #include "pqxx/internal/compiler-internal-pre.hxx"
16 
17 #include "pqxx/internal/statement_parameters.hxx"
18 #include "pqxx/types.hxx"
19 
20 
22 namespace pqxx::prepare
23 {
25 
40 template<typename IT>
41 [[nodiscard]] constexpr inline auto make_dynamic_params(IT begin, IT end)
42 {
43  return pqxx::internal::dynamic_params(begin, end);
44 }
45 
46 
48 
62 template<typename C>
63 [[nodiscard]] constexpr inline auto make_dynamic_params(C const &container)
64 {
65  using IT = typename C::const_iterator;
66  return pqxx::internal::dynamic_params<IT>{container};
67 }
68 
69 
71 
86 template<typename C, typename ACCESSOR>
87 [[nodiscard]] constexpr inline auto
88 make_dynamic_params(C &container, ACCESSOR accessor)
89 {
90  using IT = decltype(std::begin(container));
91  return pqxx::internal::dynamic_params<IT, ACCESSOR>{container, accessor};
92 }
93 } // namespace pqxx::prepare
94 
95 #include "pqxx/internal/compiler-internal-post.hxx"
96 #endif
constexpr auto make_dynamic_params(IT begin, IT end)
Pass a number of statement parameters only known at runtime.
Definition: prepared_statement.hxx:41
Dedicated namespace for helper types related to prepared statements.
Definition: prepared_statement.hxx:22