Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions crates/crates_io_test_db/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ use crates_io_test_db::TestDatabase;
async fn test_database_operations() {
// Create a new test database with all migrations applied
let test_db = TestDatabase::new();

// Get an async connection
let mut conn = test_db.async_connect().await;

// Perform your database operations...
// Database is automatically cleaned up when test_db is dropped
}
Expand All @@ -45,7 +45,7 @@ fn test_with_empty_database() {
// Create an empty database without migrations
let test_db = TestDatabase::empty();
let mut conn = test_db.connect();

// Database starts completely empty
}
```
Expand All @@ -59,7 +59,7 @@ use crates_io_test_db::TestDatabase;
fn test_with_database_url() {
let test_db = TestDatabase::new();
let url = test_db.url();

// Use the URL with your preferred database client
}
```
Expand All @@ -83,6 +83,7 @@ export TEST_DATABASE_URL="postgres://postgres:postgres@localhost/crates_io_test"
```

The crate will automatically create:

- A template database: `crates_io_test_template` (with all migrations applied)
- Individual test databases: `crates_io_test_<random_suffix>` (created from template)

Expand Down
4 changes: 2 additions & 2 deletions crates/crates_io_worker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ impl BackgroundJob for SendEmailJob {
const PRIORITY: i16 = 10;
const DEDUPLICATED: bool = false;
const QUEUE: &'static str = "emails";

type Context = AppContext;

async fn run(&self, ctx: Self::Context) -> anyhow::Result<()> {
// Job implementation
ctx.email_service.send(&self.to, &self.subject, &self.body).await?;
Expand Down