-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: make storage layer pluginable and add cassandra support #31
Conversation
src/storage/adapter/cassandra.rs
Outdated
type AdapterType = Cassandra; | ||
|
||
async fn from_config(_config: &Config) -> Self { | ||
unimplemented!("Not implemented Yet") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we include lints in Cargo.toml
?
References:
- Lints to include: https://github.com/juspay/hyperswitch/blob/0dba763c3a1c69fa282ffa644a12d37dc14d8f7b/Cargo.toml#L12-L38
- Since we don't have a workspace here, refer to how we include lints in card vault: https://github.com/juspay/hyperswitch-card-vault/blob/db89f3be1e09dbf80a29828da20f5367c6d7fb1b/Cargo.toml#L106-L123
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have this already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the CI check not failing, then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this being annotated with #[async_trait::async_trait]
is causing clippy to not throw any warnings.
src/app.rs
Outdated
|
||
#[cfg(feature = "cassandra")] | ||
type StorageState = DbState<adapter::Cassandra>; | ||
type StorageState = DbState<Pool<AsyncPgConnection>, adapter::Cassandra>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be included ideally, for Cassandra?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a placeholder will add a comment
src/storage.rs
Outdated
impl<C, T: DbAdapterType> DbState<C, T> | ||
where | ||
Self: DbAdapter, | ||
{ | ||
/// # Panics | ||
/// | ||
/// Panics if unable to connect to Database | ||
#[allow(clippy::expect_used)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also remove the allow annotation here?
94468ae
to
556e21d
Compare
…ce into plugin_storage
This PR make the storage layer plugin-able in the intention of adding another storage layer should be simple enough