-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API question: other types #3
Comments
Hello @dsmyth , Just updated the readme with the list of supported data-types. :)
At the moment there is no roadmap for this. My estimations:
Also, if you'd like to contribute - I'll provide the necessary assistance. Best Regards, |
I'm willing to try adding arrays -- my current need is a float4 array.
In gdb:
Offset 58, 68, 70, 78 and 80 are the IEEE754 representation of the 4 byte floating point numbers in the field. Can you point me to how to parse this data structure? Here's my start at adding the deserializer method:
|
Hey @dsmyth , Please create a draft PR so that we can collaborate on this feature.
First, let's start by creating a template method for parsing arrays to Let's use JSON deserializer as a reference - See JSON array deserialization template<class Collection>
oatpp::Void Deserializer::deserializeArray(const Deserializer* _this, const InData& data, const Type* type) {
auto polymorphicDispatcher = static_cast<const typename Collection::Class::PolymorphicDispatcher*>(type->polymorphicDispatcher);
auto itemType = *type->params.begin(); // Get "wanted" type of the list item
// TODO - check that wanted itemType is compatible with the data OID item type.
if(data.isNull) {
// return nullptr with the type. - after we've checked the type.
return oatpp::Void(nullptr, type);
}
auto listWrapper = polymorphicDispatcher->createObject(); // Instantiate list of the "wanted" type
const auto& list = listWrapper.template staticCast<Collection>();
// TODO - read "InData data" and push items to list
return list;
} Then, reference this method by referencing it here - https://github.com/oatpp/oatpp-postgresql/blob/master/src/oatpp-postgresql/mapping/Deserializer.cpp#L72 - for Vector, List, and UnorderedSet |
In file: oatpp-postgresql/Types.hpp
Question
What is your roadmap for supporting other types? I'm particularly interested in json, jsonb and arrays (of floats).
Thanks -- Don
The text was updated successfully, but these errors were encountered: