# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package]
name          = "kite_sql"
version       = "0.1.4"
edition       = "2021"
authors       = ["Kould <kould2333@gmail.com>", "Xwg <loloxwg@gmail.com>"]
description   = "SQL as a Function for Rust"
documentation = "https://docs.rs/kite_sql/latest/kite_sql/"
license       = "Apache-2.0"
repository    = "https://github.com/KipData/KipSQL"
readme        = "README.md"
keywords      = ["sql", "sqlite", "database", "mysql"]
categories    = ["development-tools", "database"]
default-run   = "kite_sql"

[[bin]]
name              = "kite_sql"
path              = "src/bin/server.rs"
required-features = ["net"]

[lib]
doctest = false
crate-type = ["cdylib", "rlib"]

[features]
default = ["macros"]
macros  = []
net     = ["dep:pgwire", "dep:async-trait", "dep:clap", "dep:env_logger", "dep:futures", "dep:log", "dep:tokio"]
pprof   = ["pprof/criterion", "pprof/flamegraph"]

[[bench]]
name    = "query_bench"
path    = "benchmarks/query_benchmark.rs"
harness = false
required-features = ["pprof"]

[dependencies]
ahash                 = { version = "0.8" }
bincode               = { version = "1" }
bumpalo               = { version = "3", features = ["allocator-api2", "collections", "std"] }
byteorder             = { version = "1" }
chrono                = { version = "0.4" }
comfy-table           = { version = "7", default-features = false }
csv                   = { version = "1" }
fixedbitset           = { version = "0.4" }
itertools             = { version = "0.12" }
ordered-float         = { version = "4", features = ["serde"] }
paste                 = { version = "1" }
parking_lot           = { version = "0.12", features = ["arc_lock"] }
petgraph              = { version = "0.6" }
recursive             = { version = "0.1" }
regex                 = { version = "1" }
rust_decimal          = { version = "1" }
serde                 = { version = "1", features = ["derive", "rc"] }
kite_sql_serde_macros = { version = "0.1.0", path = "kite_sql_serde_macros" }
siphasher             = { version = "1", features = ["serde"] }
sqlparser             = { version = "0.34", features = ["serde"] }
thiserror             = { version = "1" }
typetag               = { version = "0.2" }
ulid                  = { version = "1", features = ["serde"] }
genawaiter            = { version = "0.99" }

# Feature: net
async-trait           = { version = "0.1", optional = true }
clap                  = { version = "4.5", features = ["derive"], optional = true }
env_logger            = { version = "0.11", optional = true }
futures               = { version = "0.3", optional = true }
log                   = { version = "0.4", optional = true }
pgwire                = { version = "0.28.0", optional = true }
tokio                 = { version = "1.36", features = ["full"], optional = true }


[target.'cfg(unix)'.dev-dependencies]
pprof = { version = "0.13", features = ["flamegraph", "criterion"] }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion             = { version = "0.5", features = ["html_reports"] }
indicatif             = { version = "0.17" }
tempfile              = { version = "3.10" }
# Benchmark
sqlite                = { version = "0.34" }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
dirs = { version = "5" }
rocksdb = { version = "0.23" }

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen        = { version = "0.2.106" }
web-sys             = { version = "0.3.83", features = [
    "Storage",
    "Window",
] }
base64              = { version = "0.21" }
getrandom           = { version = "0.2", features = ["js"] }
getrandom_03        = { package = "getrandom", version = "0.3", features = ["wasm_js"] }
js-sys              = { version = "0.3.83" }
serde-wasm-bindgen  = { version = "0.6.5" }
once_cell           = { version = "1" }

[target.'cfg(target_arch = "wasm32")'.dev-dependencies]
wasm-bindgen-test = "0.3.56"

[workspace]
members = [
  "tests/sqllogictest",
  "tests/macros-test",
  "kite_sql_serde_macros",
  "tpcc"]

[profile.release]
lto = true

[package.metadata.wasm-pack.profile.release]
wasm-opt = false
