Skip to content

Commit 3b20942

Browse files
authored
Merge pull request #65 from wevm/sync-upstream-6
Sync rocicorp/mono main (fbdb27e)
2 parents 5dce0b3 + 2b5775b commit 3b20942

321 files changed

Lines changed: 12186 additions & 2134 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.changeset/sync-protocol-57.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'zero-swift': patch
3+
---
4+
5+
The client now speaks sync protocol 57, the version the JS client uses. Versions 54–57 only add query features the Swift client doesn't send yet (aggregates, `groupBy`, `distinct`, JSON path filters), so nothing else changes, and zero-cache keeps accepting older versions.

‎apps/zbugs-swift/Tests/ZBugsTests/DriftTests.swift‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import ZeroTesting
1313
.appendingPathComponent("drift-vectors.json"), encoding: .utf8)
1414
let failures = try Drift.failures(
1515
vectors: vectors, schema: .zbugs, queries: Queries.all, mutators: Mutators.all)
16-
#expect(failures == [])
16+
// Not ported yet: issueListCount is a count(), and the Swift client has no
17+
// aggregates. Exact, so this fails once it is ported and must be removed.
18+
#expect(failures == ["query issueListCount: no Swift definition"])
1719
}
1820
}

‎apps/zbugs-swift/Tests/ZBugsTests/drift-vectors.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"emojiChange",
1010
"issueDetail",
1111
"issueList",
12+
"issueListCount",
1213
"issueListV2",
1314
"issuePreloadV2",
1415
"labels",

‎apps/zbugs/db/drizzle-schema.ts‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,19 @@ export const issue = pgTable(
122122
table.modified,
123123
table.id,
124124
),
125+
// Let a count() of the public issues in a project (optionally open or
126+
// closed) be answered from the index alone.
127+
index('issue_projectID_open_visibility_idx').using(
128+
'btree',
129+
table.projectID,
130+
table.open,
131+
table.visibility,
132+
),
133+
index('issue_projectID_visibility_idx').using(
134+
'btree',
135+
table.projectID,
136+
table.visibility,
137+
),
125138
index('issue_creatorID_idx').using('btree', table.creatorID, table.id),
126139
index('issue_assigneeID_idx').using('btree', table.assigneeID, table.id),
127140
foreignKey({
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CREATE INDEX "issue_projectID_open_visibility_idx" ON "issue" USING btree ("projectID","open","visibility");--> statement-breakpoint
2+
CREATE INDEX "issue_projectID_visibility_idx" ON "issue" USING btree ("projectID","visibility");

0 commit comments

Comments
 (0)