Skip to content

Commit fd42ee4

Browse files
authored
fix: Rename precondition. (#39)
1 parent 828eafb commit fd42ee4

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,14 @@ match result {
114114

115115
*Note that according to the CloudEvents standard, event IDs must be of type string.*
116116

117-
#### Using the `IsEventQLTrue` precondition
117+
#### Using the `IsEventQLQueryTrue` precondition
118118

119-
If you want to write events depending on an EventQL query, use the `IsEventQLTrue` precondition to create a precondition and pass it in a vector as the second argument:
119+
If you want to write events depending on an EventQL query, use the `IsEventQLQueryTrue` precondition to create a precondition and pass it in a vector as the second argument:
120120

121121
```rust
122122
let result = client.write_events(
123123
vec![event.clone()],
124-
vec![Precondition::IsEventQLTrue {
124+
vec![Precondition::IsEventQLQueryTrue {
125125
query: "FROM e IN events WHERE e.type == 'io.eventsourcingdb.library.book-borrowed' PROJECT INTO COUNT() < 10".to_string(),
126126
}],
127127
).await;
@@ -449,4 +449,4 @@ In case you need to set up the client yourself, use the following functions to g
449449
- `get_host()` returns the host name
450450
- `get_mapped_port()` returns the port
451451
- `get_base_url()` returns the full URL of the container
452-
- `get_api_token()` returns the API token
452+
- `get_api_token()` returns the API token

src/client/precondition.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ pub enum Precondition {
2020
event_id: String,
2121
},
2222
/// Check if an EventQL query returns true
23-
#[serde(rename = "isEventQlTrue")]
24-
IsEventQLTrue {
23+
#[serde(rename = "isEventQlQueryTrue")]
24+
IsEventQLQueryTrue {
2525
/// The EventQL query to check
2626
query: String,
2727
},

tests/write_events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ async fn write_events_with_is_eventql_true_condition() {
224224
let result = client
225225
.write_events(
226226
event_candidates.clone(),
227-
vec![Precondition::IsEventQLTrue {
227+
vec![Precondition::IsEventQLQueryTrue {
228228
query: "FROM e IN events PROJECT INTO COUNT() == 0".to_string(),
229229
}],
230230
)

0 commit comments

Comments
 (0)