[Refactoring] Move DbConn out PlumeRocket #797
Labels
No labels
A: API
A: Backend
A: Federation
A: Front-End
A: I18N
A: Meta
A: Security
Build
C: Bug
C: Discussion
C: Enhancement
C: Feature
Compatibility
Dependency
Design
Documentation
Good first issue
Help welcome
Mobile
Rendering
S: Blocked
S: Duplicate
S: Incomplete
S: Instance specific
S: Invalid
S: Needs Voting/Discussion
S: Ready for review
Suggestion
S: Voted on Loomio
S: Wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: Plume/Plume#797
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, we pass the
struct
PlumeRocket
to most routes:The reason for refactoring (#462) was clippy warning us about too many arguments to our route functions.
so we collected all the data that clumped together in the parameter lists, into a single Object.
This is presenting problems, when trying to migrate to async rocket.
I think we should extract DbConn again.
This should (could?) allow us to use
#[database]
guard, making ourasync
migration slightly less pain-freer.What do we need to do?
DbConn
with#[database]
rockets.conn
, anddbconn
, replacing itDbConn
fromPlumeRockets
Benefits? Drawbacks? Alternatives?
Discuss!
What I can tell out of my head is:
#[database]
attribute that generates some code for us, I guess.sqlx
with the#[database]
attribute, I don't know what types SQLx supports, and if they are compatible with Rocket's attribute.Clippy shouldn't be unhappy either, it is just one parameter, so I'm all for it!
kiwii referenced this issue2020-07-15 10:48:31 +00:00
KitaitiMakoto referenced this issue2021-01-30 14:28:46 +00:00