Skip to content
This repository has been archived by the owner on Oct 10, 2021. It is now read-only.

Bump Realm from 10.3.0 to 10.6.0 #32

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dependabot[bot]
Copy link

@dependabot dependabot bot commented on behalf of github Oct 1, 2021

Bumps Realm from 10.3.0 to 10.6.0.

Release notes

Sourced from Realm's releases.

10.6.0 - Runtime schema definition

Enhancements

  • Added two extension methods on ISet to get an IQueryable collection wrapping the set:

    • set.AsRealmQueryable() allows you to get a IQueryable<T> from ISet<T> that can be then treated as a regular queryable collection and filtered/ordered with LINQ or Filter(string).
    • set.Filter(query, arguments) will filter the set and return the filtered collection. It is roughly equivalent to set.AsRealmQueryable().Filter(query, arguments).

    The resulting queryable collection will behave identically to the results obtained by calling realm.All<T>(), i.e. it will emit notifications when it changes and automatically update itself. (Issue #2555)

  • Added two new methods on Migration (Issue #2543):

    • RemoveType(typeName) allows to completely remove a type and its schema from a realm during a migration.
    • RenameProperty(typeName, oldPropertyName, newPropertyName) allows to rename a property during a migration.
  • A Realm Schema can now be constructed at runtime as opposed to generated automatically from the model classes. The automatic generation continues to work and should cover the needs of the vast majority of Realm users. Manually constructing the schema may be required when the shape of the objects depends on some information only known at runtime or in very rare cases where it may provide performance benefits by representing a collection of known size as properties on the class. (Issue #824)

    • RealmConfiguration.ObjectClasses has now been deprecated in favor of RealmConfiguration.Schema. RealmSchema has an implicit conversion operator from Type[] so code that previously looked like ObjectClasses = new[] { typeof(Foo), typeof(Bar) } can be trivially updated to Schema = new[] { typeof(Foo), typeof(Bar) }.
    • Property has been converted to a read-only struct by removing the setters from its properties. Those didn't do anything previously, so we don't expect anyone was using them.
    • Added several factory methods on Property to simplify declaration of Realm properties by being explicit about the range of valid options - e.g. Property.FromType<int>("IntProperty") or Property.Object("MyPersonProp", "Person"). The constructor of Property is now public to support advanced scenarios, but we recommend using the factory methods.
    • Made ObjectSchema.Builder public and streamlined its API. It allows you to construct a mutable representation of the schema of a single object and add/remove properties to it. You can either get an empty builder or you can see it with the information from an existing model class (i.e. inheriting from RealmObject or EmbeddedObject).
    • Made RealmSchema.Builder public and streamlined its API. It allows you to construct a mutable representation of the schema of an entire Realm and add/remove object schemas to it.
    • A simple example for how to use the new API would look like:
    public class Person : RealmObject
    {
      public string Name { get; set; }
      public Address Address { get; set; }
    }
    // Declare schema from existing model classes
    var config = new RealmConfiguration
    {
    Schema = new[] { typeof(Person), typeof(Address) }
    };
    // Manually construct a schema - we don't need to call .Build() on the builders
    // because we have implicit conversion operators defined that will call it for us.
    // Explicitly calling .Build() is also perfectly fine, if a little more verbose.
    var config = new RealmConfiguration
    {
    Schema = new RealmSchema.Builder
    {
    new ObjectSchema.Builder("MyClass", isEmbedded: false)
    {
    Property.FromType<int>("Id", isPrimaryKey: true),
    Property.PrimitiveDictionary("Tags", RealmValueType.String)
    },
    new ObjectSchema.Builder("EmbeddedClass", isEmbedded: true)
    {
    Property.Primitive("DateProp", RealmValueType.Date, isNullable: true)
    }
    }
    };
    // Enhance an existing model with new properties that will be accessible via

... (truncated)

Changelog

Sourced from Realm's changelog.

10.6.0 (2021-09-30)

Enhancements

  • Added two extension methods on ISet to get an IQueryable collection wrapping the set:

    • set.AsRealmQueryable() allows you to get a IQueryable<T> from ISet<T> that can be then treated as a regular queryable collection and filtered/ordered with LINQ or Filter(string).
    • set.Filter(query, arguments) will filter the set and return the filtered collection. It is roughly equivalent to set.AsRealmQueryable().Filter(query, arguments).

    The resulting queryable collection will behave identically to the results obtained by calling realm.All<T>(), i.e. it will emit notifications when it changes and automatically update itself. (Issue #2555)

  • Added two new methods on Migration (Issue #2543):

    • RemoveType(typeName) allows to completely remove a type and its schema from a realm during a migration.
    • RenameProperty(typeName, oldPropertyName, newPropertyName) allows to rename a property during a migration.
  • A Realm Schema can now be constructed at runtime as opposed to generated automatically from the model classes. The automatic generation continues to work and should cover the needs of the vast majority of Realm users. Manually constructing the schema may be required when the shape of the objects depends on some information only known at runtime or in very rare cases where it may provide performance benefits by representing a collection of known size as properties on the class. (Issue #824)

    • RealmConfiguration.ObjectClasses has now been deprecated in favor of RealmConfiguration.Schema. RealmSchema has an implicit conversion operator from Type[] so code that previously looked like ObjectClasses = new[] { typeof(Foo), typeof(Bar) } can be trivially updated to Schema = new[] { typeof(Foo), typeof(Bar) }.
    • Property has been converted to a read-only struct by removing the setters from its properties. Those didn't do anything previously, so we don't expect anyone was using them.
    • Added several factory methods on Property to simplify declaration of Realm properties by being explicit about the range of valid options - e.g. Property.FromType<int>("IntProperty") or Property.Object("MyPersonProp", "Person"). The constructor of Property is now public to support advanced scenarios, but we recommend using the factory methods.
    • Made ObjectSchema.Builder public and streamlined its API. It allows you to construct a mutable representation of the schema of a single object and add/remove properties to it. You can either get an empty builder or you can see it with the information from an existing model class (i.e. inheriting from RealmObject or EmbeddedObject).
    • Made RealmSchema.Builder public and streamlined its API. It allows you to construct a mutable representation of the schema of an entire Realm and add/remove object schemas to it.
    • A simple example for how to use the new API would look like:
    public class Person : RealmObject
    {
      public string Name { get; set; }
      public Address Address { get; set; }
    }
    // Declare schema from existing model classes
    var config = new RealmConfiguration
    {
    Schema = new[] { typeof(Person), typeof(Address) }
    };
    // Manually construct a schema - we don't need to call .Build() on the builders
    // because we have implicit conversion operators defined that will call it for us.
    // Explicitly calling .Build() is also perfectly fine, if a little more verbose.
    var config = new RealmConfiguration
    {
    Schema = new RealmSchema.Builder
    {
    new ObjectSchema.Builder("MyClass", isEmbedded: false)
    {
    Property.FromType<int>("Id", isPrimaryKey: true),
    Property.PrimitiveDictionary("Tags", RealmValueType.String)
    },
    new ObjectSchema.Builder("EmbeddedClass", isEmbedded: true)
    {
    Property.Primitive("DateProp", RealmValueType.Date, isNullable: true)
    }
    }
    };

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [Realm](https://github.com/realm/realm-dotnet) from 10.3.0 to 10.6.0.
- [Release notes](https://github.com/realm/realm-dotnet/releases)
- [Changelog](https://github.com/realm/realm-dotnet/blob/master/CHANGELOG.md)
- [Commits](realm/realm-dotnet@10.3.0...10.6.0)

---
updated-dependencies:
- dependency-name: Realm
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants