cratestack-sqlx 0.7.2

Rust-native schema-first framework for typed HTTP APIs, generated clients, and backend services.
Documentation
[package]
name = "cratestack-sqlx"
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
description.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
readme = "README.md"
keywords.workspace = true
categories.workspace = true

[features]
default = ["decimal-rust-decimal"]
decimal-rust-decimal = [
    "cratestack-core/decimal-rust-decimal",
    "cratestack-sql/decimal-rust-decimal",
    "dep:rust_decimal",
    "sqlx-core/rust_decimal",
    "sqlx-postgres/rust_decimal",
]
decimal-bigdecimal = [
    "cratestack-core/decimal-bigdecimal",
    "cratestack-sql/decimal-bigdecimal",
    "dep:bigdecimal",
    "sqlx-core/bigdecimal",
    "sqlx-postgres/bigdecimal",
]
# Column-type support for `Vector(n)` fields (the `pgvector` extension
# โ€” see `docs/design/extensions.md` ยง6). Pulls in the `pgvector` crate
# purely for its `sqlx::Type`/`Encode`/`Decode` impls against
# Postgres's `vector` wire format โ€” reinventing that binary encoding
# by hand isn't worth it. `default-features = false` + only the
# `sqlx` feature keeps this from pulling `sqlx-sqlite` (which would
# reintroduce the exact `libsqlite3-sys` conflict with `rusqlite` that
# the `sqlx` compatibility shim above exists to avoid): the `pgvector`
# crate's own `sqlx` feature depends on the umbrella `sqlx` crate with
# `default-features = false, features = ["postgres"]` only, so
# `sqlx-sqlite` never enters the resolved graph.
pgvector = ["dep:pgvector", "dep:sqlx"]

[dependencies]
async-trait.workspace = true
chrono.workspace = true
cratestack-axum.workspace = true
cratestack-core.workspace = true
cratestack-policy.workspace = true
cratestack-sql.workspace = true
serde.workspace = true
serde_json.workspace = true
sha2.workspace = true
sqlx-core.workspace = true
sqlx-postgres.workspace = true
tokio.workspace = true
uuid.workspace = true
rust_decimal = { workspace = true, optional = true }
bigdecimal = { workspace = true, optional = true }
pgvector = { workspace = true, optional = true }
# Pins the transitive `sqlx` facade crate pgvector's `sqlx` feature
# pulls in to exactly the version whose `sqlx-core`/`sqlx-postgres`
# match our own direct `=0.8.6` pins above. Without this, pgvector's
# own (loose) `>= 0.8, < 0.10` requirement lets Cargo resolve a
# separate, newer `sqlx-core`/`sqlx-postgres` (e.g. 0.9.x) alongside
# our pinned 0.8.6 ones, and `pgvector::Vector`'s `Encode`/`Type` impls
# (written against the newer copy) then fail to satisfy
# `QueryBuilder::push_bind`'s bound (written against ours) โ€” not a
# missing impl, just two incompatible copies of the same trait. Not
# used directly (we still go through the `sqlx-core`/`sqlx-postgres`
# shim above), this dependency exists purely to anchor the resolver.
sqlx = { version = "=0.8.6", default-features = false, features = ["postgres"], optional = true }

[dev-dependencies]