Skip to content

Commit 2ce9a27

Browse files
authored
Update to Realm Core 13.19.1 (#1493)
1 parent c8f3e0b commit 2ce9a27

File tree

11 files changed

+95
-7
lines changed

11 files changed

+95
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ if the content is the same. Custom implementations of these methods will be resp
4747
* Minimum Android SDK: 16.
4848

4949
### Internal
50-
* Updated to Realm Core 13.19.0, commit ea7c5d5e2900b8411a295aea3d1aa56aa55fff1d.
50+
* Updated to Realm Core 13.19.1, commit c258e2681bca5fb33bbd23c112493817b43bfa86.
5151

5252

5353
## 1.10.2 (2023-07-21)

packages/cinterop/src/commonMain/kotlin/io/realm/kotlin/internal/interop/ErrorCode.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ expect enum class ErrorCode : CodeDescription {
5757
RLM_ERR_SYNC_CLIENT_RESET_REQUIRED,
5858
RLM_ERR_SYNC_COMPENSATING_WRITE,
5959
RLM_ERR_SYNC_CONNECT_FAILED,
60+
RLM_ERR_SYNC_CONNECT_TIMEOUT,
6061
RLM_ERR_SYNC_INVALID_SCHEMA_CHANGE,
6162
RLM_ERR_SYNC_PERMISSION_DENIED,
6263
RLM_ERR_SYNC_PROTOCOL_INVARIANT_FAILED,

packages/cinterop/src/jvm/kotlin/io/realm/kotlin/internal/interop/ErrorCode.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ actual enum class ErrorCode(override val description: String, override val nativ
5454
RLM_ERR_SYNC_CLIENT_RESET_REQUIRED("SyncClientResetRequired", realm_errno_e.RLM_ERR_SYNC_CLIENT_RESET_REQUIRED),
5555
RLM_ERR_SYNC_COMPENSATING_WRITE("CompensatingWrite", realm_errno_e.RLM_ERR_SYNC_COMPENSATING_WRITE),
5656
RLM_ERR_SYNC_CONNECT_FAILED("SyncConnectFailed", realm_errno_e.RLM_ERR_SYNC_CONNECT_FAILED),
57+
RLM_ERR_SYNC_CONNECT_TIMEOUT("SyncConnectTimeout", realm_errno_e.RLM_ERR_SYNC_CONNECT_TIMEOUT),
5758
RLM_ERR_SYNC_INVALID_SCHEMA_CHANGE("SyncInvalidSchemaChange", realm_errno_e.RLM_ERR_SYNC_INVALID_SCHEMA_CHANGE),
5859
RLM_ERR_SYNC_PERMISSION_DENIED("SyncPermissionDenied", realm_errno_e.RLM_ERR_SYNC_PERMISSION_DENIED),
5960
RLM_ERR_SYNC_PROTOCOL_INVARIANT_FAILED("SyncProtocolInvariantFailed", realm_errno_e.RLM_ERR_SYNC_PROTOCOL_INVARIANT_FAILED),

packages/cinterop/src/nativeDarwin/kotlin/io/realm/kotlin/internal/interop/ErrorCode.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ actual enum class ErrorCode(
5858
RLM_ERR_SYNC_CLIENT_RESET_REQUIRED("SyncClientResetRequired", realm_errno.RLM_ERR_SYNC_CLIENT_RESET_REQUIRED),
5959
RLM_ERR_SYNC_COMPENSATING_WRITE("CompensatingWrite", realm_errno.RLM_ERR_SYNC_COMPENSATING_WRITE),
6060
RLM_ERR_SYNC_CONNECT_FAILED("SyncConnectFailed", realm_errno.RLM_ERR_SYNC_CONNECT_FAILED),
61+
RLM_ERR_SYNC_CONNECT_TIMEOUT("SyncConnectTimeout", realm_errno.RLM_ERR_SYNC_CONNECT_TIMEOUT),
6162
RLM_ERR_SYNC_INVALID_SCHEMA_CHANGE("SyncInvalidSchemaChange", realm_errno.RLM_ERR_SYNC_INVALID_SCHEMA_CHANGE),
6263
RLM_ERR_SYNC_PERMISSION_DENIED("SyncPermissionDenied", realm_errno.RLM_ERR_SYNC_PERMISSION_DENIED),
6364
RLM_ERR_SYNC_PROTOCOL_INVARIANT_FAILED("SyncProtocolInvariantFailed", realm_errno.RLM_ERR_SYNC_PROTOCOL_INVARIANT_FAILED),

packages/library-base/src/commonMain/kotlin/io/realm/kotlin/internal/Converters.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package io.realm.kotlin.internal
1818

1919
import io.realm.kotlin.UpdatePolicy
20+
import io.realm.kotlin.annotations.ExperimentalGeoSpatialApi
2021
import io.realm.kotlin.dynamic.DynamicMutableRealmObject
2122
import io.realm.kotlin.dynamic.DynamicRealmObject
2223
import io.realm.kotlin.ext.asRealmObject
@@ -36,6 +37,9 @@ import io.realm.kotlin.types.RealmAny
3637
import io.realm.kotlin.types.RealmInstant
3738
import io.realm.kotlin.types.RealmObject
3839
import io.realm.kotlin.types.RealmUUID
40+
import io.realm.kotlin.types.geo.GeoBox
41+
import io.realm.kotlin.types.geo.GeoCircle
42+
import io.realm.kotlin.types.geo.GeoPolygon
3943
import org.mongodb.kbson.BsonObjectId
4044
import org.mongodb.kbson.Decimal128
4145
import kotlin.native.concurrent.SharedImmutable
@@ -352,6 +356,7 @@ internal object RealmValueArgumentConverter {
352356
} ?: nullTransport()
353357
}
354358

359+
@OptIn(ExperimentalGeoSpatialApi::class)
355360
fun MemTrackingAllocator.convertQueryArg(value: Any?): RealmQueryArgument =
356361
when (value) {
357362
is Collection<*> -> {
@@ -374,6 +379,13 @@ internal object RealmValueArgumentConverter {
374379
}
375380
)
376381
}
382+
is GeoBox,
383+
is GeoCircle,
384+
is GeoPolygon -> {
385+
// Hack support for geospatial arguments until we have propert C-API support.
386+
// See https://github.com/realm/realm-core/pull/6934
387+
RealmQuerySingleArgument(kAnyToRealmValue(value.toString()))
388+
}
377389
else -> {
378390
RealmQuerySingleArgument(kAnyToRealmValue(value))
379391
}

packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/geo/GeoBox.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import io.realm.kotlin.internal.geo.UnmanagedGeoBox
2828
* val bottomLeft = GeoPoint.create(latitude = 5.0, longitude = 5.0)
2929
* val topRight = GeoPoint.create(latitude = 10.0, longitude = 10.0)
3030
* val searchArea = GeoBox.create(bottomLeft, topRight)
31-
* val restaurants = realm.query<Restaurant>("location GEOWITHIN $searchArea").find()
31+
* val restaurants = realm.query<Restaurant>("location GEOWITHIN $0", searchArea).find()
3232
* ```
3333
*/
3434
@ExperimentalGeoSpatialApi

packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/geo/GeoCircle.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import io.realm.kotlin.internal.geo.UnmanagedGeoCircle
2626
* ```
2727
* val newYork = GeoPoint.create(latitude = 40.730610, longitude = -73.935242)
2828
* val searchArea = GeoCircle.create(center = newYork, radius = Distance.fromMiles(2.0))
29-
* val restaurants = realm.query<Restaurant>("location GEOWITHIN $searchArea").find()
29+
* val restaurants = realm.query<Restaurant>("location GEOWITHIN $0", searchArea).find()
3030
* ```
3131
*/
3232
@ExperimentalGeoSpatialApi
@@ -47,6 +47,7 @@ public interface GeoCircle {
4747
* ```
4848
* val circle = GeoCircle.create(center = GeoPoint.create(0.0, 0.0), radius = Distance.fromKilometers(10.0))
4949
* val results = realm.query<Restaurant>("location GEOWITHIN $circle").find()
50+
* ```
5051
*/
5152
public override fun toString(): String
5253

packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/geo/GeoPoint.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ import io.realm.kotlin.internal.geo.UnmanagedGeoPoint
8888
*
8989
* val newYork = GeoPoint.create(latitude = 40.730610, longitude = -73.935242)
9090
* val searchArea = GeoCircle.create(center = newYork, radius = Distance.fromMiles(2.0))
91-
* val restaurants = realm.query<Restaurant>("location GEOWITHIN $searchArea").find()
91+
* val restaurants = realm.query<Restaurant>("location GEOWITHIN $0", searchArea).find()
9292
* ```
9393
*
9494
* A proper persistable GeoPoint class will be implemented in an upcoming release.

packages/library-base/src/commonMain/kotlin/io/realm/kotlin/types/geo/GeoPolygon.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ import io.realm.kotlin.internal.geo.UnmanagedGeoPolygon
6060
* GeoPoint.create(4.0, 1.0)
6161
* ))
6262
* )
63-
* val restaurants = realm.query<Restaurant>("location GEOWITHIN $searchArea").find()
63+
* val restaurants = realm.query<Restaurant>("location GEOWITHIN $0", searchArea).find()
6464
* * ```
6565
*/
6666
@ExperimentalGeoSpatialApi
@@ -88,7 +88,8 @@ public interface GeoPolygon {
8888
* GeoPoint.create(0.0, 0.0)
8989
* )
9090
* val searchArea = GeoPolygon.create(outerRing)
91-
* val results = realm.query<Restaurant>("location GEOWITHIN searchArea").find()
91+
* val results = realm.query<Restaurant>("location GEOWITHIN $searchArea").find()
92+
* ```
9293
*/
9394
override fun toString(): String
9495

0 commit comments

Comments
 (0)