โ ๏ธ Development Status: This crate is currently under active development and is not yet ready for production use. APIs may change significantly between versions.
A Rust implementation of Testcontainers for Supabase services. This crate provides utilities for setting up and managing Supabase services in a containerized environment, primarily for testing purposes.
Add this to your Cargo.toml
:
[dependencies]
supabase-testcontainers-modules = "0.1.0"
Or with specific features:
[dependencies]
supabase-testcontainers-modules = { version = "0.1.0", features = ["auth"] }
analytics
- Enables the Supabase Analytics service container supportauth
- Enables the Supabase Auth service container supportconst
- Provides constant values used throughout the crateerror
- Enables error handling functionalityfunctions
- Enables the Edge Functions service container supportgraphql
- Enables the GraphQL (pg_graphql) service container supportpostgrest
- Enables the PostgREST service container supportpostgres_testcontainer
- Enables PostgreSQL container supportrealtime
- Enables the Realtime service container supportstorage
- Enables the Storage service container support
use supabase_testcontainers_modules::Auth;
use testcontainers::Docker;
#[tokio::main]
async fn main() {
// Create a new Docker instance
let docker = Docker::new();
// Start an Auth container
let auth = Auth::new(&docker);
// The container is now running and ready for testing
// You can access it through the provided methods
}
When using the postgres_testcontainer
feature:
use supabase_testcontainers_modules::Auth;
use testcontainers::Docker;
#[tokio::main]
async fn main() {
let docker = Docker::new();
let auth = Auth::new(&docker)
.with_postgres() // This will automatically set up and configure PostgreSQL
.await;
// Both Auth and PostgreSQL containers are now running
}
The following Supabase services are implemented or planned:
- Analytics
- Auth (partially implemented)
- Edge Functions
- GraphQL (pg_graphql)
- PostgREST
- Realtime
- Storage
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License.