From 2ae9b7da8f7cb1b57b4a3267e6033cc7db16e2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Claus=20R=C3=B8rbech?= Date: Fri, 5 Jul 2024 13:00:47 +0200 Subject: [PATCH] Expose relaxed schema configuration to C-API configuration --- src/realm.h | 5 +++++ src/realm/object-store/c_api/config.cpp | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/realm.h b/src/realm.h index aeb1b308a8b..1b41d474346 100644 --- a/src/realm.h +++ b/src/realm.h @@ -925,6 +925,11 @@ RLM_API bool realm_config_get_cached(realm_config_t*) RLM_API_NOEXCEPT; */ RLM_API void realm_config_set_automatic_backlink_handling(realm_config_t*, bool) RLM_API_NOEXCEPT; +/** + * Allow realm objects in the realm to have additional properties that are not defined in the schema. + */ +RLM_API void realm_config_set_flexible_schema(realm_config_t*, bool) RLM_API_NOEXCEPT; + /** * Create a custom scheduler object from callback functions. * diff --git a/src/realm/object-store/c_api/config.cpp b/src/realm/object-store/c_api/config.cpp index 7b1b00498c2..f335d276282 100644 --- a/src/realm/object-store/c_api/config.cpp +++ b/src/realm/object-store/c_api/config.cpp @@ -243,3 +243,9 @@ RLM_API void realm_config_set_automatic_backlink_handling(realm_config_t* realm_ { realm_config->automatically_handle_backlinks_in_migrations = enable_automatic_handling; } + +RLM_API void realm_config_set_flexible_schema(realm_config_t* realm_config, + bool flexible_schema) noexcept +{ + realm_config->flexible_schema = flexible_schema; +}