[package]
name = "rxqlite"
version = "0.1.14-dev"
readme = "README.md"

edition = "2021"
authors = [
    "ha421 <hha835773@gmail.com>",
]
categories = ["distributed", "database", "raft" , "sqlite" ]
description = "A secured distributed sqlite database built upon `openraft`, `sqlx` and `sqlite`."
homepage = "https://github.com/HaHa421/rxqlite"
keywords = ["distributed", "sqlite"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/HaHa421/rxqlite"

[workspace]
members = [
  "crates/rxqlite-common",
  "crates/rxqlite-lite-common",
  "crates/rxqlite-sqlx-common",
  "crates/rxqlite-tests-common"
]

[[bin]]
name = "rxqlited"
path = "bin/main.rs"

[[example]]
name = "rxqlite-client"
path = "examples/client.rs"

[[example]]
name = "rxqlite-client-insecure-tls"
path = "examples/client_insecure_tls.rs"

[dependencies]
anyhow = "1"
openraft = { version = "0.9", features = ["serde" , "storage-v2"] }

rustls-pemfile = "2"
rustls = {version = "0.22" }
tokio = { version = "1.35.1", features = ["full"] }
byteorder = "1.4.3"
clap = { version = "4.1.11", features = ["derive", "env"] }
reqwest = { version = "0.12", default-features=false , features = ["json" , "rustls-tls" ,"http2" ] }
rocksdb = { version = "0.22" }
serde = { version = "1.0.114", features = ["derive"] }
serde_json = "1.0.57"
warp = { version = "0.3" , features = [ "tls" ] }
# for toy-rpc, use `serde_json` instead of the default `serde_bincode`:
# bincode which enabled by default by toy-rpc, does not support `#[serde(flatten)]`: https://docs.rs/bincode/2.0.0-rc.3/bincode/serde/index.html#known-issues
toy-rpc-ha421 = { version = "0.9.0-beta.1", features = [
  "ws_tokio",
  "server",
  "client",
  "tokio_runtime",
  "tls",
] , path = "crates/toy-rpc-ha421/toy-rpc"}
tracing = "0.1.40"
tracing-subscriber = { version = "0.3.0", features = ["env-filter"] }
tokio-rustls = "0.26"
tokio-util = { version = "0.7" , features = [ "codec" ] }
futures-util= "0.3"
futures = { version = "0.3.30" }
tokio-stream = "0.1"

[dependencies.rxqlite-tests-common]
version = "0.1"
#path = "crates/rxqlite-tests-common" 
optional = true

[dependencies.rxqlite-common]
version = "0.1"
#path = "crates/rxqlite-common"

[dependencies.rxqlite-lite-common]
version = "0.1"
#path = "crates/rxqlite-lite-common"

[dependencies.rxqlite-sqlx-common]
version = "0.1"
#path = "crates/rxqlite-sqlx-common"
features = [ "sqlite" ]

[dependencies.rxqlite-notification]
version = "0.1"
#path = "crates/rxqlite-notification"

[dependencies.sqlx]
version = "0.7"
features = ["runtime-tokio-rustls" , "chrono" ]

[dependencies.sqlx-sqlite-cipher]
#path = "../sqlx-sqlite-cipher"
version = "0.7"


[dependencies.sqlx-core]
version = "0.7"

[dependencies.rsa]
version = "0.9"
optional = true

[dependencies.aes-gcm-siv]
version = "0.11.1"
optional = true

[dependencies.ring]
version = "0.17"
optional = true

[dependencies.base64]
version = "0.22"
optional = true

[dependencies.rand]
version = "0.8"
optional = true

[target.'cfg(target_os = "windows")'.dependencies]
winapi = { version = "0" , features = [ "fileapi" , "winbase" ] }

[dev-dependencies]
futures = { version = "0.3.30" }

[dev-dependencies.rxqlite-tests-common]
version = "0.1"
#path = "crates/rxqlite-tests-common"

[features]
default = [ "bundled-sqlcipher-vendored-openssl"  ]
test-dependency = [ "rxqlite-tests-common" ]
sqlcipher = [ "sqlx-sqlite-cipher/sqlcipher" , "rsa-crate" , "ring" , "base64" , "aes-gcm-siv" ]
bundled-sqlcipher = [ "sqlx-sqlite-cipher/bundled-sqlcipher" , "sqlcipher" ]
bundled-sqlcipher-vendored-openssl = [ "sqlx-sqlite-cipher/bundled-sqlcipher-vendored-openssl" , "sqlcipher" ]

rsa-crate = [ "rsa" , "rand" ]

[package.metadata.docs.rs]
all-features = true