Skip to content

Commit b597a7c

Browse files
committed
Update to 0.9.0 JSON formatting, and explicit QueryBuilder.
1 parent ae61194 commit b597a7c

File tree

5 files changed

+106
-128
lines changed

5 files changed

+106
-128
lines changed

Example/NotesExample-iOS/NotesOverviewViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ class NotesOverviewViewController: UITableViewController {
2323
self.authorId = authorId
2424

2525
if let authorId = authorId {
26-
query = noteBox.query { Note.author == authorId }
26+
query = noteBox.query { Note.author == authorId }.build()
2727
} else {
28-
query = noteBox.query()
28+
query = noteBox.query().build()
2929
}
3030
}
3131

Example/NotesExample-macOS/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
3737
logger.append("\(noteBox.all().readableDescription)\n")
3838

3939
logger.append("Reading notes containing 'writing':")
40-
let allWritingNotes = noteBox.query { Note.text.contains("writing") }.find()
40+
let allWritingNotes = noteBox.query { Note.text.contains("writing") }.build().find()
4141
logger.append("\(allWritingNotes.readableDescription)\n")
4242

4343
logger.append("Reading notes containing 'writing' by Peter Brett:")
44-
let peterBrettsWritingNotes = noteBox.query { Note.text.contains("writing") && Note.author == peterBrett.id }.find()
44+
let peterBrettsWritingNotes = noteBox.query { Note.text.contains("writing") && Note.author == peterBrett.id }.build().find()
4545
logger.append("\(peterBrettsWritingNotes.readableDescription)\n")
4646

4747
logger.append("Looking into Peter Brett's current object state again ...")

Example/NotesExample.xcodeproj/project.pbxproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -596,6 +596,7 @@
596596
buildSettings = {
597597
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
598598
CODE_SIGN_STYLE = Automatic;
599+
ENABLE_BITCODE = NO;
599600
INFOPLIST_FILE = "NotesExample-iOS/Info.plist";
600601
LD_RUNPATH_SEARCH_PATHS = (
601602
"$(inherited)",
@@ -614,6 +615,7 @@
614615
buildSettings = {
615616
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
616617
CODE_SIGN_STYLE = Automatic;
618+
ENABLE_BITCODE = NO;
617619
INFOPLIST_FILE = "NotesExample-iOS/Info.plist";
618620
LD_RUNPATH_SEARCH_PATHS = (
619621
"$(inherited)",

Example/model-NotesExample-iOS.json

Lines changed: 50 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,88 +4,76 @@
44
"_note3" : "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
55
"entities" : [
66
{
7-
"id" : "1:712683617673955584",
8-
"lastPropertyId" : "2:5025387500910526208",
9-
"name" : "Author",
10-
"properties" : [
7+
"id": "1:712683617673955584",
8+
"lastPropertyId": "2:5025387500910526208",
9+
"name": "Author",
10+
"properties": [
1111
{
12-
"flags" : 1,
13-
"id" : "1:6336800942024279296",
14-
"name" : "id",
15-
"type" : 6
12+
"flags": 1,
13+
"id": "1:6336800942024279296",
14+
"name": "id",
15+
"type": 6
1616
},
1717
{
18-
"id" : "2:5025387500910526208",
19-
"name" : "name",
20-
"type" : 9
18+
"id": "2:5025387500910526208",
19+
"name": "name",
20+
"type": 9
2121
}
2222
],
23-
"relations" : [
24-
25-
]
23+
"relations": []
2624
},
2725
{
28-
"id" : "2:5608901830082711040",
29-
"lastPropertyId" : "6:6001769173142034944",
30-
"name" : "Note",
31-
"properties" : [
26+
"id": "2:5608901830082711040",
27+
"lastPropertyId": "6:6001769173142034944",
28+
"name": "Note",
29+
"properties": [
3230
{
33-
"flags" : 1,
34-
"id" : "1:7180411752564202752",
35-
"name" : "id",
36-
"type" : 6
31+
"flags": 1,
32+
"id": "1:7180411752564202752",
33+
"name": "id",
34+
"type": 6
3735
},
3836
{
39-
"id" : "2:249105953415333376",
40-
"name" : "title",
41-
"type" : 9
37+
"id": "2:249105953415333376",
38+
"name": "title",
39+
"type": 9
4240
},
4341
{
44-
"id" : "3:5661281725891017216",
45-
"name" : "text",
46-
"type" : 9
42+
"id": "3:5661281725891017216",
43+
"name": "text",
44+
"type": 9
4745
},
4846
{
49-
"id" : "4:8342334437465755392",
50-
"name" : "creationDate",
51-
"type" : 10
47+
"id": "4:8342334437465755392",
48+
"name": "creationDate",
49+
"type": 10
5250
},
5351
{
54-
"id" : "5:8881960381068888832",
55-
"name" : "modificationDate",
56-
"type" : 10
52+
"id": "5:8881960381068888832",
53+
"name": "modificationDate",
54+
"type": 10
5755
},
5856
{
59-
"flags" : 8,
60-
"id" : "6:6001769173142034944",
61-
"indexId" : "1:6069708401898380544",
62-
"name" : "author",
63-
"relationTarget" : "Author",
64-
"type" : 11
57+
"flags": 8,
58+
"id": "6:6001769173142034944",
59+
"indexId": "1:6069708401898380544",
60+
"name": "author",
61+
"relationTarget": "Author",
62+
"type": 11
6563
}
6664
],
67-
"relations" : [
68-
69-
]
65+
"relations": []
7066
}
7167
],
72-
"lastEntityId" : "2:5608901830082711040",
73-
"lastIndexId" : "1:6069708401898380544",
74-
"lastRelationId" : "0:0",
75-
"lastSequenceId" : "0:0",
76-
"modelVersion" : 5,
77-
"modelVersionParserMinimum" : 5,
78-
"retiredEntityUids" : [
79-
80-
],
81-
"retiredIndexUids" : [
82-
83-
],
84-
"retiredPropertyUids" : [
85-
86-
],
87-
"retiredRelationUids" : [
88-
89-
],
90-
"version" : 1
68+
"lastEntityId": "2:5608901830082711040",
69+
"lastIndexId": "1:6069708401898380544",
70+
"lastRelationId": "0:0",
71+
"lastSequenceId": "0:0",
72+
"modelVersion": 5,
73+
"modelVersionParserMinimum": 5,
74+
"retiredEntityUids": [],
75+
"retiredIndexUids": [],
76+
"retiredPropertyUids": [],
77+
"retiredRelationUids": [],
78+
"version": 1
9179
}

Example/model-NotesExample-macOS.json

Lines changed: 50 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -4,88 +4,76 @@
44
"_note3" : "If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.",
55
"entities" : [
66
{
7-
"id" : "1:712683617673955584",
8-
"lastPropertyId" : "2:5025387500910526208",
9-
"name" : "Author",
10-
"properties" : [
7+
"id": "1:712683617673955584",
8+
"lastPropertyId": "2:5025387500910526208",
9+
"name": "Author",
10+
"properties": [
1111
{
12-
"flags" : 1,
13-
"id" : "1:6336800942024279296",
14-
"name" : "id",
15-
"type" : 6
12+
"flags": 1,
13+
"id": "1:6336800942024279296",
14+
"name": "id",
15+
"type": 6
1616
},
1717
{
18-
"id" : "2:5025387500910526208",
19-
"name" : "name",
20-
"type" : 9
18+
"id": "2:5025387500910526208",
19+
"name": "name",
20+
"type": 9
2121
}
2222
],
23-
"relations" : [
24-
25-
]
23+
"relations": []
2624
},
2725
{
28-
"id" : "2:5608901830082711040",
29-
"lastPropertyId" : "6:6001769173142034944",
30-
"name" : "Note",
31-
"properties" : [
26+
"id": "2:5608901830082711040",
27+
"lastPropertyId": "6:6001769173142034944",
28+
"name": "Note",
29+
"properties": [
3230
{
33-
"flags" : 1,
34-
"id" : "1:7180411752564202752",
35-
"name" : "id",
36-
"type" : 6
31+
"flags": 1,
32+
"id": "1:7180411752564202752",
33+
"name": "id",
34+
"type": 6
3735
},
3836
{
39-
"id" : "2:249105953415333376",
40-
"name" : "title",
41-
"type" : 9
37+
"id": "2:249105953415333376",
38+
"name": "title",
39+
"type": 9
4240
},
4341
{
44-
"id" : "3:5661281725891017216",
45-
"name" : "text",
46-
"type" : 9
42+
"id": "3:5661281725891017216",
43+
"name": "text",
44+
"type": 9
4745
},
4846
{
49-
"id" : "4:8342334437465755392",
50-
"name" : "creationDate",
51-
"type" : 10
47+
"id": "4:8342334437465755392",
48+
"name": "creationDate",
49+
"type": 10
5250
},
5351
{
54-
"id" : "5:8881960381068888832",
55-
"name" : "modificationDate",
56-
"type" : 10
52+
"id": "5:8881960381068888832",
53+
"name": "modificationDate",
54+
"type": 10
5755
},
5856
{
59-
"flags" : 8,
60-
"id" : "6:6001769173142034944",
61-
"indexId" : "1:6069708401898380544",
62-
"name" : "author",
63-
"relationTarget" : "Author",
64-
"type" : 11
57+
"flags": 8,
58+
"id": "6:6001769173142034944",
59+
"indexId": "1:6069708401898380544",
60+
"name": "author",
61+
"relationTarget": "Author",
62+
"type": 11
6563
}
6664
],
67-
"relations" : [
68-
69-
]
65+
"relations": []
7066
}
7167
],
72-
"lastEntityId" : "2:5608901830082711040",
73-
"lastIndexId" : "1:6069708401898380544",
74-
"lastRelationId" : "0:0",
75-
"lastSequenceId" : "0:0",
76-
"modelVersion" : 5,
77-
"modelVersionParserMinimum" : 5,
78-
"retiredEntityUids" : [
79-
80-
],
81-
"retiredIndexUids" : [
82-
83-
],
84-
"retiredPropertyUids" : [
85-
86-
],
87-
"retiredRelationUids" : [
88-
89-
],
90-
"version" : 1
68+
"lastEntityId": "2:5608901830082711040",
69+
"lastIndexId": "1:6069708401898380544",
70+
"lastRelationId": "0:0",
71+
"lastSequenceId": "0:0",
72+
"modelVersion": 5,
73+
"modelVersionParserMinimum": 5,
74+
"retiredEntityUids": [],
75+
"retiredIndexUids": [],
76+
"retiredPropertyUids": [],
77+
"retiredRelationUids": [],
78+
"version": 1
9179
}

0 commit comments

Comments
 (0)