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

RDART-824 RDART-825 Add support for dynamic.getSet/getMap #1533

Merged
merged 6 commits into from Mar 4, 2024

Conversation

nirinchev
Copy link
Member

@nirinchev nirinchev commented Feb 29, 2024

Replaces #1305

Fixes #1324
Fixes #1323

Comment on lines 201 to 211
if (setMetadata != null && _isTypeGenericObject<T>()) {
switch (setMetadata.schema.baseType) {
case ObjectType.realmObject:
return object.realm.createSet<RealmObject>(handle, setMetadata);
case ObjectType.embeddedObject:
return object.realm.createSet<EmbeddedObject>(handle, setMetadata);
case ObjectType.asymmetricObject:
return object.realm.createSet<AsymmetricObject>(handle, setMetadata);
default:
throw RealmError('List of ${setMetadata.schema.baseType} is not supported yet');
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This rubs me the wrong way, but I get the point..

packages/realm_dart/lib/src/realm_object.dart Outdated Show resolved Hide resolved
packages/realm_dart/lib/src/realm_object.dart Outdated Show resolved Hide resolved
packages/realm_dart/lib/src/realm_object.dart Outdated Show resolved Hide resolved
throws<RealmException>(
"Property 'strings' on class 'AllCollections' is 'RealmCollectionType.list' but the method used to access it expected 'RealmCollectionType.none'."));
"Property 'stringList' on class 'AllCollections' is 'RealmCollectionType.list' but the method used to access it expected 'RealmCollectionType.none'."));
Copy link
Contributor

Choose a reason for hiding this comment

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

I hope we can give a better error message at some point, instead of leaking the internal representation stuff.

nirinchev and others added 3 commits March 4, 2024 16:36
Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>
@nirinchev nirinchev merged commit 003bbf4 into next-major Mar 4, 2024
53 of 55 checks passed
@nirinchev nirinchev deleted the ni/dynamic-collections branch March 4, 2024 20:40
@nirinchev nirinchev changed the title Add support for dynamic.getSet/getMap RDART-824 RDART-825 Add support for dynamic.getSet/getMap Mar 4, 2024
nirinchev added a commit that referenced this pull request Mar 6, 2024
* Update to Core next-major

* Update old-format file, update changelog

* Add support for collections in RealmValue (#1469)

* Initial stab at collections in mixed

* regenerate ffi bindings

* Add more tests

* Add notification tests

* Return the types

* Address some PR feedback

* Add RealmValueType

* Fix some tests

* Add query tests

* Add tests for indexOf/contains; add tests for sets

* Create a symlink for test data inside tests

* Add a few more tests

* Correct Core issue link

* enable notifications tests

* Enable some tests

* Re-generate ffi

* Fix test

* Added a changelog entry

* Update Core and reenable some tests

* Update core submodule

* Move cmake presets to root of repo

* Move cmake presets back in realm_dart

* Update Core

* Fix paths

* Regenerate ffi bindings

* Remove deprecated members (#1526)

* Update changelog

* Update paths in prepare-release.yml

* [Release 2.0.0-alpha.1] (#1527)

* [Release 2.0.0-alpha.1]

* fix paths

* Read package version from the correct file

* More release workflow fixes

* ..

* Remove some symlink removal

* tar the correct packages

---------

Co-authored-by: nirinchev <nirinchev@users.noreply.github.com>
Co-authored-by: Nikola Irinchev <irinchev@me.com>

* Fixes to the release process

* [Release 2.0.0-alpha.2] (#1528)

* [Release 2.0.0-alpha.2]

* Remove revived symlink

---------

Co-authored-by: nirinchev <nirinchev@users.noreply.github.com>
Co-authored-by: Nikola Irinchev <irinchev@me.com>

* Add support for dynamic.getSet/getMap (#1533)

* Add support for dynamic.getSet/getMap

* Fix test

* More test fixes

* Apply suggestions from code review

Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>

* Regenerate models

* Update changelog

---------

Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>

---------

Co-authored-by: Realm CI <robot@realm.io>
Co-authored-by: nirinchev <nirinchev@users.noreply.github.com>
Co-authored-by: Kasper Overgård Nielsen <kasper.nielsen@mongodb.com>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 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.

None yet

2 participants