refactor(storage): Add a separate crate to represent store implementations (#1853)

This commit is contained in:
Sampras Lopes
2023-08-10 12:55:02 +05:30
committed by GitHub
parent a95fa58179
commit 32b731d959
14 changed files with 855 additions and 425 deletions

View File

@ -84,7 +84,7 @@ pub async fn pg_connection_read(
> {
// If only OLAP is enabled get replica pool.
#[cfg(all(feature = "olap", not(feature = "oltp")))]
let pool = &store.replica_pool;
let pool = &store.diesel_store.replica_pool;
// If either one of these are true we need to get master pool.
// 1. Only OLTP is enabled.
@ -95,7 +95,7 @@ pub async fn pg_connection_read(
all(feature = "olap", feature = "oltp"),
all(not(feature = "olap"), not(feature = "oltp"))
))]
let pool = &store.master_pool;
let pool = &store.diesel_store.master_pool;
pool.get()
.await
@ -110,7 +110,7 @@ pub async fn pg_connection_write(
errors::StorageError,
> {
// Since all writes should happen to master DB only choose master DB.
let pool = &store.master_pool;
let pool = &store.diesel_store.master_pool;
pool.get()
.await