fixup compiler errors & finalize json (de-)serialization for values

Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
folling 2023-12-09 14:02:05 +01:00 committed by Folling
parent 7f24d3d064
commit e22bfba991
Signed by: folling
SSH key fingerprint: SHA256:S9qEx5WCFFLK49tE/LKnKuJYM5sw+++Dn6qJbbyxnCY
13 changed files with 116 additions and 58 deletions

View file

@ -91,8 +91,9 @@ IkarusPropertySource const * ikarus_property_get_source(IkarusProperty const * p
auto * ctx = property->get_project()->get_function_context();
VTRY(
VTRYRV(
auto const source,
nullptr,
property->get_project()
->get_db()
->query_one<int>("SELECT `source` FROM `properties` WHERE `id` = ?", property->get_id())
@ -129,8 +130,9 @@ IkarusValue * ikarus_property_get_default_value(IkarusProperty const * property)
auto * ctx = property->get_project()->get_function_context();
VTRY(
VTRYRV(
auto const value,
nullptr,
property->get_project()
->get_db()
->query_one<int>("SELECT `default_value` FROM `properties` WHERE `id` = ?", property->get_id())
@ -144,7 +146,7 @@ IkarusValue * ikarus_property_get_default_value(IkarusProperty const * property)
})
);
return new IkarusValue(property->get_project(), value);
return IkarusValue::from_json(value).unwrap_value_or(nullptr);
}
void ikarus_property_visit(