[package]
name = "oversync"
version.workspace = true
edition.workspace = true
license.workspace = true
description = "A lightweight data sync engine: poll, delta, sink."
repository = "https://github.com/overrealdb/oversync"
keywords = ["data-sync", "delta", "surrealdb", "etl"]
categories = ["database", "asynchronous"]
rust-version.workspace = true
readme = "README.md"
exclude = [
	".github/",
	"tests/fixtures/",
]

[workspace]
resolver = "2"
members = [
	"crates/oversync-core",
	"crates/oversync-connectors",
	"crates/oversync-delta",
	"crates/oversync-links",
	"crates/oversync-sinks",
	"crates/oversync-api",
	"crates/oversync-transforms",
	"crates/oversync-queries",
]

[workspace.package]
version = "0.5.0"
edition = "2024"
license = "Apache-2.0"
rust-version = "1.94"

[workspace.dependencies]
oversync-core = { version = "0.5.0", path = "crates/oversync-core" }
oversync-connectors = { version = "0.5.0", path = "crates/oversync-connectors" }
oversync-delta = { version = "0.5.0", path = "crates/oversync-delta" }
oversync-links = { version = "0.5.0", path = "crates/oversync-links" }
oversync-sinks = { version = "0.5.0", path = "crates/oversync-sinks" }
oversync-api = { version = "0.5.0", path = "crates/oversync-api" }
oversync-transforms = { version = "0.5.0", path = "crates/oversync-transforms" }
oversync-queries = { version = "0.5.0", path = "crates/oversync-queries" }

overshift = "0.2"
surql-parser = { version = "0.1.4", features = ["build"] }
surql-macros = "0.1.2"

axum = "0.8"
utoipa = { version = "5", features = ["axum_extras", "chrono"] }

surrealdb = { version = "3", features = ["kv-mem", "protocol-http", "protocol-ws"] }
tokio-util = "0.7"
tokio = { version = "1", features = ["full"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "2"
anyhow = "1"
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter", "registry"] }
opentelemetry = "0.28"
opentelemetry_sdk = { version = "0.28", features = ["rt-tokio"] }
opentelemetry-otlp = { version = "0.28", features = ["grpc-tonic"] }
tracing-opentelemetry = "0.29"
chrono = { version = "0.4", features = ["serde"] }
uuid = { version = "1", features = ["v4", "serde"] }
async-trait = "0.1"
clap = { version = "4", features = ["derive", "env"] }
toml = "0.8"
sha2 = "0.11"
const-hex = "1"
rayon = "1"
aes-gcm = "0.10"
rand = "0.9"
base64 = "0.22"
hostname = "0.4"
subtle = "2"
metrics = "0.24"
metrics-exporter-prometheus = "0.16"
wasmtime = "43.0.1"
rquickjs = { version = "0.11", features = ["parallel"] }
rquickjs-serde = "0.5"
arrow = { version = "58", default-features = false, features = ["json"] }
arrow-flight = { version = "58", features = ["flight-sql-experimental"] }
reqwest = { version = "0.12", features = ["json"] }
sqlx = { version = "0.8", features = ["runtime-tokio-rustls", "postgres", "mysql", "json"] }
rdkafka = { version = "0.37", features = ["cmake-build"] }
proptest = "1"
criterion = { version = "0.5", features = ["html_reports"] }

[[bin]]
name = "oversync"
path = "bin/oversync.rs"
required-features = ["cli"]

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

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

[[example]]
name = "embedded"

[[example]]
name = "pg_to_pg"

[[example]]
name = "kafka_source"

[[example]]
name = "surrealdb_source"

[[example]]
name = "js_transform"

[[example]]
name = "http_api"
required-features = ["api"]

[features]
default = []
schema = ["dep:overshift"]
api = ["dep:oversync-api", "dep:axum", "dep:metrics-exporter-prometheus", "dep:utoipa"]
cli = [
	"api",
	"schema",
	"oversync-core/cli",
	"dep:clap",
	"dep:reqwest",
	"dep:opentelemetry",
	"dep:opentelemetry_sdk",
	"dep:opentelemetry-otlp",
	"dep:tracing-opentelemetry",
]
validate-docker = []
parallel = ["oversync-core/parallel", "oversync-delta/parallel"]

[dependencies]
oversync-core = { workspace = true }
oversync-connectors = { workspace = true }
oversync-delta = { workspace = true }
oversync-links = { workspace = true }
oversync-sinks = { workspace = true }
oversync-transforms = { workspace = true }
oversync-queries = { workspace = true }
surql-macros = { workspace = true }
chrono = { workspace = true }
tokio = { workspace = true }
anyhow = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
surrealdb = { workspace = true }
toml = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
metrics = { workspace = true }
hostname = { workspace = true }
uuid = { workspace = true }
metrics-exporter-prometheus = { workspace = true, optional = true }
aes-gcm = { workspace = true }
rand = { workspace = true }
base64 = { workspace = true }
sha2 = { workspace = true }
async-trait = { workspace = true }
tokio-util = { workspace = true }
sqlx = { workspace = true }

# CLI-only deps (behind "cli" feature)
overshift = { workspace = true, optional = true }
oversync-api = { workspace = true, optional = true }
axum = { workspace = true, optional = true }
utoipa = { workspace = true, optional = true }
reqwest = { workspace = true, optional = true }
clap = { workspace = true, optional = true }
opentelemetry = { workspace = true, optional = true }
opentelemetry_sdk = { workspace = true, optional = true }
opentelemetry-otlp = { workspace = true, optional = true }
tracing-opentelemetry = { workspace = true, optional = true }

[dev-dependencies]
oversync-core = { workspace = true }
oversync-connectors = { workspace = true }
oversync-delta = { workspace = true }
oversync-sinks = { workspace = true }
oversync-queries = { workspace = true }
overshift = { workspace = true }
surql-macros = { workspace = true }
surrealdb = { workspace = true }
sqlx = { workspace = true }
serde_json = { workspace = true }
chrono = { workspace = true }
async-trait = { workspace = true }
uuid = { workspace = true }
tokio = { workspace = true }
rdkafka = { workspace = true }
axum = { workspace = true }
oversync-api = { workspace = true }
reqwest = { workspace = true }
tower = "0.5"
http-body-util = "0.1"
tokio-stream = "0.1"
tokio-util = { workspace = true }
criterion = { workspace = true }

[build-dependencies]
surql-parser = { workspace = true }

[profile.dev.package."*"]
debug = false

[profile.release]
lto = "thin"
strip = true
codegen-units = 1
