Skip to content

feat(zero-client): add drop db to zero client#5579

Draft
0xcadams wants to merge 2 commits intomainfrom
0xcadams/drop-db
Draft

feat(zero-client): add drop db to zero client#5579
0xcadams wants to merge 2 commits intomainfrom
0xcadams/drop-db

Conversation

@0xcadams
Copy link
Member

The current docs are awkward about dropping all databases, and this is a core workflow for Zero client. Currently it requires passing the same kvStore as initialized in the Zero client. This adds a function on Zero to allow directly using the same params as passed to the Zero client to clear all DBs.

https://zero.rocicorp.dev/docs/auth#logging-out

@0xcadams 0xcadams requested review from aboodman and arv February 17, 2026 23:38
@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
replicache-docs Ready Ready Preview, Comment Feb 17, 2026 11:59pm
zbugs Ready Ready Preview, Comment Feb 17, 2026 11:59pm

Request Review

@github-actions
Copy link

github-actions bot commented Feb 17, 2026

🐰 Bencher Report

Branch0xcadams/drop-db
TestbedLinux
Click to view all benchmark results
BenchmarkFile SizeBenchmark Result
kilobytes (KB)
(Result Δ%)
Upper Boundary
kilobytes (KB)
(Limit %)
zero-package.tgz📈 view plot
🚷 view threshold
1,898.59 KB
(+0.01%)Baseline: 1,898.47 KB
1,936.44 KB
(98.05%)
zero.js📈 view plot
🚷 view threshold
248.04 KB
(+0.02%)Baseline: 247.99 KB
252.95 KB
(98.06%)
zero.js.br📈 view plot
🚷 view threshold
67.84 KB
(+0.03%)Baseline: 67.82 KB
69.18 KB
(98.06%)
🐰 View full continuous benchmarking report in Bencher

@github-actions
Copy link

github-actions bot commented Feb 17, 2026

🐰 Bencher Report

Branch0xcadams/drop-db
Testbedself-hosted
Click to view all benchmark results
BenchmarkThroughputBenchmark Result
operations / second (ops/s)
(Result Δ%)
Lower Boundary
operations / second (ops/s)
(Limit %)
1 exists: track.exists(album)📈 view plot
🚷 view threshold
13,043.18 ops/s
(-1.97%)Baseline: 13,305.10 ops/s
11,425.13 ops/s
(87.59%)
10 exists (AND)📈 view plot
🚷 view threshold
194,667.06 ops/s
(-1.05%)Baseline: 196,729.67 ops/s
172,193.23 ops/s
(88.46%)
10 exists (OR)📈 view plot
🚷 view threshold
3,777.14 ops/s
(-1.62%)Baseline: 3,839.24 ops/s
3,339.32 ops/s
(88.41%)
12 exists (AND)📈 view plot
🚷 view threshold
170,626.01 ops/s
(-2.24%)Baseline: 174,532.12 ops/s
151,179.11 ops/s
(88.60%)
12 exists (OR)📈 view plot
🚷 view threshold
3,229.38 ops/s
(-0.94%)Baseline: 3,259.87 ops/s
2,833.50 ops/s
(87.74%)
12 level nesting📈 view plot
🚷 view threshold
2,879.49 ops/s
(+1.31%)Baseline: 2,842.36 ops/s
2,472.66 ops/s
(85.87%)
2 exists (AND): track.exists(album).exists(genre)📈 view plot
🚷 view threshold
4,904.90 ops/s
(-2.20%)Baseline: 5,015.27 ops/s
4,355.92 ops/s
(88.81%)
3 exists (AND)📈 view plot
🚷 view threshold
1,976.00 ops/s
(+0.84%)Baseline: 1,959.61 ops/s
1,710.94 ops/s
(86.59%)
3 exists (OR)📈 view plot
🚷 view threshold
1,006.01 ops/s
(+2.68%)Baseline: 979.75 ops/s
852.45 ops/s
(84.74%)
5 exists (AND)📈 view plot
🚷 view threshold
316.45 ops/s
(+2.43%)Baseline: 308.94 ops/s
268.95 ops/s
(84.99%)
5 exists (OR)📈 view plot
🚷 view threshold
158.30 ops/s
(-2.61%)Baseline: 162.54 ops/s
140.55 ops/s
(88.79%)
Nested 2 levels: track > album > artist📈 view plot
🚷 view threshold
4,276.52 ops/s
(-2.15%)Baseline: 4,370.35 ops/s
3,853.40 ops/s
(90.11%)
Nested 4 levels: playlist > tracks > album > artist📈 view plot
🚷 view threshold
733.02 ops/s
(+1.90%)Baseline: 719.34 ops/s
632.31 ops/s
(86.26%)
Nested with filters: track > album > artist (filtered)📈 view plot
🚷 view threshold
3,607.71 ops/s
(-0.91%)Baseline: 3,640.81 ops/s
3,178.07 ops/s
(88.09%)
planned: playlist.exists(tracks)📈 view plot
🚷 view threshold
249.61 ops/s
(-43.11%)Baseline: 438.77 ops/s
10.91 ops/s
(4.37%)
planned: track.exists(album) OR exists(genre)📈 view plot
🚷 view threshold
122.76 ops/s
(-15.07%)Baseline: 144.54 ops/s
99.98 ops/s
(81.45%)
planned: track.exists(album) where title="Big Ones"📈 view plot
🚷 view threshold
6,549.20 ops/s
(-5.91%)Baseline: 6,960.53 ops/s
5,627.57 ops/s
(85.93%)
planned: track.exists(album).exists(genre)📈 view plot
🚷 view threshold
7.25 ops/s
(-69.65%)Baseline: 23.89 ops/s
-13.67 ops/s
(-188.56%)
planned: track.exists(album).exists(genre) with filters📈 view plot
🚷 view threshold
1,939.80 ops/s
(-47.31%)Baseline: 3,681.33 ops/s
-230.16 ops/s
(-11.87%)
planned: track.exists(playlists)📈 view plot
🚷 view threshold
1.60 ops/s
(-43.22%)Baseline: 2.82 ops/s
0.03 ops/s
(1.92%)
unplanned: playlist.exists(tracks)📈 view plot
🚷 view threshold
250.86 ops/s
(-41.47%)Baseline: 428.63 ops/s
11.28 ops/s
(4.50%)
unplanned: track.exists(album) OR exists(genre)📈 view plot
🚷 view threshold
19.59 ops/s
(-39.91%)Baseline: 32.60 ops/s
3.33 ops/s
(16.99%)
unplanned: track.exists(album) where title="Big Ones"📈 view plot
🚷 view threshold
52.92 ops/s
(-1.18%)Baseline: 53.55 ops/s
46.82 ops/s
(88.47%)
unplanned: track.exists(album).exists(genre)📈 view plot
🚷 view threshold
7.17 ops/s
(-69.83%)Baseline: 23.76 ops/s
-13.57 ops/s
(-189.20%)
unplanned: track.exists(album).exists(genre) with filters📈 view plot
🚷 view threshold
50.58 ops/s
(-2.86%)Baseline: 52.07 ops/s
45.20 ops/s
(89.36%)
unplanned: track.exists(playlists)📈 view plot
🚷 view threshold
1.61 ops/s
(-42.72%)Baseline: 2.82 ops/s
0.03 ops/s
(2.11%)
zpg: all playlists📈 view plot
🚷 view threshold
5.31 ops/s
(+5.03%)Baseline: 5.06 ops/s
2.62 ops/s
(49.28%)
zql: all playlists📈 view plot
🚷 view threshold
6.20 ops/s
(-9.39%)Baseline: 6.84 ops/s
4.93 ops/s
(79.55%)
zql: edit for limited query, inside the bound📈 view plot
🚷 view threshold
186,142.49 ops/s
(-7.17%)Baseline: 200,517.23 ops/s
173,651.85 ops/s
(93.29%)
zql: edit for limited query, outside the bound📈 view plot
🚷 view threshold
202,491.95 ops/s
(-3.28%)Baseline: 209,355.75 ops/s
182,991.32 ops/s
(90.37%)
zql: push into limited query, inside the bound📈 view plot
🚷 view threshold
113,990.85 ops/s
(+3.13%)Baseline: 110,525.97 ops/s
93,960.34 ops/s
(82.43%)
zql: push into limited query, outside the bound📈 view plot
🚷 view threshold
377,826.01 ops/s
(-3.31%)Baseline: 390,770.06 ops/s
328,147.55 ops/s
(86.85%)
zql: push into unlimited query📈 view plot
🚷 view threshold
407,421.35 ops/s
(+9.79%)Baseline: 371,088.94 ops/s
238,331.93 ops/s
(58.50%)
zqlite: all playlists📈 view plot
🚷 view threshold
1.57 ops/s
(-5.23%)Baseline: 1.66 ops/s
1.38 ops/s
(87.81%)
zqlite: edit for limited query, inside the bound📈 view plot
🚷 view threshold
66,700.80 ops/s
(-4.94%)Baseline: 70,169.38 ops/s
55,825.82 ops/s
(83.70%)
zqlite: edit for limited query, outside the bound📈 view plot
🚷 view threshold
67,279.50 ops/s
(-5.36%)Baseline: 71,088.65 ops/s
56,282.75 ops/s
(83.66%)
zqlite: push into limited query, inside the bound📈 view plot
🚷 view threshold
3,964.40 ops/s
(+2.49%)Baseline: 3,868.05 ops/s
3,453.41 ops/s
(87.11%)
zqlite: push into limited query, outside the bound📈 view plot
🚷 view threshold
81,692.56 ops/s
(-2.27%)Baseline: 83,591.64 ops/s
70,487.79 ops/s
(86.28%)
zqlite: push into unlimited query📈 view plot
🚷 view threshold
128,124.35 ops/s
(+2.75%)Baseline: 124,693.08 ops/s
108,330.73 ops/s
(84.55%)
🐰 View full continuous benchmarking report in Bencher

@github-actions
Copy link

github-actions bot commented Feb 17, 2026

🐰 Bencher Report

Branch0xcadams/drop-db
Testbedself-hosted
Click to view all benchmark results
BenchmarkThroughputBenchmark Result
operations / second (ops/s)
(Result Δ%)
Lower Boundary
operations / second (ops/s)
(Limit %)
src/client/custom.bench.ts > big schema📈 view plot
🚷 view threshold
131,304.00 ops/s
(-1.12%)Baseline: 132,793.79 ops/s
115,858.86 ops/s
(88.24%)
src/client/zero.bench.ts > basics > All 1000 rows x 10 columns (numbers)📈 view plot
🚷 view threshold
1,344.00 ops/s
(-30.32%)Baseline: 1,928.69 ops/s
652.12 ops/s
(48.52%)
src/client/zero.bench.ts > pk compare > pk = N📈 view plot
🚷 view threshold
56,495.03 ops/s
(-6.86%)Baseline: 60,656.54 ops/s
52,712.68 ops/s
(93.30%)
src/client/zero.bench.ts > with filter > Lower rows 500 x 10 columns (numbers)📈 view plot
🚷 view threshold
2,764.00 ops/s
(-14.22%)Baseline: 3,222.26 ops/s
1,997.88 ops/s
(72.28%)
🐰 View full continuous benchmarking report in Bencher

@aboodman
Copy link
Contributor

What happens if you delete data for an IDB Zero that is currently open?

There can be multiple Zero instances open for same datastore. If they just stop working that's OK with me. If the delete is blocked don't love that.

@0xcadams
Copy link
Member Author

What happens if you delete data for an IDB Zero that is currently open?

There can be multiple Zero instances open for same datastore. If they just stop working that's OK with me. If the delete is blocked don't love that.

It's a good question - I thought about just doing delete for only the current zero replicache db only, but we have this delete all that we recommend currently in docs. This should've been a draft PR - bringing it up for feedback.

I'll test this more.

@0xcadams 0xcadams marked this pull request as draft February 18, 2026 04:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants