Skip to content
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

Merged
merged 5 commits into from
Dec 24, 2024

Conversation

dracarys18
Copy link
Member

This PR make the storage layer plugin-able in the intention of adding another storage layer should be simple enough

type AdapterType = Cassandra;

async fn from_config(_config: &Config) -> Self {
unimplemented!("Not implemented Yet")
Copy link
Member

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:

  1. Lints to include: https://github.com/juspay/hyperswitch/blob/0dba763c3a1c69fa282ffa644a12d37dc14d8f7b/Cargo.toml#L12-L38
  2. 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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have this already

Copy link
Member

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?

Copy link
Member

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/storage/adapter/postgres.rs Show resolved Hide resolved
src/app.rs Outdated

#[cfg(feature = "cassandra")]
type StorageState = DbState<adapter::Cassandra>;
type StorageState = DbState<Pool<AsyncPgConnection>, adapter::Cassandra>;
Copy link
Member

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?

Copy link
Member Author

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)]
Copy link
Member

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?

@dracarys18 dracarys18 changed the title feat: make the storage layer pluginable feat: make storage layer pluginable and add cassandra support Dec 20, 2024
@dracarys18 dracarys18 merged commit 834faeb into main Dec 24, 2024
2 checks passed
@dracarys18 dracarys18 deleted the plugin_storage branch December 24, 2024 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants