[package]
name = "facet-tokio-postgres"
version = "0.50.0-rc.1"
edition = "2024"
rust-version.workspace = true
license = "MIT OR Apache-2.0"
description = "Deserialize tokio-postgres Rows into any type implementing Facet"
keywords = ["postgres", "tokio-postgres", "facet", "deserialization", "database"]
categories = ["database", "asynchronous"]
homepage = "https://facet.rs"

[package.metadata]

[package.metadata."docs.rs"]
rustdoc-args = ["--html-in-header", "arborium-header.html"]

[dependencies]
facet = { workspace = true, optional = true }
facet-core = { workspace = true }
facet-json = { workspace = true }
facet-reflect = { workspace = true }
tokio-postgres = { workspace = true }
postgres-types = { workspace = true }
rust_decimal = { workspace = true, optional = true, features = ["db-tokio-postgres"] }
jiff = { workspace = true, optional = true }
dibs-jsonb.workspace = true

[dev-dependencies]
facet = { path = "../facet" }
facet-json = { path = "../facet-json" }
tokio = { workspace = true, features = ["rt-multi-thread", "macros"] }
testcontainers = { workspace = true }
testcontainers-modules = { workspace = true }
uuid = { workspace = true }
jiff = { workspace = true }
chrono = { workspace = true }
time = { workspace = true }

[features]
default = ["std"]
std = []
# Enable integration tests (requires postgres via POSTGRES_HOST/PORT env vars, or docker for testcontainers)
test-postgres = []
# Enable UUID support
uuid = ["facet-core/uuid"]
# Enable jiff timestamp support
jiff02 = [
  "dep:jiff",
  "facet-core/jiff02",
  "tokio-postgres/with-jiff-0_2",
  "postgres-types/with-jiff-0_2",
]
# Enable chrono timestamp support
chrono = ["facet-core/chrono"]
# Enable time crate support
time = ["facet-core/time"]
# Enable rust_decimal::Decimal support for NUMERIC columns
rust_decimal = ["dep:rust_decimal", "facet-core/rust_decimal"]
# JSONB support is always eanbled
jsonb = []
