Skip to content

Commit 133b3e1

Browse files
committed
chroe: rename rivetkit-sqlite to depot-client
1 parent 8bac2e2 commit 133b3e1

38 files changed

Lines changed: 101 additions & 358 deletions

File tree

CLAUDE.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,17 @@ docker-compose up -d
113113

114114
### SQLite Package
115115

116-
- RivetKit SQLite is native-only: VFS and query execution live in `rivetkit-rust/packages/rivetkit-sqlite/`, core owns lifecycle, and NAPI only marshals JS types.
116+
- Depot client owns native SQLite VFS and query execution in `engine/packages/depot-client/`; core owns lifecycle, and NAPI only marshals JS types.
117+
- SQLite VFS direct tests should record workflow compaction wakes through `CompactionSignaler`, not call legacy `compact_default_batch`.
118+
- SQLite VFS correctness tests should use `DirectStorage`; do not reintroduce mock or envoy transport variants for those tests.
119+
- SQLite VFS `xSync` durability depends on depot's `sqlite_commit` reply waiting for the FDB transaction commit.
120+
- SQLite VFS process-global registrations must be owned by a Drop guard so panics unwind through `sqlite3_vfs_unregister`.
121+
- `NativeDatabase::Drop` must bound dirty-page flushes with a short timeout and return after logging if the commit future never resolves.
117122
- Actor2 workflows and envoy actors always use the SQLite v2 storage format; only old actor v1 workflows and pegboard runners use the v1 storage format. ("v2" here refers to the on-disk storage format, not envoy-protocol v2.)
118123
- Native SQLite VFS recent-page preload hints are actor-side Rust state surfaced by `NativeDatabase::snapshot_preload_hints()`; persist and consume them through runtime/envoy wiring, not JS APIs.
119124
- SQLite VFS file handles must enforce their reader or writer role; reader-owned handles fail closed on mutating callbacks.
120125
- Native SQLite single-statement work should route through the native execute path; keep `exec` as the multi-statement compatibility path.
121-
- Pegboard-envoy remote SQL execution should use `rivetkit-sqlite::database::open_database_from_engine` instead of direct `rusqlite` calls so native routing policy stays shared.
126+
- Native SQLite opens should use `depot_client::database::open_database_from_envoy` instead of direct `rusqlite` calls so native routing policy stays shared.
122127
- Pegboard-envoy remote SQL executor caches should use `Arc<OnceCell<NativeDatabaseHandle>>` values so first-use initialization stays lazy and single-flight per `(actor_id, sqlite_generation)`.
123128
- Sent remote SQL requests must fail with `sqlite.remote_indeterminate_result` on WebSocket disconnect; only unsent remote SQL may be sent after reconnect.
124129
- Native SQLite manual transactions keep an idle writer open until autocommit returns; route subsequent work through the writer instead of reader classification.

Cargo.lock

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ members = [
6363
"rivetkit-rust/packages/actor-persist",
6464
"rivetkit-rust/packages/rivetkit-core",
6565
"rivetkit-rust/packages/shared-types",
66-
"rivetkit-rust/packages/rivetkit-sqlite",
67-
"rivetkit-rust/packages/rivetkit-sqlite-types",
66+
"engine/packages/depot-client",
67+
"engine/packages/depot-client-types",
6868
"rivetkit-typescript/packages/rivetkit-napi",
6969
"rivetkit-typescript/packages/rivetkit-wasm"
7070
]
@@ -558,11 +558,11 @@ members = [
558558
[workspace.dependencies.rivetkit-inspector-protocol]
559559
path = "rivetkit-rust/packages/inspector-protocol"
560560

561-
[workspace.dependencies.rivetkit-sqlite]
562-
path = "rivetkit-rust/packages/rivetkit-sqlite"
561+
[workspace.dependencies.depot-client]
562+
path = "engine/packages/depot-client"
563563

564-
[workspace.dependencies.rivetkit-sqlite-types]
565-
path = "rivetkit-rust/packages/rivetkit-sqlite-types"
564+
[workspace.dependencies.depot-client-types]
565+
path = "engine/packages/depot-client-types"
566566

567567
[workspace.dependencies.rivetkit-core]
568568
path = "rivetkit-rust/packages/rivetkit-core"

docs-internal/engine/sqlite-vfs.md

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,13 @@
1-
# SQLite VFS parity
1+
# SQLite VFS
22

3-
Rules for the SQLite VFS implementations.
3+
Rules for the SQLite VFS implementation.
44

55
## Package boundaries
66

7-
- RivetKit SQLite is native-only. VFS and query execution live in `rivetkit-rust/packages/rivetkit-sqlite/`, core owns lifecycle, and NAPI only marshals JS types.
8-
- RivetKit TypeScript SQLite is exposed through `@rivetkit/rivetkit-napi`, but runtime behavior stays in `rivetkit-rust/packages/rivetkit-sqlite/` and `rivetkit-core`.
9-
- The Rust KV-backed SQLite implementation lives in `rivetkit-rust/packages/rivetkit-sqlite/src/`. When changing its on-disk or KV layout, update the internal data-channel spec in the same change.
10-
11-
## Native VFS ↔ WASM VFS parity
12-
13-
**The native Rust VFS and the WASM TypeScript VFS must match 1:1.** This includes:
14-
15-
- KV key layout and encoding
16-
- Chunk size
17-
- PRAGMA settings
18-
- VFS callback-to-KV-operation mapping
19-
- Delete/truncate strategy (both must use `deleteRange`)
20-
- Journal mode
21-
22-
When changing any VFS behavior in one implementation, update the other.
23-
24-
- Native: `rivetkit-rust/packages/rivetkit-sqlite/src/vfs.rs`, `kv.rs`
25-
- WASM: `rivetkit-typescript/packages/sqlite-wasm/src/vfs.ts`, `kv.ts`
26-
27-
The native VFS uses the same 4 KiB chunk layout and KV key encoding as the WASM VFS. Data is compatible between backends.
7+
- Depot client owns native SQLite VFS and query execution in `engine/packages/depot-client/`. Core owns lifecycle, and NAPI only marshals JS types.
8+
- RivetKit TypeScript SQLite is exposed through `@rivetkit/rivetkit-napi`, but runtime behavior stays in `engine/packages/depot-client/` and `rivetkit-core`.
9+
- The Rust KV-backed SQLite implementation lives in `engine/packages/depot-client/src/`. When changing its on-disk or KV layout, update the internal data-channel spec in the same change.
10+
- The VFS uses a 4 KiB chunk layout for page storage. PRAGMAs are pinned at open: `journal_mode = DELETE`, `locking_mode = EXCLUSIVE`, `auto_vacuum = NONE`. Source: `engine/packages/depot-client/src/vfs.rs`.
2811

2912
## VFS implementation notes
3013

docs-internal/engine/sqlite/vfs-brief.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ The VFS does not write local SQLite database files. Local files would break the
2828

2929
- [SQLite VFS](../sqlite-vfs.md)
3030
- [Depot crash course](../depot.md)
31-
- VFS source: `rivetkit-rust/packages/rivetkit-sqlite/src/`
31+
- VFS source: `engine/packages/depot-client/src/`
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "rivetkit-sqlite-types"
2+
name = "depot-client-types"
33
version.workspace = true
44
authors.workspace = true
55
license.workspace = true
66
edition.workspace = true
77
workspace = "../../../"
8-
description = "Shared SQLite execution types for RivetKit"
8+
description = "Shared SQLite execution types for depot client"
99

1010
[lib]
1111
crate-type = ["lib"]

rivetkit-rust/packages/rivetkit-sqlite-types/src/lib.rs renamed to engine/packages/depot-client-types/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Shared SQLite execution types for local and remote RivetKit backends.
1+
//! Shared SQLite execution types for local and remote depot client backends.
22
33
#[derive(Clone, Debug, PartialEq)]
44
pub enum BindParam {

rivetkit-rust/packages/rivetkit-sqlite/Cargo.toml renamed to engine/packages/depot-client/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "rivetkit-sqlite"
2+
name = "depot-client"
33
version.workspace = true
44
edition.workspace = true
55
authors.workspace = true
66
license.workspace = true
77
workspace = "../../../"
8-
description = "Native SQLite VFS for RivetKit backed by depot"
8+
description = "Depot-backed native SQLite VFS client"
99

1010
[lib]
1111
crate-type = ["lib"]
@@ -18,7 +18,7 @@ tokio.workspace = true
1818
tracing.workspace = true
1919
getrandom = "0.2"
2020
rivet-envoy-protocol.workspace = true
21-
rivetkit-sqlite-types.workspace = true
21+
depot-client-types.workspace = true
2222
moka = { version = "0.12", default-features = false, features = ["sync"] }
2323
parking_lot.workspace = true
2424

rivetkit-rust/packages/rivetkit-sqlite/src/connection_manager.rs renamed to engine/packages/depot-client/src/connection_manager.rs

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)