[package] name = "db-pool" version = "0.4.0" edition = "2021" description = "A thread-safe database pool for running database-tied integration tests in parallel" license = "MIT" repository = "https://github.com/yasamoka/db-pool" documentation = "https://docs.rs/db-pool" readme = "README.md" categories = ["development-tools::testing", "database", "web-programming"] keywords = ["database", "pool", "parallel", "test", "web"] exclude = [".vscode", ".github", "book"] [package.metadata.docs.rs] all-features = true [dependencies] async-trait = { version = "0.1.77", optional = true } bb8 = { version = "0.8.5", optional = true } bb8-postgres = { version = "0.8.1", optional = true } deadpool = { version = "0.9.5", optional = true } deadpool-postgres = { version = "0.14.0", optional = true } diesel = { version = "2.2.4", optional = true } diesel-async = { version = "0.5.0", optional = true } futures = { version = "0.3.30", optional = true } mobc = { version = "0.8.4", optional = true } mobc-postgres = { version = "0.8.0", optional = true } parking_lot = "0.12.3" r2d2 = { version = "0.8.10", optional = true } r2d2_mysql = { version = "25.0.0", optional = true } r2d2_postgres = { version = "0.18.1", optional = true } sea-orm = { version = "1.0.1", features = ["runtime-tokio"], optional = true } sqlx = { version = "0.8.2", default-features = false, features = [ "macros", "runtime-tokio", ], optional = true } tokio = { version = "1.36.0", optional = true } tokio-postgres = { version = "0.7.10", optional = true } uuid = { version = "1.10.0", features = ["v4"] } [dev-dependencies] async-graphql = "7.0.9" async-graphql-poem = "7.0.9" bb8 = "0.8.3" bb8-postgres = "0.8.1" diesel = { version = "2.2.4", features = ["mysql", "postgres", "r2d2"] } diesel-async = { version = "0.5.0", features = ["bb8", "mysql", "postgres"] } diesel_async_migrations = "0.15.0" dotenvy = "0.15.7" futures = "0.3.30" mysql = "25.0.1" poem = "3.0.4" postgres = "0.19.8" r2d2 = "0.8.10" serde = "1.0.209" serde_json = "1.0.128" sqlx = { version = "0.8.2", default-features = false, features = [ "mysql", "postgres", "runtime-tokio", ] } tokio = { version = "1.36.0", features = ["macros", "rt-multi-thread"] } tokio-postgres = "0.7.10" tokio-shared-rt = "0.1.0" tokio-test = "0.4.4" [features] # DBMSes _mysql = [] _postgres = [] # Sync _sync = ["dep:r2d2"] # Sync backends _sync-mysql = ["_sync", "_mysql"] _sync-postgres = ["_sync", "_postgres"] # Sync Diesel backends _diesel = ["_sync", "dep:diesel", "diesel/r2d2"] diesel-mysql = ["_sync-mysql", "_diesel", "diesel/mysql"] diesel-postgres = ["_sync-postgres", "_diesel", "diesel/postgres"] # Other sync MySQL backends mysql = ["_sync-mysql", "dep:r2d2_mysql"] # Other sync Postgres backends postgres = ["_sync-postgres", "dep:r2d2_postgres"] # Async _async = [ "dep:async-trait", "dep:bb8", "dep:futures", "dep:tokio", "tokio/rt-multi-thread", ] # Async backends _async-mysql = ["_async", "_mysql"] _async-postgres = ["_async", "_postgres"] # Diesel-async _diesel-async = ["_async", "dep:diesel", "dep:diesel-async"] # Diesel-async pools diesel-async-bb8 = ["_diesel-async", "dep:bb8", "diesel-async/bb8"] diesel-async-deadpool = [ "_diesel-async", "dep:deadpool", "deadpool/managed", "diesel-async/deadpool", ] diesel-async-mobc = ["_diesel-async", "dep:mobc", "diesel-async/mobc"] # Diesel-async backends diesel-async-mysql = ["_async-mysql", "_diesel-async", "diesel-async/mysql"] diesel-async-postgres = [ "_async-postgres", "_diesel-async", "diesel-async/postgres", ] # SeaORM _sea-orm = ["dep:sea-orm"] # SeaORM backends sea-orm-mysql = ["_async-mysql", "_sea-orm", "sea-orm/sqlx-mysql"] sea-orm-postgres = ["_async-postgres", "_sea-orm", "sea-orm/sqlx-postgres"] # sqlx _sqlx = ["dep:sqlx"] # sqlx backends sqlx-mysql = ["_async-mysql", "_sqlx", "sqlx/mysql"] sqlx-postgres = ["_async-postgres", "_sqlx", "sqlx/postgres"] # tokio-postgres backend tokio-postgres = ["_async-postgres", "dep:tokio-postgres"] # tokio-postgres pools tokio-postgres-bb8 = ["tokio-postgres", "dep:bb8", "dep:bb8-postgres"] tokio-postgres-deadpool = [ "tokio-postgres", "dep:deadpool", "dep:deadpool-postgres", "deadpool/managed", ] tokio-postgres-mobc = ["tokio-postgres", "dep:mobc", "dep:mobc-postgres"] deadpool-postgres = ["dep:deadpool-postgres"] mobc-postgres = ["dep:mobc-postgres"] # Sync examples [[example]] name = "diesel_mysql" required-features = ["diesel-mysql"] test = true [[example]] name = "diesel_postgres" required-features = ["diesel-postgres"] test = true [[example]] name = "mysql" required-features = ["mysql"] test = true [[example]] name = "postgres" required-features = ["postgres"] test = true # Async examples [[example]] name = "async-graphql" required-features = ["diesel-async-postgres", "diesel-async-bb8"] test = true [[example]] name = "diesel_async_mysql" required-features = ["diesel-async-mysql", "diesel-async-bb8"] test = true [[example]] name = "diesel_async_postgres" required-features = ["diesel-async-postgres", "diesel-async-bb8"] test = true [[example]] name = "sea_orm_mysql" required-features = ["sea-orm-mysql", "sqlx/runtime-tokio"] test = true [[example]] name = "sea_orm_postgres" required-features = ["sea-orm-postgres", "sqlx/runtime-tokio"] test = true [[example]] name = "sqlx_mysql" required-features = ["sqlx-mysql", "sqlx/runtime-tokio"] test = true [[example]] name = "sqlx_postgres" required-features = ["sqlx-postgres", "sqlx/runtime-tokio"] test = true [[example]] name = "tokio_postgres" required-features = ["tokio-postgres", "tokio-postgres-bb8"] test = true