Skip to content
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

RCORE-2198: Support for additional properties (#7519) #7886

Merged
merged 8 commits into from
Oct 25, 2024

Conversation

jedelbo
Copy link
Contributor

@jedelbo jedelbo commented Jul 12, 2024

  • Initial support for additional properties

This will allow some initial experiments in the SDKs. This is not a fileformat breaking change as we just use already existing features.


What, How & Why?

☑️ ToDos

  • 📝 Changelog update
  • 🚦 Tests (or not relevant)
  • C-API, if public C++ API changed
  • bindgen/spec.yml, if public C++ API changed

* Initial support for additional properties

This will allow some initial experiments in the SDKs. This is not a
fileformat breaking change as we just use already existing features.

---------

Co-authored-by: Claus Rørbech <[email protected]>
Co-authored-by: Kenneth Geisshirt <[email protected]>
@jedelbo jedelbo changed the title Initial support for additional properties (#7519) RCORE-2032: Support for additional properties (#7519) Jul 12, 2024
@jedelbo jedelbo changed the title RCORE-2032: Support for additional properties (#7519) RCORE-2198: Support for additional properties (#7519) Jul 12, 2024
Copy link

coveralls-official bot commented Jul 12, 2024

Pull Request Test Coverage Report for Build jorgen.edelbo_392

Details

  • 469 of 514 (91.25%) changed or added relevant lines in 18 files are covered.
  • 54 unchanged lines in 12 files lost coverage.
  • Overall coverage increased (+0.02%) to 91.11%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/realm/object-store/collection.cpp 0 2 0.0%
src/realm/object-store/c_api/config.cpp 0 3 0.0%
src/realm/object-store/c_api/object.cpp 117 124 94.35%
src/realm/object-store/object_accessor.hpp 26 42 61.9%
src/realm/obj.cpp 82 99 82.83%
Files with Coverage Reduction New Missed Lines %
src/realm/table.hpp 1 92.41%
src/realm/util/compression.cpp 1 89.81%
src/realm/array_with_find.hpp 2 98.56%
src/realm/table.cpp 3 90.72%
test/test_thread.cpp 3 66.14%
src/realm/util/file.cpp 4 84.84%
test/fuzz_tester.hpp 5 57.18%
test/object-store/util/sync/baas_admin_api.cpp 5 84.34%
src/realm/bplustree.cpp 6 73.08%
src/realm/sync/noinst/client_impl_base.cpp 6 82.88%
Totals Coverage Status
Change from base Build jorgen.edelbo_391: 0.02%
Covered Lines: 220424
Relevant Lines: 241931

💛 - Coveralls

@@ -631,6 +631,30 @@ BinaryData Obj::_get<BinaryData>(ColKey::Idx col_ndx) const
return ArrayBinary::get(alloc.translate(ref), m_row_ndx, alloc);
}

bool Obj::has_property(StringData prop_name) const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be useful to have a has_additional_property method.

kneth and others added 3 commits August 7, 2024 12:41
[bindgen] Expose Obj::has_schema_property(), TableRef::get_column_key(), and Obj::set_any_by_name()
* Fix bindgen typo
* Expose erase prop
* Expose Obj::get_additional_properties()

---------

Co-authored-by: Gagik Amaryan <[email protected]>
Co-authored-by: Gagik Amaryan <[email protected]>
@papafe
Copy link
Contributor

papafe commented Aug 12, 2024

During last check-in we decided we allow opening a realm with a different relaxed schema configuration. In particular:

  • Going from non-relaxed to relaxed should be always possible, even though with some performance issues due to the need to add the “extra properties column” to all tables.
  • Going from relaxed to non-relaxed will throw an exception from core.
    I wrote this as a reminder to do that.

@jedelbo jedelbo marked this pull request as ready for review October 17, 2024 12:48
@jedelbo jedelbo merged commit d5da3b9 into next-major Oct 25, 2024
21 of 45 checks passed
@jedelbo jedelbo deleted the feature/flexible-schema branch October 25, 2024 09:21
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants