[package]
name = "pgmq"
version = "0.31.1"
edition = "2021"
authors = ["PGMQ Maintainers"]
description = "A distributed message queue for Rust applications, on Postgres."
documentation = "https://docs.rs/pgmq"
homepage = "https://github.com/pgmq/pgmq"
keywords = ["messaging", "queues", "postgres"]
license = "PostgreSQL"
readme = "README.md"
repository = "https://github.com/pgmq/pgmq"

[[bin]]
name = "pgmq-cli"
path = "src/bin/pgmq-cli.rs"
required-features = ["cli"]

[features]
default = []
cli = ["clap", "futures-util", "reqwest", "tokio/rt"]

[dependencies]
chrono = { version = "0.4.23", features = ["serde"] }
serde = { version = "1.0.152" }
serde_json = { version = "1.0.91", features = ["raw_value"] }
sqlx = { version = "0.8.1", features = ["runtime-tokio", "postgres", "chrono", "json"] }
thiserror = "1.0.38"
tokio = { version = "1", default-features = false, features = ["macros", "time"] }
log = "0.4.17"
url = "2.3.1"

# Optional dependencies for the `cli` feature
reqwest = { version = "0.11", features = ["json"], optional = true }
futures-util = { version = "0.3.31", optional = true }
clap = { version = "4.0", features = ["derive"], optional = true }


[dev-dependencies]
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
cargo-readme = "3.2.0"
criterion = "0.4"
env_logger = "0.10.0"
rand = "0.8.5"
regex = "1.5.4"
lazy_static = "1.4.0"

# If a consumer has both the `time` and `chrono` features of `sqlx` enabled, `sqlx` will default to using
# `OffsetDateTime` (from `time`) for timestamp fields instead of `DateTime<Utc>` (from `chrono`), causing a compilation
# error in `pgmq`. See this issue for more details: https://github.com/launchbadge/sqlx/issues/3412

# `pgmq` only uses the `chrono` feature of `sqlx`, so it's possible to add a query that would encounter this conflict
# in a consumer and not notice because `pgmq` compiles fine on its own. To ensure queries that would see this conflict
# are not added in the future, add the `time` feature in dev dependencies. This is a "regression test" of sorts, in
# that it will enable the `time` feature in tests/examples, simulating the behavior of a consumer of `pgmq` that has
# both the `time` and `chrono` features enabled. If a query that would see the conflict is added, `pgmq` will fail to
# compile when running tests/examples.
sqlx = { version = "0.8.1", features = ["time"] }
