[workspace]
resolver = "2"
members = [
    "prax-schema",
    "prax-codegen",
    "prax-query",
    "prax-postgres",
    "prax-mysql",
    "prax-sqlite",
    "prax-mssql",
    "prax-mongodb",
    "prax-duckdb",
    "prax-scylladb",
    "prax-cassandra",
    "prax-sqlx",
    "prax-migrate",
    "prax-cli",
    "prax-armature",
    "prax-axum",
    "prax-actix", "prax-import",
    "prax-pgvector",
    "prax-typegen",
]
exclude = ["fuzz"]

[workspace.package]
version = "0.9.4"
edition = "2024"
rust-version = "1.89"
authors = ["Joseph Quinn <quinn.josephr@protonmail.com>"]
license = "MIT OR Apache-2.0"
repository = "https://github.com/quinnjr/prax"
homepage = "https://github.com/quinnjr/prax"

[workspace.dependencies]
# Internal crates
prax-schema = { path = "prax-schema", version = "0.9.4" }
prax-codegen = { path = "prax-codegen", version = "0.9.4" }
prax-query = { path = "prax-query", version = "0.9.4" }
prax-postgres = { path = "prax-postgres", version = "0.9.4" }
prax-mysql = { path = "prax-mysql", version = "0.9.4" }
prax-sqlite = { path = "prax-sqlite", version = "0.9.4" }
prax-mssql = { path = "prax-mssql", version = "0.9.4" }
prax-mongodb = { path = "prax-mongodb", version = "0.9.4" }
prax-duckdb = { path = "prax-duckdb", version = "0.9.4" }
prax-scylladb = { path = "prax-scylladb", version = "0.9.4" }
prax-cassandra = { path = "prax-cassandra", version = "0.9.4" }
prax-migrate = { path = "prax-migrate", version = "0.9.4" }
prax-orm-cli = { path = "prax-cli", version = "0.9.4" }
prax-sqlx = { path = "prax-sqlx", version = "0.9.4" }
prax-armature = { path = "prax-armature", version = "0.9.4" }
prax-axum = { path = "prax-axum", version = "0.9.4" }
prax-actix = { path = "prax-actix", version = "0.9.4" }
prax-import = { path = "prax-import", version = "0.9.4" }
prax-pgvector = { path = "prax-pgvector", version = "0.9.4" }

# Code generation (proc-macros)
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "2.0", features = ["full", "extra-traits", "parsing"] }
convert_case = "0.6"
pastey = "0.1"

# Async runtime
tokio = { version = "1.40", features = ["full"] }
futures = "0.3"

# Serialization
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.9"

# Error handling
thiserror = "2.0"
miette = { version = "7.0", features = ["fancy"] }

# Parsing
pest = "2.7"
pest_derive = "2.7"

# Utilities
indexmap = { version = "2.14", features = ["serde"] }
smol_str = { version = "0.3", features = ["serde"] }
smallvec = { version = "1.13", features = ["serde"] }
bumpalo = { version = "3.16", features = ["collections"] }
parking_lot = "0.12"
regex-lite = "0.1"

# Database drivers
tokio-postgres = { version = "0.7", features = ["with-serde_json-1", "with-chrono-0_4", "with-uuid-1"] }
deadpool-postgres = { version = "0.14", features = ["serde"] }
postgres-types = { version = "0.2", features = ["derive"] }
mysql_async = { version = "0.36", default-features = false, features = ["default-rustls"] }
tokio-rusqlite = "0.6"
rusqlite = { version = "0.32", features = ["bundled"] }
tiberius = { version = "0.12", default-features = false, features = ["rustls", "chrono", "tds73"] }
bb8 = "0.8"
bb8-tiberius = "0.15"
mongodb = { version = "2.8", default-features = false, features = ["tokio-runtime"] }
bson = { version = "2.13", features = ["chrono-0_4", "uuid-1", "serde_with"] }

# SQLx (alternative backend with compile-time checking)
sqlx = { version = "0.8", features = ["runtime-tokio", "tls-rustls", "macros", "json", "chrono", "uuid"] }

# pgvector (vector similarity search)
pgvector = { version = "0.4", features = ["postgres"] }

# Vector store for SQLite (LLM/RAG)
sqlite-vector-rs = "0.2.2"

# DuckDB (analytical database)
duckdb = { version = "1.4", features = ["bundled", "json", "parquet", "chrono", "serde_json", "uuid"] }

# ScyllaDB (high-performance Cassandra-compatible)
scylla = "0.14"

# Apache Cassandra driver (pure Rust)
cdrs-tokio = "9.0"

# Decimal type
rust_decimal = { version = "1.37", features = ["serde"] }

# URL parsing
url = "2.5"

# Async utilities
async-trait = "0.1"

# Tracing
tracing = "0.1"

# UUID
uuid = { version = "1.10", features = ["v4", "serde"] }

# Date/time
chrono = { version = "0.4", features = ["serde"] }

# Testing
insta = { version = "1.40", features = ["yaml"] }
pretty_assertions = "1.4"
tempfile = "3.10"
trybuild = "1.0"

# Benchmarking
criterion = { version = "0.8.0", features = ["html_reports", "async_tokio"] }

# ORM Comparison (for benchmarks)
diesel = { version = "2.2", features = ["postgres", "mysql", "sqlite", "r2d2"] }
diesel-async = { version = "0.5", features = ["postgres", "mysql", "deadpool"] }
sea-orm = { version = "1.1", features = ["sqlx-postgres", "sqlx-mysql", "sqlx-sqlite", "runtime-tokio-rustls", "macros"] }

# Profiling
tracing-subscriber = { version = "0.3", features = ["env-filter", "fmt", "json"] }
tracing-flame = "0.2"
tracing-chrome = "0.7"
pprof = { version = "0.14", features = ["flamegraph", "criterion"] }
dhat = "0.3"
memory-stats = "1.2"

[package]
name = "prax-orm"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
homepage.workspace = true
description = "A next-generation, type-safe ORM for Rust inspired by Prisma"
documentation = "https://docs.rs/prax-orm"
readme = "README.md"
keywords = ["orm", "database", "postgres", "async", "sql"]
categories = ["database", "asynchronous"]
exclude = [
    ".github/*",
    ".cursor/*",
    "TODO.md",
]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
prax-schema.workspace = true
prax-codegen.workspace = true
pastey = { workspace = true }
prax-query = { workspace = true }

[dev-dependencies]
cargo-husky = { version = "1", default-features = false, features = ["user-hooks"] }
tokio = { workspace = true }
insta = { workspace = true }
criterion = { workspace = true }
prax-schema = { workspace = true }
prax-query = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tracing = { workspace = true }
tracing-subscriber = { workspace = true }
toml = { workspace = true }
chrono = { workspace = true }
uuid = { workspace = true }
rust_decimal = { workspace = true }
trybuild = { workspace = true }

# ORM comparison benchmarks
diesel = { workspace = true }
diesel-async = { workspace = true }
sea-orm = { workspace = true }
sqlx = { workspace = true, features = ["postgres", "mysql", "sqlite", "runtime-tokio"] }
prax-postgres = { workspace = true }
prax-mysql = { workspace = true }
prax-sqlite = { workspace = true }
prax-mssql = { workspace = true }
prax-mongodb = { workspace = true }
prax-sqlx = { workspace = true }
prax-duckdb = { workspace = true }
prax-scylladb = { workspace = true }
prax-cassandra = { workspace = true }
rusqlite = { workspace = true }
bson = { workspace = true }
futures = { workspace = true }
tempfile = { workspace = true }

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

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

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

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

[package.metadata.husky.hooks]
pre-commit = ".cargo-husky/hooks/pre-commit"
pre-push = ".cargo-husky/hooks/pre-push"
commit-msg = ".cargo-husky/hooks/commit-msg"

[features]
default = ["postgres"]
postgres = []
mysql = []
sqlite = []
mssql = []
mongodb = []

# trybuild UI tests for the derive macro. Gated because trybuild stderr
# snapshots are sensitive to rustc version — run with
# `cargo test --test derive_ui --features ui-tests` on a pinned toolchain.
ui-tests = []

# Profiling features
profiling = ["tracing-subscriber", "tracing-flame", "tracing-chrome"]
heap-profiling = ["dhat"]
cpu-profiling = ["pprof"]
memory-stats = ["dep:memory-stats"]

[dependencies.memory-stats]
workspace = true
optional = true

[dependencies.tracing-subscriber]
workspace = true
optional = true

[dependencies.tracing-flame]
workspace = true
optional = true

[dependencies.tracing-chrome]
workspace = true
optional = true

[dependencies.dhat]
workspace = true
optional = true

[dependencies.pprof]
workspace = true
optional = true

# =============================================================================
# Profile Configurations
# =============================================================================

# Standard release profile - optimized for production
[profile.release]
lto = "thin"
codegen-units = 1
panic = "abort"

# Profiling profile - optimized but with debug symbols for profiling
[profile.profiling]
inherits = "release"
debug = true
strip = false

# Bench profile - optimized for benchmarks
[profile.bench]
lto = "thin"
codegen-units = 1

# Development profile - fast compile times
[profile.dev]
opt-level = 0

# Development with optimizations - faster runtime for testing
[profile.dev-opt]
inherits = "dev"
opt-level = 2
