fixup compiler errors & finalize json (de-)serialization for values
Signed-off-by: Folling <mail@folling.io>
This commit is contained in:
parent
7f24d3d064
commit
e22bfba991
13 changed files with 116 additions and 58 deletions
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue