[package]
name = "fraiseql-storage"
version.workspace = true
edition = "2021"
rust-version = "1.75"
license = "Apache-2.0"
repository.workspace = true
homepage = "https://fraiseql.dev"
documentation = "https://docs.rs/fraiseql-storage"
description = "Object storage backends and HTTP handlers for FraiseQL"
readme = "README.md"
keywords = ["graphql", "storage", "s3", "object-store"]
categories = ["api-bindings", "web-programming"]
publish = true

[dependencies]
fraiseql-error = { workspace = true }

bytes = "1"
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "chrono"] }
tokio = { version = "1", features = ["fs", "io-util", "rt"] }
axum = { workspace = true }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.11"
hex = "0.4"
thiserror = "1"
tracing = "0.1"
async-trait = "0.1"
chrono = { workspace = true }
walkdir = "2"

# Storage backends (feature-gated)
aws-sdk-s3 = { version = "1", optional = true }
aws-config = { version = "1", optional = true }

# GCS backend (feature-gated)
jsonwebtoken = { workspace = true, optional = true }
parking_lot = { workspace = true, optional = true }
reqwest = { workspace = true, optional = true }
urlencoding = { version = "2.1", optional = true }

# Azure Blob backend (feature-gated)
base64 = { workspace = true, optional = true }
hmac = { workspace = true, optional = true }

# Image transforms (feature-gated)
image = { version = "0.25", optional = true }
kamadak-exif = { version = "0.5", optional = true }
# google-cloud-storage = { version = "...", optional = true }
# azure_storage_blobs = { version = "0.20", optional = true }

[dev-dependencies]
tokio-test = "0.4"
tempfile = "3"
tokio = { version = "1", features = ["full"] }
tower = { version = "0.5", features = ["util"] }
# Integration tests connect through the test-support harness (env-URL first; optional
# local-testcontainers spawn). Dagger provides Postgres + the Azurite/fake-gcs emulators.
fraiseql-test-support = { path = "../fraiseql-test-support" }
uuid = { workspace = true }
criterion = { version = "0.5", features = ["async_tokio"] }

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

[lints]
workspace = true

[features]
default = ["postgres"]
postgres = []
mysql = []
sqlite = []
sqlserver = []
aws-s3 = ["aws-sdk-s3", "aws-config"]
transforms = ["image", "kamadak-exif"]
gcs = ["jsonwebtoken", "parking_lot", "reqwest", "urlencoding"]
azure-blob = ["base64", "hmac", "reqwest"]
# gcs = ["google-cloud-storage"]
# azure-blob = ["azure_storage_blobs"]
