[package]
name = "crudcrate"
version = "0.9.1"
edition = "2024"
description = "Derive complete REST APIs from Sea-ORM entities — endpoints, filtering, pagination, batch ops, and OpenAPI on Axum"
license = "MIT"
readme = "../README.md"
repository = "https://github.com/evanjt/crudcrate"
documentation = "https://crudcrate.evanjt.com"
keywords = ["crud", "api", "axum", "sea-orm", "rest"]
categories = ["web-programming", "database"]

[features]
default = ["sqlite", "derive"]
derive = ["crudcrate-derive"]
mysql = ["sea-orm/sqlx-mysql"]
postgresql = ["sea-orm/sqlx-postgres"]
sqlite = ["sea-orm/sqlx-sqlite"]
spring-rs = ["spring", "spring-web", "derive"]

[dependencies]
# Proc macro dependency (optional)
crudcrate-derive = { version = "=0.9.1", optional = true, path = "../crudcrate-derive" }

# Core dependencies using workspace versions
async-trait = { workspace = true }
axum = { workspace = true, features = ["macros"] }
sea-orm = { workspace = true, features = ["runtime-tokio-rustls", "macros", "with-uuid"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
serde_with = { workspace = true }
utoipa = { workspace = true }
uuid = { workspace = true, features = ["serde", "v4"] }
tracing = { workspace = true }

# Spring-RS dependencies (only for examples, behind feature flag)
spring = { version = "0.4.3", optional = true }
spring-web = { version = "0.4.3", optional = true }



[lib]
proc-macro = false

[dev-dependencies]
chrono = { workspace = true, features = ["serde"] }
criterion = { workspace = true, features = ["html_reports"] }
sea-orm = { workspace = true, features = ["sqlx-sqlite", "sqlx-postgres", "sqlx-mysql", "runtime-tokio-rustls", "macros", "with-chrono", "with-rust_decimal"] }
sea-orm-migration = { workspace = true }
tokio = { workspace = true, features = ["full"] }
tracing-subscriber = { workspace = true }
tower = { workspace = true, features = ["util"] }
tower-http = { workspace = true, features = ["cors", "trace"] }
percent-encoding = { workspace = true }
utoipa = { workspace = true, features = ["uuid", "chrono", "decimal"] }
utoipa-axum = { workspace = true }
utoipa-scalar = { workspace = true }
rust_decimal = { workspace = true }


[[example]]
name = "minimal"
path = "../examples/minimal/main.rs"
required-features = ["derive"]

[[example]]
name = "crud_operations"
path = "../examples/crud_operations.rs"
required-features = ["derive"]

[[example]]
name = "error_handling"
path = "../examples/error_handling.rs"
required-features = ["derive"]

[[example]]
name = "recursive_join"
path = "../examples/recursive_join/main.rs"
required-features = ["derive", "sqlite"]

[[example]]
name = "recursive_join_5_levels"
path = "../examples/recursive_join_5_levels/main.rs"
required-features = ["derive", "sqlite"]

[[example]]
name = "scoped_access"
path = "../examples/scoped_access/main.rs"
required-features = ["derive", "sqlite"]

[[example]]
name = "joined_filter"
path = "../examples/joined_filter/main.rs"
required-features = ["derive", "sqlite"]


[[bench]]
name = "crud_benchmarks"
harness = false

[lints.clippy]
pedantic = "warn"
