[package]
edition = "2024"
name = "switchy_database"
version = "0.5.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 = []
_sqlite = []
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 = [
"raw-sql",
"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",
]
raw-sql = []
schema = []
simulator = [
"sqlite-rusqlite",
"switchy_async/simulator",
"switchy_time/simulator",
]
sqlite = [
"_any_backend",
"sqlite-sqlx",
]
sqlite-rusqlite = [
"_any_backend",
"_sqlite",
"dep:regex",
"dep:rusqlite",
"placeholder-question-mark",
"switchy_async/sync",
]
sqlite-sqlx = [
"_any_backend",
"_sqlite",
"dep:futures",
"dep:regex",
"dep:sqlx",
"placeholder-question-mark",
"sqlx",
"sqlx/sqlite",
]
sqlite-test-fixtures = []
sqlx = ["_any_backend"]
tls = ["sqlx?/tls-rustls"]
turso = [
"_any_backend",
"_sqlite",
"dep:regex",
"dep:turso",
"placeholder-question-mark",
]
turso-mimalloc = [
"turso",
"turso/mimalloc",
]
uuid = [
"dep:uuid",
"sqlx?/uuid",
]
[lib]
name = "switchy_database"
path = "src/lib.rs"
[[test]]
name = "alter_table_boundary"
path = "tests/alter_table_boundary.rs"
[[test]]
name = "borrowed_selection"
path = "tests/borrowed_selection.rs"
[[test]]
name = "bounded_schema"
path = "tests/bounded_schema.rs"
[[test]]
name = "bulk_upsert_boundary"
path = "tests/bulk_upsert_boundary.rs"
[[test]]
name = "byte_length"
path = "tests/byte_length.rs"
[[test]]
name = "cached_schema_metadata"
path = "tests/cached_schema_metadata.rs"
[[test]]
name = "change_observation"
path = "tests/change_observation.rs"
[[test]]
name = "composite_schema_boundary"
path = "tests/composite_schema_boundary.rs"
[[test]]
name = "connection_lifecycle"
path = "tests/connection_lifecycle.rs"
[[test]]
name = "data_types_integration"
path = "tests/data_types_integration.rs"
[[test]]
name = "datetime_integration"
path = "tests/datetime_integration.rs"
[[test]]
name = "delete_table_boundary"
path = "tests/delete_table_boundary.rs"
[[test]]
name = "disposable_spool"
path = "tests/disposable_spool.rs"
[[test]]
name = "drop_table_boundary"
path = "tests/drop_table_boundary.rs"
[[test]]
name = "index_boundary"
path = "tests/index_boundary.rs"
[[test]]
name = "integration_tests"
path = "tests/integration_tests.rs"
[[test]]
name = "json_type"
path = "tests/json_type.rs"
[[test]]
name = "legacy_helper_boundary"
path = "tests/legacy_helper_boundary.rs"
[[test]]
name = "nullability_boundary"
path = "tests/nullability_boundary.rs"
[[test]]
name = "projection_boundary"
path = "tests/projection_boundary.rs"
[[test]]
name = "qualified_columns"
path = "tests/qualified_columns.rs"
[[test]]
name = "raw_boundary"
path = "tests/raw_boundary.rs"
[[test]]
name = "savepoint_integration"
path = "tests/savepoint_integration.rs"
[[test]]
name = "schema_key_boundary"
path = "tests/schema_key_boundary.rs"
[[test]]
name = "select_projection_boundary"
path = "tests/select_projection_boundary.rs"
[[test]]
name = "sqlite_open_policy"
path = "tests/sqlite_open_policy.rs"
[[test]]
name = "sqlx_create_boundary"
path = "tests/sqlx_create_boundary.rs"
[[test]]
name = "sqlx_foreign_keys"
path = "tests/sqlx_foreign_keys.rs"
[[test]]
name = "subquery_boundary"
path = "tests/subquery_boundary.rs"
[[test]]
name = "table_alias"
path = "tests/table_alias.rs"
[[test]]
name = "turso_insert_boundary"
path = "tests/turso_insert_boundary.rs"
[[test]]
name = "turso_integration"
path = "tests/turso_integration.rs"
[[test]]
name = "typed_joins"
path = "tests/typed_joins.rs"
[[test]]
name = "typed_maintenance"
path = "tests/typed_maintenance.rs"
[[test]]
name = "typed_triggers"
path = "tests/typed_triggers.rs"
[[test]]
name = "update_assignment_boundary"
path = "tests/update_assignment_boundary.rs"
[[test]]
name = "usage_constraints"
path = "tests/usage_constraints.rs"
[[test]]
name = "workflow_affinity"
path = "tests/workflow_affinity.rs"
[[test]]
name = "write_guard"
path = "tests/write_guard.rs"
[[test]]
name = "write_guard_witness"
path = "tests/write_guard_witness.rs"
[[test]]
name = "write_observation"
path = "tests/write_observation.rs"
[[test]]
name = "write_observation_bounds"
path = "tests/write_observation_bounds.rs"
[[bench]]
name = "database_benchmarks"
path = "benches/database_benchmarks.rs"
harness = false
required-features = ["raw-sql"]
[dependencies.actix-web]
version = "4.14.0"
optional = true
[dependencies.async-trait]
version = "0.1.92"
[dependencies.chrono]
version = "0.4.45"
features = [
"clock",
"serde",
]
default-features = false
[dependencies.deadpool-postgres]
version = "0.14.1"
optional = true
[dependencies.duckdb]
version = "=1.4.2"
optional = true
default-features = false
[dependencies.futures]
version = "0.3.33"
optional = true
[dependencies.log]
version = "0.4.33"
features = ["release_max_level_trace"]
[dependencies.moosicbox_assert]
version = "0.5.0"
default-features = false
[dependencies.moosicbox_profiles]
version = "0.5.0"
features = ["api"]
default-features = false
[dependencies.postgres-protocol]
version = "0.6.12"
features = []
optional = true
[dependencies.regex]
version = "1.13.1"
optional = true
[dependencies.rusqlite]
version = "=0.32.1"
features = ["backup"]
optional = true
[dependencies.rust_decimal]
version = "1.42.1"
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.5.0"
features = [
"sync",
"tokio",
]
default-features = false
[dependencies.switchy_time]
version = "0.5.0"
features = [
"chrono",
"std",
]
default-features = false
[dependencies.thiserror]
version = "2.0.19"
[dependencies.tokio]
version = "1.53.1"
[dependencies.tokio-postgres]
version = "0.7.18"
features = []
optional = true
[dependencies.tokio-util]
version = "0.7.19"
optional = true
[dependencies.turso]
version = "0.6.1"
optional = true
default-features = false
[dependencies.uuid]
version = "1.24.0"
features = ["v4"]
optional = true