|
Boost : |
From: Mohammad Nejati [ashtum] (ashtumashtum_at_[hidden])
Date: 2024-07-16 12:55:41
On Tue, Jul 16, 2024 at 3:47â¯PM Ruben Perez <rubenperez038_at_[hidden]> wrote:
> Yes! That's it. Actually, the mapping is one of the points I don't see any clearly after reading the protocol spec (and it looks like libpq doesn't solve it either, leaving you just a bunch of bytes/text to interpret). Do you have any ideas or any resources on how to approach the issue?
I found what is done in https://github.com/yandex/ozo inspiring. It
creates a compile-time map for standard types with fixed OIDs and a
runtime map for user-defined types, retrieving OID numbers from
PostgreSQL upon first use. Additionally, it exposes several type
traits for specialization, enabling the use of containers and wrapper
types for PostgreSQL types like:
template <typename ...Ts>
struct is_array<std::vector<Ts...>> : std::true_type {};
template <typename T>
struct is_nullable<std::optional<T>> : std::true_type {};
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk