-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathCargo.toml
More file actions
192 lines (169 loc) · 6.92 KB
/
Copy pathCargo.toml
File metadata and controls
192 lines (169 loc) · 6.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
[workspace]
# Pure-Rust library crate at the root + C-FFI / loadable-extension crate
# in `turbolite-ffi/`. Consumers who only need the Rust API pull in the
# root crate; C / Python / Node / Go / loadable-ext consumers pull in
# turbolite-ffi's cdylib.
members = [".", "turbolite-ffi"]
[package]
name = "turbolite"
version = "0.5.0"
edition = "2021"
description = "turbolite - SQLite VFS with sub-50ms cold queries from S3 + page-level compression and encryption"
license = "Apache-2.0"
repository = "https://github.com/russellromney/turbolite"
keywords = ["sqlite", "compression", "encryption", "vfs", "zstd"]
categories = ["database", "compression"]
[features]
# sqlite-plugin is the VFS backend. It needs libclang at build time (bindgen).
default = ["zstd", "bundled-sqlite"]
bundled-sqlite = ["dep:rusqlite", "rusqlite/bundled", "rusqlite/functions", "dep:libsqlite3-sys"]
zstd = ["dep:zstd"]
lz4 = ["dep:lz4_flex"]
snappy = ["dep:snap"]
gzip = ["dep:flate2"]
encryption = ["dep:aes-gcm", "dep:aes", "dep:ctr", "dep:sha2"]
parallel = []
# Binaries in this package that want an S3-backed StorageBackend pull in
# hadb-storage-s3 through this feature. The library itself never depends
# on a concrete backend; it only knows hadb-storage (the trait).
cli-s3 = ["dep:hadb-storage-s3"]
# Benchmark binaries still reference the pre-Anvil-g API surface
# (storage_backend, s3_counters, destroy_s3). Gated separately so
# `cli-s3` alone doesn't pull them into `cargo build` / `cargo test`.
# Rewire is a follow-up.
bench-s3 = ["cli-s3"]
# WAL replication requires an S3 backend for walrust to ship segments to.
# When turning on `wal` the concrete S3 impl must be compiled in too.
wal = ["dep:walrust-core", "cli-s3"]
lambda = ["dep:lambda_runtime", "bench-s3", "zstd"]
[dependencies]
# VFS backend. `send_guard` makes parking_lot guards Send so TurboliteHandle
# (which holds a replay-gate read guard) satisfies sqlite-plugin's
# `VfsHandle: Send` bound.
sqlite-plugin = { version = "0.10.1", default-features = false, features = ["static"] }
zstd = { version = "0.13", optional = true }
lz4_flex = { version = "0.11", optional = true }
snap = { version = "1.1", optional = true }
flate2 = { version = "1.0", optional = true }
thiserror = "1"
# send_guard: makes parking_lot guards Send so TurboliteHandle satisfies
# sqlite-plugin's `VfsHandle: Send` bound (it holds a replay-gate read guard).
parking_lot = { version = "0.12", features = ["arc_lock", "send_guard"] }
flume = "0.11"
arc-swap = "1"
fs2 = "0.4"
file-guard = "0.2"
once_cell = "1"
# Encryption (optional)
aes-gcm = { version = "0.10", optional = true }
aes = { version = "0.8", optional = true }
ctr = { version = "0.9", optional = true }
sha2 = { version = "0.10", optional = true }
# Non-optional: also used for VFS xRandomness (CSPRNG), not just encryption.
rand = "0.8"
# Parallel compression (optional)
rayon = "1.10"
# Storage abstraction (trait only, concrete backends are picked by consumers).
hadb-storage = "0.4.0"
# LocalStorage is the zero-dep backend used by TurboliteVfs::new. Conceptually a
# sibling of any other backend; it lives in hadb so other crates can share it.
hadb-storage-local = "0.4.0"
async-trait = { version = "0.1" }
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time"] }
tracing = "0.1"
libc = "0.2"
# Concrete storage backend for binaries that talk to S3 (CLI, benchmarks).
# Library code never references this crate.
hadb-storage-s3 = { version = "0.4.0", optional = true }
# CLI dependencies
clap = { version = "4", features = ["derive", "env"] }
clap_complete = "4"
anyhow = "1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
rusqlite = { version = "0.35", features = ["backup"], optional = true }
libsqlite3-sys = { version = "0.33", features = ["bundled"], optional = true }
tempfile = "3"
ureq = "2"
rustyline = "15"
atty = "0.2"
lambda_runtime = { version = "0.13", optional = true }
# WAL replication via walrust's core crate (optional). Use the git source until
# the crate.io release exposes the sink/snapshot APIs Turbolite needs.
walrust-core = { git = "https://github.com/russellromney/walrust.git", version = "0.3.1", optional = true, package = "walrust", branch = "hoist-public-deps" }
rmp-serde = "1.3.1"
# Canonical encoding for the Turbolite manifest wire format. ciborium
# produces RFC 8949 §4.2 deterministically-encoded CBOR when used with
# `ciborium::ser::into_writer` on a serde-derived value whose field
# order is fixed and whose integers use smallest-length encoding — needed
# for BLAKE3 hash stability across implementations.
ciborium = "0.2"
# Cryptographic hash for the chain link primitive. BLAKE3 chosen for
# canonical-byte hashing of manifest and delta objects (replay cursor
# / chain verifier).
blake3 = "1"
# serde helper so Vec<u8> serializes as a CBOR byte string (major type
# 2) instead of a CBOR array of u8s (major type 4). Used for the
# 32-byte BLAKE3 hash inside ReplayCursor.base_object_checksum so the
# encoding is compact (~34 bytes vs ~64) and matches the wire-level
# meaning of "a byte string", not "a sequence of small integers".
serde_bytes = "0.11"
[dev-dependencies]
rayon = "1.10"
rmp-serde = "1.3.1"
proptest = "1.5"
proptest-derive = "0.5"
arbitrary = { version = "1.3", features = ["derive"] }
rusqlite = { version = "0.35", features = ["bundled"] }
aws-config = "1"
aws-sdk-s3 = "1"
crc32fast = "1"
# In-memory StorageBackend for tests; avoids the need for a real S3 or even a
# filesystem round-trip.
hadb-storage-mem = "0.4.0"
tokio = { version = "1", features = ["rt-multi-thread", "sync", "time", "macros"] }
# Binary targets are all gated on cli-s3 during Phase Turbogenesis c3. They
# still reference the old StorageBackend enum / bucket-prefix config
# surface and are being rewired in c5.
[[bin]]
name = "turbolite"
path = "bin/turbolite.rs"
required-features = ["cli-s3"]
[[bin]]
name = "turbolite-bench"
path = "benchmark/turbolite-bench.rs"
required-features = ["bench-s3"]
[[bin]]
name = "tiered-bench"
path = "benchmark/tiered-bench.rs"
required-features = ["bench-s3"]
[[bin]]
name = "tpch-bench"
path = "benchmark/tpch-bench.rs"
required-features = ["bench-s3", "zstd"]
[[bin]]
name = "write-bench"
path = "benchmark/write-bench.rs"
required-features = ["bench-s3", "zstd"]
[[bin]]
name = "bench-validate"
path = "benchmark/bench-validate.rs"
required-features = ["bench-s3", "zstd"]
[[bin]]
name = "tiered-tune"
path = "benchmark/tiered-tune.rs"
required-features = ["bench-s3"]
[build-dependencies]
cc = "1"
# Belt-and-suspenders for the C-FFI boundary: abort on panic in release
# builds (the shipping cdylib). Every extern "C" body already wraps itself in
# catch_unwind and maps a panic to an error sentinel, so a panic should never
# reach this; if one ever escapes the guard, aborting is defined behavior
# whereas unwinding across C is UB. Test/dev builds keep unwinding so the
# harness can catch panics.
[profile.release]
panic = "abort"
[[example]]
name = "quick-bench"
path = "benchmark/quick-bench.rs"
required-features = ["encryption"]