-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cargo.toml
103 lines (90 loc) · 2.72 KB
/
Cargo.toml
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
[package]
name = "cuttlestore"
description = "A generic API for interacting with key-value stores that can be selected at runtime."
version = "0.2.1"
edition = "2021"
authors = ["Kaan Barmore-Genç <[email protected]>"]
license = "MIT"
readme = "Readme.md"
repository = "https://github.com/SeriousBug/cuttlestore"
[features]
default = [
"backend-redis",
"backend-in-memory",
"backend-sqlite",
"logging-tracing",
]
backend-redis = ["redis", "bb8", "bb8-redis"]
backend-filesystem = []
backend-in-memory = ["dashmap"]
backend-sqlite = ["backend-sqlite-native-tls"]
logging-tracing = ["tracing"]
logging-log = ["log"]
# Backend customization
# For sqlite, we need to pick between native TLS and rustls.
backend-sqlite-core = []
backend-sqlite-native-tls = ["sqlx", "sqlite-native-tls", "backend-sqlite-core"]
backend-sqlite-rustls = ["sqlx", "sqlite-rustls", "backend-sqlite-core"]
sqlite-native-tls = ["sqlx/runtime-tokio-native-tls"]
sqlite-rustls = ["sqlx/runtime-tokio-rustls"]
[dependencies]
# For async functions in trait definitions
async-trait = "0.1.60"
# For streams (async iterators)
futures = "0.3.25"
# Async runtime
tokio = { version = "1.23.1", features = ["full"] }
# Built-in for converting Tokio builtins to streams
tokio-stream = { version = "0.1.11", features = ["fs"] }
# Helper macros to generate streams
async-stream = "0.3.3"
# Serializing data. The API requires stored types to support Serde, but it's also used internally.
serde = { version = "1.0.152", features = ["derive"] }
# Binary serialization. Both used by the API to encode the payloads, and by some
# backends internally.
bincode = "1.3.3"
# Generating error types.
thiserror = "1.0.38"
# Used to parse connection strings.
lazy-regex = "2.4.1"
# Logging errors
log = { version = "0.4", optional = true }
tracing = { version = "0.1", optional = true }
#
# == Backend specific
#
# Concurrent in-memory key-value storage, for in-memory
dashmap = { version = "5.4", optional = true }
# Redis
redis = { version = "0.22", optional = true, features = [
"tokio-comp",
"tokio-native-tls-comp",
] }
# Connection pool for redis
bb8 = { version = "0.8", optional = true }
bb8-redis = { version = "0.12", optional = true }
# Sqlite
sqlx = { version = "0.6", default-features = false, features = [
"sqlite",
], optional = true }
[dev-dependencies]
# For benchmarks
criterion = { version = "0.4", features = ["async_tokio"] }
# Generates random data to put into the store during benchmarks
nanoid = "0.4"
lipsum = "0.8"
rand = "0.8"
# For easily spawning async stuff in tests
tokio-test = "0.4"
[[bench]]
name = "put-sequential"
harness = false
[[bench]]
name = "put-concurrent"
harness = false
[[bench]]
name = "get-concurrent"
harness = false
[[bench]]
name = "get-sequential"
harness = false