Skip to content

Commit d07b733

Browse files
ObjectBox Swift database 5.1.1
1 parent c235394 commit d07b733

File tree

16 files changed

+159
-84
lines changed

16 files changed

+159
-84
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Notable changes to the ObjectBox Swift library.
44

55
For more insights into what changed in the ObjectBox C++ core, [check the ObjectBox C changelog](https://github.com/objectbox/objectbox-c/blob/main/CHANGELOG.md).
66

7+
## 5.1.1 - 2025-12-08
8+
9+
- Sync client: fix for encrypted (`wss://`) connections on iOS devices
10+
711
## 5.1.0 - 2025-12-03
812

913
Note: To support Xcode 26 and new Swift versions, the requirements have been raised to macOS 11.0 or iOS 15.0 and Swift 6.1 tools.

Example/NotesExample.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@
581581
repositoryURL = "https://github.com/objectbox/objectbox-swift-spm";
582582
requirement = {
583583
kind = upToNextMajorVersion;
584-
minimumVersion = 5.1.0;
584+
minimumVersion = 5.1.1;
585585
};
586586
};
587587
/* End XCRemoteSwiftPackageReference section */

Source/Gemfile.lock

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.7)
5-
base64
6-
nkf
7-
rexml
8-
activesupport (7.2.2.1)
4+
CFPropertyList (3.0.8)
5+
activesupport (7.2.3)
96
base64
107
benchmark (>= 0.3)
118
bigdecimal
@@ -17,15 +14,15 @@ GEM
1714
minitest (>= 5.1)
1815
securerandom (>= 0.3)
1916
tzinfo (~> 2.0, >= 2.0.5)
20-
addressable (2.8.7)
21-
public_suffix (>= 2.0.2, < 7.0)
17+
addressable (2.8.8)
18+
public_suffix (>= 2.0.2, < 8.0)
2219
algoliasearch (1.27.5)
2320
httpclient (~> 2.8, >= 2.8.3)
2421
json (>= 1.5.1)
2522
atomos (0.1.3)
26-
base64 (0.2.0)
27-
benchmark (0.4.0)
28-
bigdecimal (3.1.9)
23+
base64 (0.3.0)
24+
benchmark (0.5.0)
25+
bigdecimal (3.3.1)
2926
claide (1.1.0)
3027
cocoapods (1.16.2)
3128
addressable (~> 2.8)
@@ -66,11 +63,12 @@ GEM
6663
cocoapods-try (1.2.0)
6764
colored2 (3.1.2)
6865
concurrent-ruby (1.3.5)
69-
connection_pool (2.5.3)
70-
drb (2.2.1)
66+
connection_pool (3.0.2)
67+
drb (2.2.3)
7168
escape (0.0.4)
72-
ethon (0.16.0)
69+
ethon (0.18.0)
7370
ffi (>= 1.15.0)
71+
logger
7472
ffi (1.17.2)
7573
fourflusher (2.3.1)
7674
fuzzy_match (2.0.4)
@@ -79,8 +77,10 @@ GEM
7977
mutex_m
8078
i18n (1.14.7)
8179
concurrent-ruby (~> 1.0)
82-
jazzy (0.15.3)
80+
jazzy (0.15.4)
81+
activesupport (>= 5.0, < 8)
8382
cocoapods (~> 1.5)
83+
logger
8484
mustache (~> 1.1)
8585
open4 (~> 1.3)
8686
redcarpet (~> 3.4)
@@ -89,23 +89,22 @@ GEM
8989
sassc (~> 2.1)
9090
sqlite3 (~> 1.3)
9191
xcinvoke (~> 0.3.0)
92-
json (2.12.0)
92+
json (2.17.1)
9393
liferaft (0.0.6)
9494
logger (1.7.0)
9595
mini_portile2 (2.8.9)
96-
minitest (5.25.5)
96+
minitest (5.26.2)
9797
molinillo (0.8.0)
9898
mustache (1.1.1)
9999
mutex_m (0.3.0)
100100
nanaimo (0.4.0)
101101
nap (1.1.0)
102102
netrc (0.11.0)
103-
nkf (0.2.0)
104103
open4 (1.3.4)
105104
public_suffix (4.0.7)
106105
redcarpet (3.6.1)
107-
rexml (3.4.1)
108-
rouge (4.5.2)
106+
rexml (3.4.4)
107+
rouge (4.6.1)
109108
ruby-macho (2.5.1)
110109
sassc (2.4.0)
111110
ffi (~> 1.9)

Source/fetch_dependencies.command

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ set -e
1313

1414
# objectbox-swift release version on GitHub:
1515
# https://github.com/objectbox/objectbox-swift/releases/download/v${version}
16-
version=5.1.0
16+
version=5.1.1
1717

1818
# C library version attached to the GitHub release:
1919
# ObjectBoxCore-static-${c_version}.zip
20-
c_version=5.1.0
20+
c_version=5.1.1
2121

2222
# Params supported by apple-build-static-libs.sh
2323
if [ -n "$OBX_SKIP_STATIC_C_TESTS" ]; then

Source/ios-framework/CommonSource/Internal/objectbox-c-sync.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,13 +198,13 @@ OBX_C_API OBX_sync* obx_sync(OBX_store* store, const char* server_url);
198198
/// Passing multiple URLs allows high availability and load balancing (i.e. using a ObjectBox Sync Server Cluster).
199199
/// A random URL is selected for each connection attempt.
200200
/// For general details, see obx_sync()
201-
OBX_C_API OBX_sync* obx_sync_urls(OBX_store* store, const char* server_urls[], size_t server_urls_count);
201+
OBX_C_API OBX_sync* obx_sync_urls(OBX_store* store, const char* const server_urls[], size_t server_urls_count);
202202

203203
/// Creates a sync client associated with the given store, sync server URLs and SSL certificate paths.
204204
/// Like obx_sync_urls(), but also allows to pass SSL certificate paths referring to the local file system.
205205
/// Example use cases are using self-signed certificates in a local development environment and custom CAs.
206-
OBX_C_API OBX_sync* obx_sync_certs(OBX_store* store, const char* server_urls[], size_t server_urls_count,
207-
const char* cert_paths[], size_t cert_paths_count);
206+
OBX_C_API OBX_sync* obx_sync_certs(OBX_store* store, const char* const server_urls[], size_t server_urls_count,
207+
const char* const cert_paths[], size_t cert_paths_count);
208208

209209
/// Stops and closes (deletes) the sync client, freeing its resources.
210210
OBX_C_API obx_err obx_sync_close(OBX_sync* sync);

Source/ios-framework/CommonSource/Store.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public class Store: CustomDebugStringConvertible {
4343
internal(set) public var directoryPath: String
4444

4545
/// The version of this ObjectBox Swift SDK.
46-
public static var version = "5.1.0"
46+
public static var version = "5.1.1"
4747

4848
/// Pass this together with a String identifier as the directory path to use
4949
/// a file-less in-memory database.

Source/ios-framework/CommonTests/PropertyQueryTests.swift

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import XCTest
1818
@testable import ObjectBox
1919

20+
/// Tests property queries, so those created from a regular query with `Query.property()`.
2021
class PropertyQueryTests: XCTestCase {
2122

2223
var store: Store!
@@ -460,50 +461,5 @@ class PropertyQueryTests: XCTestCase {
460461
let uniqueResult = try propertyQuery.findUniqueString()!
461462
XCTAssertEqual(uniqueResult, "hold me tight")
462463
}
463-
464-
// MARK: - ByteVector
465-
466-
func testByteVectorQueries() throws {
467-
let firstBytes = Data("CAROLSHAW".utf8)
468-
let secondBytes = Data("EVELYNBOYDGRANVILLE".utf8)
469-
let thirdBytes = Data("MARYKENNETHKELLER".utf8)
470-
let entity1 = NullablePropertyEntity(byteVector: firstBytes)
471-
let entity2 = NullablePropertyEntity(maybeByteVector: firstBytes, byteVector: secondBytes)
472-
let entity3 = NullablePropertyEntity(maybeByteVector: secondBytes, byteVector: thirdBytes)
473-
try box.put([entity1, entity2, entity3])
474-
475-
XCTAssertEqual(try box.query({
476-
NullablePropertyEntity.maybeByteVector.isNil()
477-
}).build().find().count, 1)
478-
479-
XCTAssertEqual(try box.query({
480-
NullablePropertyEntity.maybeByteVector.isNotNil()
481-
}).build().find().count, 2)
482-
483-
let queryEqual = try box.query({ NullablePropertyEntity.maybeByteVector == secondBytes }).build()
484-
XCTAssertEqual(try queryEqual.findUnique()!.id, entity3.id)
485-
queryEqual.setParameter(NullablePropertyEntity.maybeByteVector, to: firstBytes)
486-
XCTAssertEqual(try queryEqual.findUnique()!.id, entity2.id)
487-
488-
XCTAssertEqual(try box.query({
489-
NullablePropertyEntity.maybeByteVector < secondBytes
490-
}).build().find().count, 1)
491-
492-
XCTAssertEqual(try box.query({
493-
NullablePropertyEntity.maybeByteVector > firstBytes
494-
}).build().find().count, 1)
495-
496-
XCTAssertEqual(try box.query({
497-
NullablePropertyEntity.byteVector == secondBytes
498-
}).build().find().count, 1)
499-
500-
XCTAssertEqual(try box.query({
501-
NullablePropertyEntity.byteVector < firstBytes
502-
}).build().find().count, 0)
503-
504-
XCTAssertEqual(try box.query({
505-
NullablePropertyEntity.byteVector > firstBytes
506-
}).build().find().count, 2)
507-
}
508464

509465
}

Source/ios-framework/CommonTests/QueryBuilderTests.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ func rethrow(_ error: Error) throws {
2121
throw error
2222
}
2323

24+
/// Tests find variants and query conditions. Legacy tests exist in ``QueryOperatorTests``, but have been ported here.
2425
class QueryBuilderTests: XCTestCase {
2526

2627
var store: Store!
@@ -163,7 +164,7 @@ class QueryBuilderTests: XCTestCase {
163164
}
164165
}
165166

166-
// MARK: - Find unique
167+
// MARK: - Count
167168

168169
func testCount_EmptyResults() throws {
169170
let personBox: Box<TestPerson> = store.box(for: TestPerson.self)
@@ -234,7 +235,7 @@ class QueryBuilderTests: XCTestCase {
234235
}
235236
}
236237

237-
// MARK: - Find by property: Equals
238+
// MARK: - Query conditions: Equals
238239

239240
class QueryBuilderFindByPropertyEqualTests: XCTestCase {
240241

@@ -390,7 +391,7 @@ class QueryBuilderFindByPropertyEqualTests: XCTestCase {
390391

391392
}
392393

393-
// MARK: - Find by property: Greater/Less
394+
// MARK: - Query conditions: Greater/Less
394395

395396
class QueryBuilderFindByPropertyGrLessTests: XCTestCase {
396397

@@ -587,6 +588,8 @@ class QueryBuilderFindByPropertyGrLessTests: XCTestCase {
587588

588589
}
589590

591+
// MARK: - Query conditions: Between
592+
590593
class QueryBuilderRangeTests: XCTestCase {
591594

592595
var store: Store!
@@ -773,6 +776,8 @@ class QueryBuilderRangeTests: XCTestCase {
773776

774777
}
775778

779+
// MARK: - Query conditions: In/StartsWith/EndsWith/Contains
780+
776781
class QueryBuilderCollectionTests: XCTestCase {
777782

778783
var store: Store!

Source/ios-framework/CommonTests/QueryOperatorTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import XCTest
1818
@testable import ObjectBox
1919

20+
/// These are legacy query condition tests. They have mostly been ported to `QueryBuilderTests.swift`.
2021
class QueryOperatorTests: XCTestCase {
2122

2223
var store: Store!

Source/ios-framework/CommonTests/QueryTests.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import XCTest
2020
// TODO can we have something like XCTAssertThrowsError but for fatal errors?
2121
// E.g. https://marcosantadev.com/test-swift-fatalerror
2222

23+
/// Tests the ``Query`` class. Note that tests for find and query conditions are in ``QueryBuilderTests``.
2324
class QueryTests: XCTestCase {
2425
var store: Store!
2526

@@ -34,8 +35,8 @@ class QueryTests: XCTestCase {
3435
store = nil
3536
super.tearDown()
3637
}
37-
38-
// MARK: - setParameter
38+
39+
// MARK: - Big objects
3940

4041
func testBigObjects() throws {
4142
let box: Box<TestPerson> = store.box(for: TestPerson.self)
@@ -68,6 +69,8 @@ class QueryTests: XCTestCase {
6869
XCTAssertEqual(2, Int(try box.removeAll()))
6970
XCTAssertEqual(try box.count(), 0)
7071
}
72+
73+
// MARK: - Visitor
7174

7275
func testFind_visitor() throws {
7376
let useVisitorValues = [true, false]
@@ -94,6 +97,8 @@ class QueryTests: XCTestCase {
9497
XCTAssertEqual(resultsContiguous[1].aLong, 200)
9598
}
9699
}
100+
101+
// MARK: - setParameter
97102

98103
func testSetParameter_Long_SingleParameter() throws {
99104
let box = store.box(for: AllTypesEntity.self)
@@ -577,6 +582,8 @@ class QueryTests: XCTestCase {
577582
query.setParameter("minAge", to: 21)
578583
XCTAssertEqual(try query.count(), 2)
579584
}
585+
586+
// MARK: - Other
580587

581588
func testRemoveQuery() throws {
582589
let personBox: Box<TestPerson> = store.box()

0 commit comments

Comments
 (0)