[package]
name = "things3-core"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation = "https://docs.rs/things3-core"
description = "Core library for Things 3 database access and data models"
readme = "../../README.md"
keywords = ["things3", "productivity", "task-management", "sqlite", "async"]
categories = ["database", "development-tools"]

[features]
default = []
test-utils = []
export-csv = ["dep:csv"]
export-opml = ["dep:quick-xml"]
export-taskpaper = []
export-ical = ["dep:icalendar"]
observability = ["dep:metrics"]
advanced-queries = []
batch-operations = ["dep:base64", "dep:async-stream", "dep:futures-core"]
full = ["export-csv", "export-opml", "export-taskpaper", "export-ical", "observability", "advanced-queries", "batch-operations"]

[dependencies]
# Core
serde.workspace = true
serde_json.workspace = true
chrono.workspace = true
uuid.workspace = true
thiserror.workspace = true
anyhow.workspace = true

# Database
sqlx = { version = "0.8.1", features = ["runtime-tokio-rustls", "sqlite", "chrono", "uuid", "json"], default-features = false }
rusqlite = { version = "0.32", features = ["bundled"] }

# String similarity (for tag fuzzy matching)
strsim.workspace = true

# Cursor pagination (optional, gated behind `batch-operations`)
base64 = { workspace = true, optional = true }

# Streaming (optional, gated behind `batch-operations`)
async-stream = { workspace = true, optional = true }
futures-core = { workspace = true, optional = true }

# Async
tokio.workspace = true

# Caching and Performance
moka.workspace = true
dashmap.workspace = true
parking_lot.workspace = true
once_cell.workspace = true
zstd = "0.13"

# Export formats (optional)
csv = { workspace = true, optional = true }
quick-xml = { workspace = true, optional = true }
icalendar = { workspace = true, optional = true }

# Configuration
serde_yaml = "0.9"
async-trait = "0.1"

# Performance monitoring
sysinfo.workspace = true

# Logging (always included for debugging)
tracing.workspace = true
tracing-subscriber.workspace = true

# Observability/Metrics (optional)
metrics = { workspace = true, optional = true }
# OpenTelemetry dependencies temporarily disabled
# opentelemetry.workspace = true
# opentelemetry_sdk.workspace = true
# opentelemetry-semantic-conventions.workspace = true

# Testing
proptest.workspace = true
tempfile.workspace = true

[dev-dependencies]
criterion.workspace = true
serial_test = "3.1"
futures-util = { workspace = true }

[[bench]]
name = "database_benchmarks"
harness = false
required-features = ["test-utils"]

[[bench]]
name = "bulk_operations_benchmarks"
harness = false
required-features = ["test-utils"]

[[bench]]
name = "cache_benchmarks"
harness = false
required-features = ["test-utils"]

[[example]]
name = "export_data"
required-features = ["export-csv", "export-opml", "export-taskpaper", "export-ical"]
