Skip to content

Commit 5954658

Browse files
authored
eventually: add 'postgres' feature flag (#98)
1 parent bfa7119 commit 5954658

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

eventually-postgres/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "eventually-postgres"
33
description = "Event Store implementation using PostgreSQL for the Eventually crate"
4-
version = "0.1.3"
4+
version = "0.2.0"
55
edition = "2018"
66
authors = ["Danilo Cianfrone <danilocianfr@gmail.com>"]
77
license = "MIT"
@@ -12,7 +12,7 @@ categories = ["web-programming", "asynchronous"]
1212
keywords = ["postgres", "postgresql", "database", "ddd", "event-sourcing"]
1313

1414
[dependencies]
15-
eventually = { version = "0.4", path = "../eventually", features = ["serde"] }
15+
eventually-core = { version = "0.4", path = "../eventually-core", features = ["serde"] }
1616

1717
futures = "0.3"
1818
serde = "1.0"

eventually-postgres/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ use std::convert::TryFrom;
5757
use std::fmt::Display;
5858
use std::sync::Arc;
5959

60-
use eventually::store::{AppendError, EventStream, Expected, Persisted, Select};
61-
use eventually::{Aggregate, AggregateId};
60+
use eventually_core::aggregate::{Aggregate, AggregateId};
61+
use eventually_core::store::{AppendError, EventStream, Expected, Persisted, Select};
6262

6363
use futures::future::BoxFuture;
6464
use futures::stream::{StreamExt, TryStreamExt};
@@ -229,7 +229,7 @@ pub struct EventStore<Id, Event> {
229229
payload: std::marker::PhantomData<Event>,
230230
}
231231

232-
impl<Id, Event> eventually::EventStore for EventStore<Id, Event>
232+
impl<Id, Event> eventually_core::store::EventStore for EventStore<Id, Event>
233233
where
234234
Id: TryFrom<String> + Display + Eq + Send + Sync,
235235
// This bound is for the translation into an anyhow::Error.

eventually/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ keywords = ["architecture", "ddd", "event-sourcing", "cqrs", "es"]
1414
[features]
1515
default = []
1616
serde = ["eventually-core/serde", "eventually-util/serde"]
17-
full = ["serde"]
17+
postgres = ["eventually-postgres"]
18+
full = ["serde", "postgres"]
1819

1920
[dependencies]
2021
eventually-core = { version = "0.4", path = "../eventually-core" }
2122
eventually-util = { version = "0.4", path = "../eventually-util" }
23+
eventually-postgres = { version = "0.2", path = "../eventually-postgres", optional = true }
2224

2325
[dev-dependencies]
2426
futures = { version = "0.3", features = ["async-await"] }

eventually/src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,8 @@ pub mod optional {
3636
pub mod inmemory {
3737
pub use eventually_util::inmemory::*;
3838
}
39+
40+
#[cfg(feature = "postgres")]
41+
pub mod postgres {
42+
pub use eventually_postgres::*;
43+
}

0 commit comments

Comments
 (0)