[Refactoring] Move DbConn out PlumeRocket #797
Tunnisteet
Ei tunnisteita
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
Ei merkkipaalua
Ei projektia
Ei käsittelijää
2 osallistujaa
Ilmoitukset
Määräpäivä
Määräpäivää ei ole asetettu.
Riippuvuudet
Riippuvuuksia ei asetettu.
Viittaus: Plume/Plume#797
Ladataan…
Lisää taulukko
Viittaa uudessa ongelmassa
Ei kuvausta.
Poista haara "%!s()"
Haaran poistaminen on pysyvä toimenpide. Vaikka poistettu haara voi jäädä olemaan lyhyeksi ajaksi, ennen kuin todellisesti poistetaan, poistoa EI VOI perua useimmiten. Jatketaanko?
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