Skip to content

Commit

Permalink
Prepare for 11.1.0 (#3348)
Browse files Browse the repository at this point in the history
* Prepare for 11.1.0

* Fix docfx build, fix a bunch of typos

* Build docs for .netstandard 2.0

---------

Co-authored-by: nirinchev <[email protected]>
Co-authored-by: Nikola Irinchev <[email protected]>
  • Loading branch information
3 people authored Jun 17, 2023
1 parent 8191e9a commit 2585e7e
Show file tree
Hide file tree
Showing 29 changed files with 176 additions and 68 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## vNext (TBD)
## 11.1.0 (2023-06-17)

### Enhancements
* Deprecate the `Realm.SourceGenerator` and `Realm.Fody` packages. The source generation and weaver assemblies are now contained in the main `Realm` package. This should be a transparent change for users who only referenced the `Realm` package, but if you explicitly added a package reference to `Realm.SourceGenerator` or `Realm.Fody`, you should remove it. (PR [#3319](https://github.com/realm/realm-dotnet/pull/3319))
Expand Down
14 changes: 11 additions & 3 deletions Docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@
}
],
"dest": "obj/temp/api",
"filter": "filterConfig.yml"
"filter": "filterConfig.yml",
"properties": {
"TargetFramework": "netstandard2.0"
}
}
],
"build": {
Expand Down Expand Up @@ -65,7 +68,9 @@
]
}
],
"xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ],
"xrefService": [
"https://xref.docs.microsoft.com/query?uid={uid}"
],
"dest": "_site",
"globalMetadataFiles": [],
"globalMetadata": {
Expand All @@ -88,7 +93,10 @@
"../CHANGELOG.md": true
}
},
"template": [ "default", "template" ],
"template": [
"default",
"template"
],
"postProcessors": [],
"noLangKeyword": false,
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions Docs/filterConfig.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,9 @@ apiRules:
- exclude:
uidRegex: ^Realms\.Schema\.RealmSchema\.Builder\.GetKey
type: Method
- exclude:
uidRegex: ^Realms\.Sync\.Testing\.TestingExtensions
type: Type
- include:
hasAttribute:
uid: System.ComponentModel.EditorBrowsableAttribute
Expand Down
36 changes: 18 additions & 18 deletions Docs/linqsupport.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ var oldDogs = realm.All<Dog>().Where(dog => dog.Age > 8);
```

## Ordering Operators
[`OrderBy`](xref:System.Linq.Queryable.OrderBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), [`OrderByDescending`](xref:System.Linq.Queryable.OrderByDescending``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), [`Thenby`](xref:System.Linq.Queryable.ThenBy``2(System.Linq.IOrderedQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), and [`ThenByDescending`](xref:System.Linq.Queryable.ThenByDescending``2(System.Linq.IOrderedQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})) are all supported. [`Reverse`](xref:System.Linq.Queryable.Reverse``1(System.Linq.IQueryable{``0})) is not yet supported. Currently, you can only order by persisted properties on the class that you are querying. This means that `dogs.OrderBy(dog => dog.Owner.FirstName)` and the like is not yet supported.
[`OrderBy`](xref:System.Linq.Queryable.OrderBy``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), [`OrderByDescending`](xref:System.Linq.Queryable.OrderByDescending``2(System.Linq.IQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), [`Thenby`](xref:System.Linq.Queryable.ThenBy``2(System.Linq.IOrderedQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})), and [`ThenByDescending`](xref:System.Linq.Queryable.ThenByDescending``2(System.Linq.IOrderedQueryable{``0},System.Linq.Expressions.Expression{System.Func{``0,``1}})) are all supported. [`Reverse`](xref:System.Linq.Queryable.Reverse``1(System.Linq.IQueryable{``0})) is not yet supported. Currently, you can only order by persisted properties on the class that you are querying. This means that `dogs.OrderBy(dog => dog.Owner.FirstName)` and the like is not yet supported.

Example:

Expand Down Expand Up @@ -55,10 +55,10 @@ Note that, as is standard C# behaviour of [default(T)](https://msdn.microsoft.co

[`Any`](xref:System.Linq.Queryable.Any*) takes an optional predicate. To see the supported operations for predicates in Realm queries, refer to the [Predicate Operations](#predicate-operations) section.

## Aggregate Operators
## Aggregate Operators
[`Count`](xref:System.Linq.Queryable.Count*) is supported.

[`LongCount`](xref:System.Linq.Queryable.LongCount*), [`Sum`](xref:System.Linq.Queryable.Sum*), [`Min`](xref:System.Linq.Queryable.Min*), [`Max`](xref:System.Linq.Queryable.Max*), and [`Average`](xref:System.Linq.Queryable.Average*) are not yet supported.
[`LongCount`](xref:System.Linq.Queryable.LongCount*), [`Sum`](xref:System.Linq.Queryable.Sum*), [`Min`](xref:System.Linq.Queryable.Min*), [`Max`](xref:System.Linq.Queryable.Max*), and [`Average`](xref:System.Linq.Queryable.Average*) are not yet supported.

[`Count`](xref:System.Linq.Queryable.Count*) takes an optional predicate. To see the supported operations for predicates in Realm queries, refer to the [Predicate Operations](#predicate-operations) section.

Expand All @@ -79,7 +79,7 @@ class Person : RealmObject
}
```

Given this class, you can create queries with conditions that apply to the `FirstName` and `LastName` properties but not to the `FullName` property. Likewise, properties with the [`[Ignored]`](xref:Realms.IgnoredAttribute) attribute cannot be used.
Given this class, you can create queries with conditions that apply to the `FirstName` and `LastName` properties but not to the `FullName` property. Likewise, properties with the [`[Ignored]`](xref:Realms.IgnoredAttribute) attribute cannot be used.

Note that currently, the property must be the left side of a condition. This means that

Expand All @@ -92,31 +92,31 @@ is illegal and would have to be changed into the equivalent
```csharp
var oldDogs = realm.All<Dog>().Where(dog => dog.Age > 7); // Fixed
```

## Relational Operators
Equality operators can be applied to all property types: [==](https://msdn.microsoft.com/en-us/library/53k8ybth.aspx), [!=](https://msdn.microsoft.com/en-us/library/3tz250sf.aspx)

Furthermore, the following can be used for numerical types: [<](https://msdn.microsoft.com/en-us/library/z5wecxwa.aspx), [<=](https://msdn.microsoft.com/en-us/library/hx063734.aspx), [>](https://msdn.microsoft.com/en-us/library/yxk8751b.aspx), [>=](https://msdn.microsoft.com/en-us/library/a59bsyk4.aspx)

## String Operators
With strings, you can use:
[`Contains`](xref:System.String.Contains*), [`StartsWith`](xref:System.String.StartsWith*), and [`EndsWith`](xref:System.String.EndsWith*), [`Equals`](xref:System.String.Equals*), and [`Like`](xref:Realms.StringExtensions.Like*).
[`Contains`](xref:System.String.Contains*), [`StartsWith`](xref:System.String.StartsWith*), and [`EndsWith`](xref:System.String.EndsWith*), [`Equals`](xref:System.String.Equals*), and [`Like`](xref:Realms.QueryMethods.Like*).

Example:

```csharp
var peopleWhoseNameBeginsWithJ = realm.All<Person>.Where(p => p.FirstName.StartsWith("J"));
```

By default, Realm will perform a case-sensitive comparison, but you can provide [`StringComparison.OrdinalIgnoreCase`](xref:System.StringComparison.OrdinalIgnoreCase) argument to overwrite that. Since there is no overload for `Contains` that accepts `StringComparison`, we've provided a convenience [extension method](xref:Realms.StringExtensions.Contains*) that can be used when querying:
By default, Realm will perform a case-sensitive comparison, but you can provide [`StringComparison.OrdinalIgnoreCase`](xref:System.StringComparison.OrdinalIgnoreCase) argument to overwrite that. Since there is no overload for `Contains` that accepts `StringComparison` on older .NET frameworks, we've provided a [helper method](xref:Realms.QueryMethods.Contains*) that can be used when querying:

```csharp
var peopleWhoseNameContainsA = realm.All<Person>().Where(p => p.FirstName.Contains("a", StringComparison.OrdinalIgnoreCase));
var peopleWhoseNameContainsA = realm.All<Person>().Where(p => QueryMethods.Contains(p.FirstName, "a", StringComparison.OrdinalIgnoreCase));
```

The [`Like`](xref:Realms.StringExtensions.Like*) extension method can be used to compare a string property against a pattern. `?` and `*` are allowed as wildcard characters, where `?` matches 1 character and `*` matches 0 or more characters:
The [`Like`](xref:Realms.QueryMethods.Like*) query method can be used to compare a string property against a pattern. `?` and `*` are allowed as wildcard characters, where `?` matches 1 character and `*` matches 0 or more characters:
```csharp
var words = realm.All<Word>().Where(p => p.Value.Like("?bc*"));
var words = realm.All<Word>().Where(p => QueryMethods.Like(p.Value, "?bc*"));

// Matches abc, cbcde, but not bcd
```
Expand All @@ -134,10 +134,10 @@ var PuppyRexes = realm.All<Dog>().Where(dog => dog.Age < 2 && dog.Name == "Rex")

## A note on liveness

Realm queries are *live*, in the sense that they will continue to represent the current state of the database.
Realm queries are *live*, in the sense that they will continue to represent the current state of the database.

```csharp
realm.Write(() =>
realm.Write(() =>
{
realm.Add(new Person { FirstName = "John" });
realm.Add(new Person { FirstName = "Peter" });
Expand Down Expand Up @@ -167,7 +167,7 @@ However, it also differs from the behavior of LINQ to Objects, where every itera

```csharp
var recentLogEntries = realm.All<LogEntry>().Where(l => l.TimeStamp > DateTime.Now.AddHours(-1));
```
```

Here, the `recentLogEntries` variable will contain all the log entries that have a `TimeStamp` later than one hour before the time when the query was first run (via [foreach](https://msdn.microsoft.com/en-us/library/ttw7t8t6.aspx), [`ToList`](xref:System.Linq.Enumerable.ToList``1(System.Collections.Generic.IEnumerable{``0})) etc.). Newly added log entries will be included on subsequent runs, but the time they are compared to will not be updated.

Expand All @@ -178,10 +178,10 @@ The following features are not yet supported. A few of them will not be supporte
### Grouping Operators
[`GroupBy`](xref:System.Linq.Queryable.GroupBy*) is not supported.

### Set Operators
### Set Operators
[`Distinct`](xref:System.Linq.Queryable.Distinct*), [`Union`](xref:System.Linq.Queryable.Union*), [`Intersect`](xref:System.Linq.Queryable.Intersect*), and [`Except`](xref:System.Linq.Queryable.Except*) are not supported.

### Partitioning Operators
### Partitioning Operators
[`Take`](xref:System.Linq.Queryable.Take*), [`Skip`](xref:System.Linq.Queryable.Skip*), [`TakeWhile`](xref:System.Linq.Queryable.TakeWhile*), and [`SkipWhile`](xref:System.Linq.Queryable.SkipWhile*) are not yet supported.

These are less important than when using an ORM. Given Realm's zero-copy pattern, data is only read from the database when the properties on the objects are accessed, so there is little overhead in simply iterating over a part of a result.
Expand All @@ -197,10 +197,10 @@ var oldDogs = from d in realm.All<Dog>() where d.Age > 8 select d;
## Concatenation Operators
[`Concat`](xref:System.Linq.Queryable.Concat*) is not supported.

### Join Operators
[`Join`](xref:System.Linq.Queryable.Join*) and [`GroupJoin`](xref:System.Linq.Queryable.GroupJoin*) are not supported.
### Join Operators
[`Join`](xref:System.Linq.Queryable.Join*) and [`GroupJoin`](xref:System.Linq.Queryable.GroupJoin*) are not supported.

Note that joins are less vital when using Realm than when using a relational database and an ORM. Instead of using keys to identify relations, you simply refer to the related object.
Note that joins are less vital when using Realm than when using a relational database and an ORM. Instead of using keys to identify relations, you simply refer to the related object.

So given a class

Expand Down
49 changes: 49 additions & 0 deletions Realm.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -1,20 +1,69 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=abcde/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=adddefaulttypes/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=asyncopentask/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=autoimplemented/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=BEGINSWITH/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=brfalse/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Brtrue/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=caf_00E9/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ccfeee/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=cing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=CLONABLE/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=consts/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=corlib/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=criticalhandle/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=databinding/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=dereferenced/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=DEVDIV/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=dontuse/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=downcasting/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Evaluatable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=foos/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Formattable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=gchandle/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=geowithin/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ienum/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ienumerable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=inliner/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=irobj/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=keypath/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=keypaths/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Ldarg/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ldfld/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=ldstr/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Marshaler/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=namespaceanddescendants/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=nomoreuserthread/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=notificationtoken/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=nulled/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Queryables/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=refcounted/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=refcounting/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Reflectable/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=releasehandle/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Remotion/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=rfalse_002E/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=robj/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=rpath/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=sandboxing/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Stfld/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=subscriptionset/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=syncsession/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=syncuser/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=tablekey/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=t_0020rec/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unbindlist/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unbindlistlock/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unbindlockedlist/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unidirectionally/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unleaking/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unorderly/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Unsynced/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=unsynchronized/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Updatei/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=uppercased/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=upserted/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=whidbey/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=xcframework/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=_0020ldfl/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2 changes: 1 addition & 1 deletion Realm/AssemblyInfo.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Product Condition="'$(Product)' == ''">Realm .NET</Product>
<VersionPrefix>11.0.0</VersionPrefix>
<VersionPrefix>11.1.0</VersionPrefix>
<Description Condition="'$(Description)' == ''">Realm is a mobile database: a replacement for SQLite</Description>
<Company>Realm Inc.</Company>
<Copyright>Copyright © $([System.DateTime]::Now.ToString(yyyy)) Realm Inc.</Copyright>
Expand Down
1 change: 0 additions & 1 deletion Realm/Realm.SourceGenerator/Parser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
Expand Down
2 changes: 1 addition & 1 deletion Realm/Realm.Unity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "io.realm.unity",
"version": "11.0.0",
"version": "11.1.0",
"displayName": "Realm",
"description": "Realm is an embedded, object-oriented database that lets you build real-time, always-on applications. With Realm, data is directly exposed as objects and queryable by code, removing the need for ORM's riddled with performance & maintenance issues. Additionally, objects and collections in Realm are always live, meaning that they always reflect the latest data stored in the database. You can subscribe to changes, letting you keep your UI consistently up to date.\nThe .NET Realm SDK also provide access to Atlas App Services, a secure backend that can sync data between devices, authenticate and manage users, and run serverless JavaScript functions.",
"unity": "2021.1",
Expand Down
Loading

0 comments on commit 2585e7e

Please sign in to comment.