[package]
name = "adbc-spanner"
version = "0.1.0"
edition = "2021"
rust-version = "1.88"
license = "Apache-2.0"
description = "ADBC (Arrow Database Connectivity) driver for Google Cloud Spanner"
repository = "https://github.com/fornwall/adbc-spanner"
homepage = "https://github.com/fornwall/adbc-spanner"
documentation = "https://docs.rs/adbc-spanner"
readme = "README.md"
keywords = ["adbc", "arrow", "spanner", "database", "gcp"]
# Both slugs are valid crates.io categories.
categories = ["database", "api-bindings"]
# Keep the published package to what a consumer needs; CI, scripts and the crate lock
# are not useful to downstream builds.
exclude = [".github/", "scripts/", "/Cargo.lock"]

[package.metadata.docs.rs]
# Document the FFI entrypoint too.
all-features = true

# Release automation via cargo-release (https://github.com/crate-ci/cargo-release).
[package.metadata.release]
# Only cut releases from main.
allow-branch = ["main"]
# Tag as vX.Y.Z — this matches the `tags: ["v*"]` trigger of the shared-library release
# workflow, so pushing the tag builds and attaches the platform libraries to the GitHub Release.
tag-name = "v{{version}}"
tag-message = "Release {{version}}"
pre-release-commit-message = "Release {{version}}"
# Publish to crates.io and push the release commit + tag.
publish = true
push = true

[lib]
# cdylib: the loadable ADBC driver shared library
#         (libadbc_spanner.so / libadbc_spanner.dylib / adbc_spanner.dll).
# rlib:   lets Rust code depend on this crate directly.
crate-type = ["cdylib", "rlib"]

[features]
default = ["ffi"]
# Export the C ABI `AdbcSpannerInit` entrypoint so the cdylib is a driver the ADBC
# driver manager (any language) can load. Disable for a pure-Rust rlib dependency.
ffi = ["dep:adbc_ffi"]

[dependencies]
# The abstract ADBC driver traits (Driver / Database / Connection / Statement).
adbc_core = "0.23"
# C FFI driver exporter: generates the `AdbcSpannerInit` entrypoint for the shared library.
adbc_ffi = { version = "0.23", optional = true }
# Arrow types the ADBC traits are expressed in. Kept in the range adbc_core allows
# so the RecordBatch / Schema / RecordBatchReader types unify across the crates.
arrow-array = ">=53.1, <59"
arrow-schema = ">=53.1, <59"
# The official Google Cloud preview Spanner client.
google-cloud-spanner = "0.34.2-preview"
# Anonymous credentials, used when talking to the Spanner emulator.
google-cloud-auth = "1.13"
# The Spanner client is async; we bridge it to the synchronous ADBC traits with a
# dedicated multi-thread runtime.
tokio = { version = "1", features = ["rt-multi-thread", "time"] }
serde_json = "1"
base64 = "0.22"

[profile.release]
# Smaller shipped shared libraries.
strip = true
lto = "thin"

[dev-dependencies]
tokio = { version = "1", features = ["rt-multi-thread", "time", "macros"] }
# Admin clients, used by the emulator integration test to create the test instance and database.
google-cloud-spanner-admin-instance-v1 = "1.12"
google-cloud-spanner-admin-database-v1 = "1.12"
# The `Poller` trait, for awaiting the admin long-running operations.
google-cloud-lro = "1.8"
