userver: userver/storages/postgres/io/decimal64.hpp Source File
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
decimal64.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/storages/postgres/io/decimal64.hpp
4/// @brief decimal64::Decimal I/O support
5/// @ingroup userver_postgres_parse_and_format
6
7#include <userver/decimal64/decimal64.hpp>
8#include <userver/storages/postgres/io/buffer_io.hpp>
9#include <userver/storages/postgres/io/buffer_io_base.hpp>
10#include <userver/storages/postgres/io/numeric_data.hpp>
11#include <userver/storages/postgres/io/type_mapping.hpp>
12
13USERVER_NAMESPACE_BEGIN
14
15namespace storages::postgres::io {
16
17template <int Prec, typename RoundPolicy>
20 using BaseType =
22 using BaseType::BaseType;
23 using ValueType = typename BaseType::ValueType;
24
25 template <typename Buffer>
26 void operator()(const UserTypes&, Buffer& buffer) const {
27 auto bin_str =
31 }
32};
33
34template <int Prec, typename RoundPolicy>
37 using BaseType =
39 using BaseType::BaseType;
40 using ValueType = typename BaseType::ValueType;
41
42 void operator()(const FieldBuffer& buffer) {
45 }
46};
47
48template <int Prec, typename RoundPolicy>
49struct CppToSystemPg<decimal64::Decimal<Prec, RoundPolicy>>
50 : PredefinedOid<PredefinedOids::kNumeric> {};
51} // namespace storages::postgres::io
52
53USERVER_NAMESPACE_END