Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
375 lines (337 loc) · 13.7 KB
/
Copy pathCargo.toml
File metadata and controls
375 lines (337 loc) · 13.7 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
[workspace]
resolver = "2"
members = [
"pg",
"pg/crates/kalam-pg-common",
"pg/crates/kalam-pg-api",
"pg/crates/kalam-pg-fdw",
"pg/crates/kalam-pg-types",
"pg/crates/kalam-pg-client",
"backend/crates/kalamdb-macros",
"backend/crates/kalamdb-commons",
"backend/crates/kalamdb-serialization",
"backend/crates/kalamdb-row-filter",
"backend/crates/kalamdb-configs",
"backend/crates/kalamdb-filestore",
"backend/crates/kalamdb-transfer",
"backend/crates/kalamdb-flush",
"backend/crates/kalamdb-streams",
"backend/crates/kalamdb-sharding",
"backend/crates/kalamdb-session",
"backend/crates/kalamdb-session-datafusion",
"backend/crates/kalamdb-transactions",
"backend/crates/kalamdb-backend",
"backend/crates/kalamdb-datafusion-sources",
"backend/crates/kalamdb-system",
"backend/crates/kalamdb-tables",
"backend/crates/kalamdb-rls",
"backend/crates/kalamdb-dba",
"backend/crates/kalamdb-observability",
"backend/crates/kalamdb-vector",
"backend/crates/kalamdb-core",
"backend/crates/kalamdb-live",
"backend/crates/kalamdb-handlers",
"backend/crates/kalamdb-handlers/crates/support",
"backend/crates/kalamdb-handlers/crates/admin",
"backend/crates/kalamdb-handlers/crates/ddl",
"backend/crates/kalamdb-handlers/crates/stream",
"backend/crates/kalamdb-handlers/crates/user",
"backend/crates/kalamdb-jobs",
"backend/crates/kalamdb-plan-cache",
"backend/crates/kalamdb-publisher",
"backend/crates/kalamdb-dialect",
"backend/crates/kalamdb-functions",
"backend/crates/kalamdb-functions-host",
"backend/crates/kalamdb-store",
"backend/crates/kalamdb-api",
"backend/crates/kalamdb-auth",
"backend/crates/kalamdb-raft",
"backend/crates/kalamdb-views",
"backend/crates/kalamdb-pg",
"backend/crates/kalamdb-pg-bridge",
"backend/crates/kalamdb-postgres-wire",
"backend/crates/kalamdb-server-auth",
"backend",
"cli",
"cli/crates/kalam-schema-diff",
"cli/kalam-cli-e2e",
"link/link-common",
"link/sdks/rust",
"link/sdks/rust/examples/quickstart",
"link/sdks/rust-e2e",
"link/kalam-link-wasm",
"link/kalam-consumer-wasm",
"link/kalam-link-dart",
"link/sdks/python",
]
exclude = ["benchv2"]
[workspace.package]
version = "0.8.0"
edition = "2021"
rust-version = "1.99.1"
authors = ["KalamDB Team"]
license = "Apache-2.0"
repository = "https://github.com/kalamdb/KalamDB"
# Shared dependencies for all crates
[workspace.dependencies]
# Serialization
serde = { version = "1.0.229", features = ["derive", "rc"] }
serde_json = "1.0.154"
handlebars = "6.4.4"
# Error handling
thiserror = "2.0.21"
anyhow = "1.0.104"
# Logging
log = "0.4.34"
# Async runtime
tokio = { version = "1.53.3", features = ["rt-multi-thread", "macros", "sync", "time", "fs", "io-util", "io-std", "net", "signal", "parking_lot"] }
tokio-netem = "0.1.1"
tokio-stream = { version = "0.1.19", features = ["net"] }
# HTTP client (with HTTP/2 support). 0.12 matches object_store 0.13 / openidconnect 4.
# rustls-tls-native-roots matches object_store so we do not also compile webpki-roots 1.x.
# Note: native-tls requires OpenSSL which is difficult to cross-compile for aarch64
reqwest = { version = "0.12.28", default-features = false, features = ["json", "rustls-tls-native-roots", "http2", "multipart", "stream"] }
hyper = { version = "1.11.1", default-features = false, features = ["client", "http1"] }
hyper-util = { version = "0.1.21", default-features = false, features = ["client", "client-legacy", "http1", "tokio"] }
url = "2.5.8"
# WebSocket
tokio-tungstenite = { version = "0.30.0", features = ["rustls-tls-native-roots"] }
# Security floor pins for vulnerable transitive TLS/QUIC crates.
aws-lc-rs = { version = "1.18.2", default-features = false }
rustls = { version = "0.23.46", default-features = false }
rustls-native-certs = "0.8.5"
quinn-proto = { version = "0.11.19", default-features = false }
rustls-webpki = { version = "0.103.15", default-features = false }
# Time handling
croner = "4.0.1"
chrono-tz = "0.10"
chrono = { version = "0.4.45", features = ["serde"] }
# Storage
# Lz4 stays compiled so existing SST files can be read; new writes use Zstd only (cf_tuning.rs).
# Table COMPRESSION='snappy' is Parquet (`snap`), not RocksDB.
rocksdb = { version = "0.25.0", default-features = false, features = ["lz4", "zstd", "multi-threaded-cf", "bindgen-runtime"] }
# Apache Arrow ecosystem
# Bump the four DataFusion crates together, then `cargo update -p datafusion`.
# Arrow, Parquet, and sqlparser are lower bounds only. DataFusion's own
# requirements are the ceiling, so those crates follow a DataFusion bump
# without an edit here. A caret pin such as "59.2.0" would cap them below
# the next Arrow major and force a second edit.
arrow = { version = ">=59.2.0", default-features = false }
arrow-ipc = { version = ">=59.2.0", default-features = false }
arrow-schema = { version = ">=59.2.0" }
datafusion = { version = "55.2.0", default-features = false, features = ["sql", "parquet", "recursive_protection", "nested_expressions", "unicode_expressions"] }
datafusion-datasource = { version = "55.2.0", default-features = false }
datafusion-common = { version = "55.2.0", default-features = false }
datafusion-expr = { version = "55.2.0" }
datafusion-functions-json = "0.55.6"
sqlparser = { version = ">=0.62.0" }
parquet = { version = ">=59.2.0", default-features = false, features = ["snap", "zstd", "arrow", "async"] }
# Web framework
# Cookies, routing macros, HTTP/2, and WebSocket stay on. The three default
# content-encoding crates are not used; responses are not wrapped in
# actix_web::middleware::Compress. actix-ws still enables the `ws` feature.
actix-web = { version = "4.17.0", default-features = false, features = ["macros", "cookies", "http2", "unicode", "compat", "ws"] }
actix-ws = "0.4.0"
actix-cors = "0.7.2"
# actix-web / actix-server depend on actix-rt with default-features = false.
# Pin net+signal here and depend on this crate from kalamdb-api so unification
# enables TcpStream and Unix signal handlers.
actix-rt = { version = "2.15.0", features = ["macros", "net", "signal"] }
actix-files = "0.7.2"
actix-multipart = "0.8.5"
# UUID generation
uuid = { version = "1.28.0", features = ["v4", "v7", "serde"] }
# NanoID generation (21-char URL-safe unique IDs)
nanoid = "0.5.0"
# ULID generation
ulid = "3.0.0"
# JWT authentication
jsonwebtoken = { version = "11.1.0", default-features = false, features = ["aws_lc_rs"] }
# rustls-tls would enable reqwest/rustls-tls (webpki-roots). TLS comes from workspace reqwest.
openidconnect = { version = "4.0.1", default-features = false, features = ["reqwest"] }
# Configuration
toml = "1.1.2"
dotenv = "0.15"
# CLI tools
clap = { version = "4.6.7", features = ["derive", "color"] }
console = { version = "0.16.6", default-features = false, features = ["unicode-width"] }
humantime = "2.4.0"
# 19.0.0 calls cfg_select!, which was unstable before the 1.99.1 MSRV.
rustyline = { version = "18.0.1" }
shlex = "2.0.1"
# System
num_cpus = "1.16"
sysinfo = { version = "0.38.4", default-features = false, features = ["system", "disk"] }
hostname = "0.4"
# Testing
tempfile = "3.27.0"
wait-timeout = "0.2"
serial_test = "4.0.1"
testcontainers-modules = { version = "0.15.0", default-features = false, features = ["dex"] }
# Benchmarking
criterion = { version = "0.8.2", features = ["html_reports"] }
# Raft consensus
openraft = { version = "0.9.25", features = ["serde", "storage-v2"] }
rmp = "0.8"
rmp-serde = "1.3"
# gRPC for Raft network layer
tonic = { version = "0.14.6" }
tonic-prost = "0.14.6"
tonic-build = "0.14.5"
prost = "0.14.4"
prost-types = "0.14.4"
# Additional dependencies
bcrypt = "0.19.3"
rand = "0.10.3"
rcgen = "0.14.10"
x509-parser = "0.18.1"
kalamdb-commons = { path = "backend/crates/kalamdb-commons", default-features = false }
kalamdb-serialization = { path = "backend/crates/kalamdb-serialization" }
kalamdb-observability = { path = "backend/crates/kalamdb-observability", default-features = false }
link-common = { path = "link/link-common", default-features = false }
kalam-client = { path = "link/sdks/rust", default-features = false }
# Stay on the 0.29 line. jiter 0.17's optional binding uses PyO3 0.29, and only
# one pyo3-ffi can link `python` in this workspace.
pyo3 = "0.29.2"
pyo3-async-runtimes = "0.29.0"
kalamdb-row-filter = { path = "backend/crates/kalamdb-row-filter" }
kalamdb-transfer = { path = "backend/crates/kalamdb-transfer" }
kalamdb-plan-cache = { path = "backend/crates/kalamdb-plan-cache" }
kalamdb-backend = { path = "backend/crates/kalamdb-backend" }
kalamdb-postgres-wire = { path = "backend/crates/kalamdb-postgres-wire" }
kalamdb-tables = { path = "backend/crates/kalamdb-tables" }
kalamdb-rls = { path = "backend/crates/kalamdb-rls" }
kalamdb-views = { path = "backend/crates/kalamdb-views" }
kalamdb-datafusion-sources = { path = "backend/crates/kalamdb-datafusion-sources" }
kalamdb-functions = { path = "backend/crates/kalamdb-functions" }
colored = "3.1.1"
fern = "0.7"
indicatif = "0.18.6"
rpassword = "7.5.4"
dirs = "7.0.0"
term_size = "0.3"
crossterm = "0.29.0"
assert_cmd = "2.2.2"
predicates = "3.1.4"
futures-util = { version = "0.3.34", default-features = false }
base64 = "0.23.1"
flatbuffers = "25.12.19"
flexbuffers = "25.9.23"
async-trait = "0.1.92"
once_cell = "1.21.4"
regex = "1.13.1"
dashmap = "6.2.1"
arc-swap = "1.9.3"
smallvec = "1.16.3"
pgwire = { version = "0.41.1", default-features = false, features = ["server-api-aws-lc-rs", "pg-type-chrono"] }
bytes = "1.12.1"
http-body = "1.1.0"
http-body-util = "0.1.5"
cc = "1.6.0"
proc-macro2 = "1.0.107"
quote = "1.0.47"
syn = { version = "3.0.9", features = ["full", "extra-traits"] }
# Object storage abstraction (S3/GCS/Azure/local)
object_store = { version = "0.14.2" }
# Vector ANN engines
usearch = "2.26.5"
parking_lot = "0.12"
tokio-util = "0.7.20"
hex = "0.4"
hmac = "0.13.0"
sha2 = "0.11.1"
oxc_allocator = "=0.139.0"
oxc_ast = "=0.139.0"
oxc_parser = "=0.139.0"
oxc_span = "=0.139.0"
storekey = "0.11"
moka = { version = "0.12.16", features = ["future", "sync"] }
ntest = "0.10.0"
ipnet = "2.12.2"
wasm-bindgen = { version = "0.2.129" }
wasm-bindgen-futures = { version = "0.4.79" }
js-sys = { version = "0.3.105" }
libc = "0.2.191"
libmimalloc-sys = { version = "0.1.49", features = ["extended"] }
web-sys = { version = "0.3.106" }
tsify = { version = "0.5.6", default-features = false, features = ["js"] }
serde-wasm-bindgen = "0.6.5"
flate2 = "1.1.10"
tar = "0.4.46"
zip = { version = "9.0.5", default-features = false, features = ["deflate"] }
miniz_oxide = "0.9.1"
flutter_rust_bridge = "=2.13.0"
rust-embed = { version = "8.13.0", features = ["compression", "include-exclude"] }
mime_guess = "2.0"
kalamdb-configs = { path = "backend/crates/kalamdb-configs" }
# Keep default-features false here so kalam-client-e2e cannot re-enable
# embedded-ui through feature unification (Cargo ignores per-dep overrides).
kalamdb-server = { path = "backend", default-features = false }
pgrx = "=0.18.1"
pgrx-bench = "=0.18.1"
pgrx-tests = "=0.18.1"
tokio-postgres = "0.7.18"
# Tracing / observability
tracing = "0.1"
v8 = "152.2.0"
tracing-subscriber = { version = "0.3.23", features = ["env-filter", "json", "fmt"] }
tracing-actix-web = "0.7.25"
tracing-log = "0.2"
tracing-opentelemetry = "0.34.0"
opentelemetry = "0.33.1"
opentelemetry_sdk = { version = "0.33.1", features = ["trace", "rt-tokio"] }
opentelemetry-otlp = { version = "0.33.1", default-features = false, features = ["trace", "grpc-tonic", "http-proto"] }
# Release profile: balanced for production use (good performance + reasonable size)
[profile.release]
opt-level = 3 # Full speed optimizations
lto = "thin" # Thin LTO: removes cross-crate dead code without huge link times
codegen-units = 1 # Single codegen unit for better optimization
panic = "abort" # Removes stack unwinding code (~5-10% savings)
strip = true # Strip symbols from the binary
# Custom profile for distribution builds (smallest possible binary)
# Use with: cargo build --profile release-dist
# Fat LTO helps cdylib/.so/.wasm (the linker runs). It inflates staticlib
# (.a) artifacts with LLVM bitcode that Cargo cannot strip — iOS builds in
# link/sdks/dart/link/build.sh disables LTO and strips bitcode/debug from the archive.
[profile.release-dist]
inherits = "release"
opt-level = "z" # Optimize for size (most aggressive)
lto = true # Full LTO (slower link, best dead-code elimination)
# Custom profile for Docker builds (smallest usable binary for containers)
# Uses full LTO for maximum dead-code elimination to reduce loaded code pages.
# Use with: cargo build --profile docker
[profile.docker]
inherits = "release"
opt-level = "z" # Optimize for size (most aggressive)
lto = true # Full LTO: best dead-code elimination for minimal RSS
# Custom profile for PostgreSQL extension builds (smallest possible .so)
# Uses size optimization + full LTO + panic=unwind (required by pgrx)
# Use with: cargo pgrx install --profile release-pg
[profile.release-pg]
inherits = "release"
opt-level = "z" # Optimize for size
lto = true # Full LTO for maximum dead-code elimination
panic = "unwind" # Required by pgrx (PostgreSQL longjmp unwinding)
[profile.dev]
opt-level = 0
debug = "line-tables-only"
incremental = true
lto = "off"
codegen-units = 256
split-debuginfo = "unpacked"
[profile.test]
debug = "line-tables-only"
# RocksDB 11 compiled at opt-level 0 overflows the Linux stack inside DB::Open.
# The C++ stays optimized in dev and test; Rust crates stay unoptimized.
[profile.dev.package.librocksdb-sys]
opt-level = 3
[profile.test.package.librocksdb-sys]
opt-level = 3
[profile.dev.build-override]
opt-level = 0
debug = 0
codegen-units = 256
[profile.test.build-override]
opt-level = 0
debug = 0
codegen-units = 256