[package]
name = "spring-batch-rs"
version = "0.3.4"
edition = "2024"
authors = ["Simon Boussekeyt <sboussekeyt@gmail.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/sboussekeyt/spring-batch-rs"
homepage = "https://spring-batch-rs.boussekeyt.dev"
documentation = "https://docs.rs/spring-batch-rs"
keywords = ["batch", "etl", "data", "pipeline", "processing"]
readme = "README.md"
description = "A toolkit for building enterprise-grade batch applications"

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

[profile.dev]
opt-level = 0

[profile.release]
opt-level = 3

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

[dependencies]
log = "0.4"
serde = { version = "1.0", features = ["derive"] }
thiserror = "2.0"
csv = { version = "1.4", optional = true }
fake = { version = "5.1", features = ["time"], optional = true }
rand = { version = "0.10" }
time = { version = "0.3", features = ["serde-human-readable"], optional = true }
serde_json = { version = "1.0" }
tokio = { version = "1.49", features = ["full"] }
sqlx = { version = "0.8", optional = true, features = ["runtime-tokio"] }
chrono = { version = "0.4", optional = true, features = ["serde"] }
anyhow = { version = "1.0" }
mongodb = { version = "3.5", optional = true, features = ["sync"] }
bson = { version = "3.0", optional = true, default-features = false, features = ["compat-3-0-0"] }
uuid = { version = "1.18", features = ["v4"] }
quick-xml = { version = "0.39", features = ["serialize"], optional = true }
tempfile = { version = "3.20", optional = true }
zip = { version = "8.5", optional = true }
sea-orm = { version = "1.1", features = [ "sqlx-postgres", "sqlx-mysql", "sqlx-sqlite", "runtime-tokio-native-tls", "macros", "mock" ], optional = true }
suppaftp = { version = "8.0", optional = true, features = ["native-tls"] }
aws-sdk-s3 = { version = "1", optional = true }
aws-config = { version = "1", optional = true }
tokio-util = { version = "0.7", features = ["io"], optional = true }

[dev-dependencies]
spring-batch-rs = { path = ".", features = ["tests-cfg"] }
rand = { version = "0.10" }
mockall = "0.14"
testcontainers = "0.27"
testcontainers-modules = { version = "0.15", features = ["postgres", "mysql", "mongo", "blocking", "localstack"] }
aws-sdk-s3 = "1"
aws-config = "1"
tokio = { version = "1.0", features = ["full"] }
env_logger = "0.11"

[features]
# Include nothing by default
default = []
tests-cfg = ["full"]

# enable everything
full = [
  "csv",
  "json",
  "logger",
  "fake",
  "rdbc-postgres",
  "rdbc-mysql",
  "rdbc-sqlite",
  "mongodb",
  "xml",
  "zip",
  "ftp",
  "orm",
  "s3"
]

csv = ["dep:csv", "dep:tempfile"]
json = []
xml = ["dep:quick-xml", "dep:tempfile"]
zip = ["dep:zip"]
ftp = ["dep:suppaftp"]
s3 = ["dep:aws-sdk-s3", "dep:aws-config", "dep:tokio-util"]
rdbc-postgres = ["sqlx/postgres", "rdbc", "dep:chrono"]
rdbc-mysql = ["sqlx/mysql", "rdbc", "dep:chrono"]
rdbc-sqlite = ["sqlx/sqlite", "rdbc", "dep:chrono"]
mongodb = ["mongodb/sync", "bson"]
fake = ["dep:fake", "dep:time"]
logger = []
rdbc = []
orm = ["dep:sea-orm"]

# =============================================================================
# Examples - Data Formats
# =============================================================================

[[example]]
name = "csv_processing"
required-features = ["csv", "json"]

[[example]]
name = "json_processing"
required-features = ["json", "csv", "logger"]

[[example]]
name = "xml_processing"
required-features = ["xml", "json", "csv"]

# =============================================================================
# Examples - Databases
# =============================================================================

[[example]]
name = "database_processing"
required-features = ["rdbc-sqlite", "csv", "json", "logger"]

[[example]]
name = "mongodb_processing"
required-features = ["mongodb", "csv", "json"]

[[example]]
name = "orm_processing"
required-features = ["orm", "csv", "json"]

# =============================================================================
# Examples - Tasklets
# =============================================================================

[[example]]
name = "tasklet_zip"
required-features = ["zip"]

[[example]]
name = "tasklet_ftp"
required-features = ["ftp"]

[[example]]
name = "tasklet_s3"
required-features = ["s3"]

# =============================================================================
# Examples - Advanced Patterns
# =============================================================================

[[example]]
name = "advanced_patterns"
required-features = ["csv", "json", "logger"]

[[example]]
name = "chaining_processors"
required-features = ["csv", "json"]

[[example]]
name = "chaining_writers"
required-features = ["csv", "json", "logger"]

[[example]]
name = "filter_records_from_csv_with_processor"
required-features = ["csv", "json"]

[[example]]
name = "benchmark_csv_postgres_xml"
required-features = ["csv", "xml", "rdbc-postgres"]
