Open ThisIsMani opened 4 days ago
Hey @ThisIsMani according to the description , the files , namely dashboard_metadata.rs
, user_role.rs
, user.rs
and role.rs
, have methods which either read from the database or write or maybe update the database using pg_connection_write()
, so to solve this problem , we need to identify where the database is used to read , like in functions like find_by_user_email()
and change the pg_connection_write()
to pg_connection_read()
, If I am correct, I would like to go ahead and work on this issue
Feature Description
Currently, in our codebase, we are using
pg_connection_write
for database operations even when performing read operations, which is inefficient. Thepg_connection_write
function should only be used when we need to perform write operations. For read operations, we should usepg_connection_read
to optimize resource usage.Possible Implementation
Find occurrences of the usage of
pg_connection_write
for read operations and replace them withpg_connection_read
in the following files:crates/router/src/db/role.rs
crates/router/src/db/user.rs
crates/router/src/db/user_role.rs
crates/router/src/db/dashboard_metadata.rs
find_by_*
,get_*
) but are usingpg_connection_write
.pg_connection_write
withpg_connection_read
in these functions.Have you spent some time checking if this feature request has been raised before?
Have you read the Contributing Guidelines?
Are you willing to submit a PR?
No, but I'm happy to collaborate on a PR with someone else