diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-25 17:28:38 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2024-01-25 17:28:38 +0300 |
commit | d9f372d7b1bc1abbff5fdf9735118290cd024d5e (patch) | |
tree | 49bc3160ea184e19cd5cb6a7404dee42311c0fd7 /libodb-pgsql/odb/pgsql/connection.ixx | |
parent | 55e14d8f9697adeeb05fcd23cf8f19c33452bb56 (diff) |
Turn libodb-pgsql repository into package for muti-package repositorylibodb-pgsql
Diffstat (limited to 'libodb-pgsql/odb/pgsql/connection.ixx')
-rw-r--r-- | libodb-pgsql/odb/pgsql/connection.ixx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/libodb-pgsql/odb/pgsql/connection.ixx b/libodb-pgsql/odb/pgsql/connection.ixx new file mode 100644 index 0000000..76d558b --- /dev/null +++ b/libodb-pgsql/odb/pgsql/connection.ixx @@ -0,0 +1,44 @@ +// file : odb/pgsql/connection.ixx +// license : GNU GPL v2; see accompanying LICENSE file + +namespace odb +{ + namespace pgsql + { + inline database& connection:: + database () + { + return static_cast<connection_factory&> (factory_).database (); + } + + template <typename T> + inline prepared_query<T> connection:: + prepare_query (const char* n, const char* q) + { + return prepare_query<T> (n, query<T> (q)); + } + + template <typename T> + inline prepared_query<T> connection:: + prepare_query (const char* n, const std::string& q) + { + return prepare_query<T> (n, query<T> (q)); + } + + template <typename T> + inline prepared_query<T> connection:: + prepare_query (const char* n, const pgsql::query_base& q) + { + return query_<T, id_pgsql>::call (*this, n, q); + } + + template <typename T> + inline prepared_query<T> connection:: + prepare_query (const char* n, const odb::query_base& q) + { + // Translate to native query. + // + return prepare_query<T> (n, pgsql::query_base (q)); + } + } +} |