postrust-core 2.3.2

Request parsing, query planning and schema introspection for Postrust
Documentation
[package]
name = "postrust-core"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
authors.workspace = true
description = "Request parsing, query planning and schema introspection for Postrust"
homepage.workspace = true
readme = "README.md"
keywords = ["postgres", "rest", "api", "query-planner", "postgrest"]

[features]
default = ["sqlx"]
# Loading the schema cache from a database and decoding rows, both through
# sqlx. Without it the crate still parses, plans and builds queries, and holds a
# schema cache it is given -- which is what a host with no sqlx (a Cloudflare
# Worker, on wasm32) needs. See issue #50.
sqlx = ["dep:sqlx"]
# The PostgreSQL wire protocol over a socket the host opens, through
# tokio-postgres with no runtime of its own: `db::PgSocketDb`. What a
# Cloudflare Worker reaches Hyperdrive with (issue #50).
pg-socket = ["dep:tokio-postgres", "dep:bigdecimal", "dep:uuid"]
# Mirrors `postrust-server`'s feature of the same name, which turns it on here
# too. Two things follow from it, and both have to agree or the feature only
# half works:
#
#   * `serde_json/preserve_order`, so a decoded object keeps its key order;
#   * embedded rows are built as `json` rather than `jsonb` -- see
#     `Relationship::embed_expression`. `jsonb` sorts keys by length and then
#     bytes, inside PostgreSQL, so no amount of care on the Rust side can
#     recover the order the columns were selected in.
compat-key-order = ["serde_json/preserve_order"]

[dependencies]
# Async
async-trait.workspace = true
futures.workspace = true
tokio.workspace = true

# Database
sqlx = { workspace = true, optional = true }
tokio-postgres = { version = "0.7.18", default-features = false, optional = true, features = [
    "with-serde_json-1",
    "with-uuid-1",
    "with-chrono-0_4",
] }
# For `numeric`, decoded exactly as sqlx's BigDecimal decodes it; the same
# version sqlx uses, so the printed digits cannot differ.
bigdecimal = { version = "0.4", optional = true }
uuid = { workspace = true, optional = true }

# Serialization
serde.workspace = true
serde_json.workspace = true

# Parsing
nom.workspace = true

# Error handling
thiserror.workspace = true

# Utilities
indexmap.workspace = true
bytes.workspace = true
http.workspace = true
mime.workspace = true
url.workspace = true
percent-encoding.workspace = true
tracing.workspace = true
chrono.workspace = true

# Internal
postrust-sql.workspace = true

[target.'cfg(target_arch = "wasm32")'.dependencies]
# SCRAM's nonce needs randomness, which on wasm32 is the host's.
tokio-postgres = { version = "0.7.18", default-features = false, optional = true, features = ["js"] }

[dev-dependencies]
pretty_assertions.workspace = true
tokio = { workspace = true, features = ["full", "test-util"] }