We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 877c2d2 commit 579e097Copy full SHA for 579e097
README.md
@@ -90,15 +90,15 @@ async fn service(messages: Vec<String>) -> Result<(), anyhow::Error> {
90
### Batch insert rows and return them
91
92
```rust
93
-use batched::batched;
+use batched::{batched, error::SharedError};
94
95
struct Row {
96
pub id: usize,
97
pub content: String,
98
}
99
100
#[batched(window = 100, limit = 100_000)]
101
-async fn insert_message_batched(messages: Vec<String>) -> Vec<Row> {
+async fn insert_message_batched(messages: Vec<String>) -> Result<Vec<Row>, SharedError<anyhow::Error>> {
102
let pool = PgPool::connect("postgres://user:password@localhost/dbname").await?;
103
let mut query = String::from("INSERT INTO messages (content) VALUES ");
104
...
0 commit comments