[package]
name = "oracledb"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
documentation.workspace = true
description.workspace = true
keywords.workspace = true
categories.workspace = true
# Crate front page on crates.io / docs.rs. A crate-local README is required
# because cargo will not package a readme that lives outside the crate dir.
readme = "README.md"
# Keep the published tarball lean: ship src/ + README + LICENSE files only.
# Integration tests and golden/cassette fixtures are dev-time assets not needed
# to build or use the published crate. (benches/ and examples/ are kept so the
# [[bench]] targets and doc examples remain resolvable.)
exclude = [
    "tests/",
]

[features]
# `derive` is on by default: it pulls in the `oracledb-derive` proc-macro crate
# (and, transitively, syn/quote/proc-macro2), which are BUILD-TIME-ONLY deps and
# already present in the workspace dependency graph, so the default runtime build
# gains no extra compiled artifact. Disable with `default-features = false` if you
# want a derive-free build.
default = ["derive"]
derive = ["dep:oracledb-derive"]
arrow = ["dep:arrow-array", "dep:arrow-buffer", "dep:arrow-data", "dep:arrow-schema"]
# Transport record/replay seam: tee the raw wire stream to a .tns-cassette
# (record) and serve a cassette to the decoder with no socket (replay). Pulls
# in the protocol crate's cassette wire format. Off by default; when off the
# OracleReadHalf/OracleWriteHalf transport path is byte-identical to the
# pre-seam build (the Recording/Replay enum variants do not exist).
cassette = ["oracledb-protocol/cassette"]
# Typed-conversion bridges for FromSql / ToSql. Each external crate sits behind
# its own feature so the default build pulls in nothing extra.
chrono = ["dep:chrono"]
uuid = ["dep:uuid"]
serde_json = ["dep:serde_json"]
rust_decimal = ["dep:rust_decimal"]
# Thin-mode SODA (Simple Oracle Document Access). Experimental surpass feature:
# python-oracledb's thin mode has no SODA. Implemented over SQL + DBMS_SODA
# PL/SQL on the existing execute/fetch/OSON primitives. Requires serde_json for
# QBE filter parsing.
soda = ["dep:serde_json"]
# Enables the experimental cwallet.sso (SSO auto-login wallet) reader.
experimental = ["oracledb-protocol/experimental"]
# First-class OpenTelemetry-style observability (bead rust-oracledb-lv6).
# Emits per-round-trip `tracing` spans (connect / execute / fetch / round-trip /
# commit / LOB ops) with structured fields (SQL digest, row count, rows fetched,
# bind count — never secret values or bind data). ZERO-cost when off: the default
# build does NOT compile `tracing` in and the span macros expand to nothing, so a
# build without this feature is byte-for-byte the pre-feature build. Because our
# spans are emitted from the GIL-free Rust engine, concurrent connections trace
# in parallel — unlike python-oracledb's GIL-bound instrumentation. See
# docs/OBSERVABILITY.md.
tracing = ["dep:tracing"]

[dependencies]
arrow-array = { workspace = true, optional = true }
arrow-buffer = { workspace = true, optional = true }
arrow-data = { workspace = true, optional = true }
arrow-schema = { workspace = true, optional = true }
# asupersync's `tls` feature wraps rustls; we drive its sans-io ClientConnection
# over the async TCP socket and supply our own Oracle ServerCertVerifier.
asupersync = { workspace = true, features = ["tls"] }
chrono = { version = "0.4", optional = true, default-features = false, features = ["std"] }
oracledb-derive = { path = "../oracledb-derive", version = "0.6.0", optional = true }
oracledb-protocol = { path = "../oracledb-protocol", version = "0.6.0" }
rust_decimal = { version = "1", optional = true, default-features = false, features = ["std"] }
rustls.workspace = true
rustls-pki-types.workspace = true
rustls-webpki.workspace = true
serde_json = { workspace = true, optional = true }
# Optional, feature-gated observability facade (`tracing` feature). NOT in the
# default build: see the `tracing` feature comment above.
tracing = { workspace = true, optional = true }
x509-cert.workspace = true
thiserror.workspace = true
uuid = { version = "1", optional = true, default-features = false }

[dev-dependencies]
# Counting global allocator for the columnar fetch->Arrow allocation measurement
# (tests/arrow_columnar_alloc.rs, compiled only under `--features arrow`). The
# unsafe GlobalAlloc lives inside this crate, so the workspace stays
# `#![forbid(unsafe_code)]`-clean.
allocation-counter = "0.8"
criterion = { version = "0.5", default-features = false, features = ["cargo_bench_support"] }
# Property-based tests for the FromSql/ToSql value bridge
# (tests/value_bridge_properties.rs). Same version the protocol crate pins.
proptest.workspace = true
# TLS handshake integration test: a blocking rustls server stub + PEM loading.
rustls-pemfile.workspace = true
sha2.workspace = true
# Span-capture subscriber for the feature-gated observability test
# (tests/observability.rs, compiled only under `--features tracing`).
tracing-subscriber.workspace = true
# Compile-time coverage for the generated `#[derive(FromRow)]` surface.
trybuild = "1.0.116"

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

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

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

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

[lints]
workspace = true
