[package]
edition = "2024"
name = "switchy_database"
version = "0.3.0"
authors = ["Braden Steffaniak"]
build = false
autolib = false
autobins = false
autoexamples = false
autotests = false
autobenches = false
description = "Switchy database package"
readme = "README.md"
keywords = [
"database",
"mysql",
"postgres",
"sqlite",
]
categories = ["database"]
license = "MPL-2.0"
repository = "https://github.com/MoosicBox/MoosicBox"
[package.metadata]
examples = true
[package.metadata.workspaces]
group = "switchy"
[features]
_any_backend = []
all-placeholders = [
"placeholder-at-number",
"placeholder-colon-number",
"placeholder-dollar-number",
"placeholder-named-colon",
"placeholder-question-mark",
]
api = [
"dep:actix-web",
"dep:futures",
"moosicbox_profiles/api",
]
auto-reverse = []
cascade = ["schema"]
decimal = [
"dep:rust_decimal",
"sqlx?/rust_decimal",
]
default = [
"all-placeholders",
"api",
"auto-reverse",
"cascade",
"decimal",
"duckdb",
"mysql",
"postgres-sqlx",
"schema",
"simulator",
"sqlite-rusqlite",
"sqlite-sqlx",
"turso",
"uuid",
]
duckdb = [
"_any_backend",
"dep:duckdb",
"dep:regex",
"placeholder-question-mark",
"switchy_async/sync",
]
duckdb-bundled = [
"duckdb",
"duckdb/bundled",
]
fail-on-warnings = [
"moosicbox_assert/fail-on-warnings",
"moosicbox_profiles/fail-on-warnings",
"switchy_async/fail-on-warnings",
"switchy_time/fail-on-warnings",
]
mysql = [
"_any_backend",
"mysql-sqlx",
"sqlx",
]
mysql-sqlx = [
"_any_backend",
"dep:futures",
"dep:sqlx",
"placeholder-question-mark",
"sqlx",
"sqlx/mysql",
]
placeholder-at-number = ["dep:regex"]
placeholder-colon-number = ["dep:regex"]
placeholder-dollar-number = ["dep:regex"]
placeholder-named-colon = ["dep:regex"]
placeholder-question-mark = []
postgres = [
"_any_backend",
"dep:futures",
"dep:regex",
"dep:tokio-util",
"postgres-raw",
]
postgres-raw = [
"_any_backend",
"dep:deadpool-postgres",
"dep:postgres-protocol",
"dep:tokio-postgres",
"placeholder-dollar-number",
"postgres",
]
postgres-sqlx = [
"_any_backend",
"dep:sqlx",
"dep:sqlx-postgres",
"placeholder-dollar-number",
"postgres",
"sqlx",
"sqlx-postgres/chrono",
"sqlx/postgres",
]
schema = []
simulator = [
"sqlite-rusqlite",
"switchy_async/simulator",
"switchy_time/simulator",
]
sqlite = [
"_any_backend",
"sqlite-sqlx",
]
sqlite-rusqlite = [
"_any_backend",
"dep:regex",
"dep:rusqlite",
"placeholder-question-mark",
"switchy_async/sync",
]
sqlite-sqlx = [
"_any_backend",
"dep:futures",
"dep:regex",
"dep:sqlx",
"placeholder-question-mark",
"sqlx",
"sqlx/sqlite",
]
sqlx = ["_any_backend"]
tls = ["sqlx?/tls-rustls"]
turso = [
"_any_backend",
"dep:regex",
"dep:turso",
"placeholder-question-mark",
]
uuid = [
"dep:uuid",
"sqlx?/uuid",
]
[lib]
name = "switchy_database"
path = "src/lib.rs"
[[test]]
name = "data_types_integration"
path = "tests/data_types_integration.rs"
[[test]]
name = "datetime_integration"
path = "tests/datetime_integration.rs"
[[test]]
name = "integration_tests"
path = "tests/integration_tests.rs"
[[test]]
name = "savepoint_integration"
path = "tests/savepoint_integration.rs"
[[test]]
name = "turso_integration"
path = "tests/turso_integration.rs"
[[bench]]
name = "database_benchmarks"
path = "benches/database_benchmarks.rs"
harness = false
[dependencies.actix-web]
version = "4.13.0"
optional = true
[dependencies.async-trait]
version = "0.1.89"
[dependencies.chrono]
version = "0.4.44"
features = [
"clock",
"serde",
]
default-features = false
[dependencies.deadpool-postgres]
version = "0.14.1"
optional = true
[dependencies.duckdb]
version = "1.10502.0"
optional = true
default-features = false
[dependencies.futures]
version = "0.3.32"
optional = true
[dependencies.log]
version = "0.4.29"
features = ["release_max_level_trace"]
[dependencies.moosicbox_assert]
version = "0.3.0"
default-features = false
[dependencies.moosicbox_profiles]
version = "0.3.0"
features = ["api"]
default-features = false
[dependencies.postgres-protocol]
version = "0.6.11"
features = []
optional = true
[dependencies.regex]
version = "1.12.3"
optional = true
[dependencies.rusqlite]
version = "=0.32.1"
features = ["bundled"]
optional = true
[dependencies.rust_decimal]
version = "1.42.0"
features = [
"std",
"tokio-pg",
]
optional = true
default-features = false
[dependencies.sqlx]
version = "0.8.6"
features = ["runtime-tokio"]
optional = true
default-features = false
[dependencies.sqlx-postgres]
version = "0.8.6"
features = ["chrono"]
optional = true
default-features = false
[dependencies.switchy_async]
version = "0.3.0"
features = [
"sync",
"tokio",
]
default-features = false
[dependencies.switchy_time]
version = "0.3.0"
features = [
"chrono",
"std",
]
default-features = false
[dependencies.thiserror]
version = "2.0.18"
[dependencies.tokio]
version = "1.52.3"
[dependencies.tokio-postgres]
version = "0.7.17"
features = []
optional = true
[dependencies.tokio-util]
version = "0.7.18"
optional = true
[dependencies.turso]
version = "0.6.0"
features = ["mimalloc"]
optional = true
default-features = false
[dependencies.uuid]
version = "1.23.1"
features = ["v4"]
optional = true