lock-db 1.0.0

Lock manager and deadlock detection for Rust databases - row/range locks, multiple granularities, and wait-for cycle detection.
Documentation
# ██████╗ ███████╗██████╗ ███████╗
# ██╔══██╗██╔════╝██╔══██╗██╔════╝
# ██████╔╝█████╗  ██████╔╝███████╗
# ██╔══██╗██╔══╝  ██╔═══╝ ╚════██║
# ██║  ██║███████╗██║     ███████║
# ╚═╝  ╚═╝╚══════╝╚═╝     ╚══════╝
#╔═══════════════════════════════╗
#║ Rust Efficiency & Performance ║
#╚═══════════════════════════════╝
[package]
name    = "lock-db"
version = "1.0.0"

# Minimum Supported Rust Version (MSRV)
rust-version = "1.85"
edition = "2024"

# License
license = "Apache-2.0 OR MIT"

# Readme
readme = "README.md"

# Description
description = "Lock manager and deadlock detection for Rust databases - row/range locks, multiple granularities, and wait-for cycle detection."

# Keywords (5 max)
keywords = [
    "lock-manager",
    "locking",
    "deadlock-detection",
    "concurrency",
    "transactions"
]

# Categories
categories = [
    "database-implementations",
    "concurrency"
]

# Links
homepage      = "https://github.com/jamesgober/lock-db"
repository    = "https://github.com/jamesgober/lock-db"
documentation = "https://docs.rs/lock-db"

# Authors
authors = [
    "James Gober <me@jamesgober.com>"
]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lib]
name = "lock_db"
path = "src/lib.rs"


# LINTS
# #################################
# `loom` is set via RUSTFLAGS for the concurrency model checks (not a Cargo
# feature), so it must be declared here or `-D warnings` rejects the cfg.
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(loom)'] }


# FEATURE FLAGS
# #################################
[features]
default = ["std"]
std = []
# Serialization for public types.
serde = ["dep:serde"]


# DEPENDENCIES
# #################################
[dependencies]
serde = { version = "1", optional = true, default-features = false, features = ["derive", "alloc"] }


# DEV DEPENDENCIES
# #################################
[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
proptest  = "1"

# loom is a normal (not dev) dependency under `cfg(loom)` because the library
# itself swaps in loom's instrumented `Mutex` for the concurrency model checks.
# It is pulled in only when building with `RUSTFLAGS="--cfg loom"`.
[target.'cfg(loom)'.dependencies]
loom = "0.7"


# EXAMPLES
# #################################
# Every example drives `LockManager`, which is behind the `std` feature, so they
# are skipped in a `no_std` build rather than failing to compile.
[[example]]
name              = "quick_start"
required-features = ["std"]

[[example]]
name              = "two_phase_locking"
required-features = ["std"]

[[example]]
name              = "shared_upgrade"
required-features = ["std"]

[[example]]
name              = "concurrent"
required-features = ["std"]

[[example]]
name              = "hierarchy"
required-features = ["std"]

[[example]]
name              = "range_locks"
required-features = ["std"]

[[example]]
name              = "deadlock"
required-features = ["std"]


# BENCHMARKS
# #################################
[[bench]]
name    = "lock_bench"
harness = false


# RELEASE PROFILE
# #################################
[profile.release]
opt-level     = 3
lto           = "fat"
codegen-units = 1
panic         = "abort"
strip         = "symbols"