#805 extract DbConn from PlumeRocket

Geschlossen
igalic möchte 2 Commits von igalic/Plume:refactor/extract-dbconn nach main zusammenführen
igalic hat vor 4 Monaten kommentiert

in the following Pull Request, we’lle extract DbConn from PlumeRocket, as suggested in #797

  • use rocket_contrib’s #[database] to implement our DbConn
  • we do not use #[database]'s connection setup, retaining our own init_pool() and ConnectionCustomization!
  • pass DbConn in as ref instead of Copying it around.
in the following Pull Request, we'lle extract `DbConn` from `PlumeRocket`, as suggested in https://git.joinplu.me/Plume/Plume/issues/797 - use rocket_contrib's `#[database]` to implement our `DbConn` - we do *not* use `#[database]`'s connection setup, retaining our own `init_pool()` and `ConnectionCustomization`! - pass `DbConn` in as `ref` instead of `Copy`ing it around.
kiwii hat vor 4 Monaten überprüft
plume-models/src/db_conn.rs
@@ -41,3 +12,1 @@
&self.0
}
}
#[database("plume")]
kiwii hat vor 4 Monaten kommentiert

I think you’ll have to edit plume-models/src/config.rs so that Rocket knows the URL of this “plume” database.

I think you'll have to edit `plume-models/src/config.rs` so that Rocket knows the URL of this "plume" database.
igalic hat vor 4 Monaten kommentiert

yesno… we want to retain our ConnectionCustomization, so we’re keeping our own init_pool().

yesno… we want to retain our `ConnectionCustomization`, so we're keeping our own `init_pool()`.
igalic markierte diese Unterhaltung als gelöst
igalic hat den Titel von add rocket_contrib as dependency zu extract DbConn from PlumeRocket vor 4 Monaten geändert
igalic hat vor 4 Monaten kommentiert
Besitzer
  • pass DbConn in as ref instead of Copying it around.

This will help with the async migration, as we’re currently passing all of PlumeRocket around as ref, which means that it ends up sitting somewhere in a function, until it’s .awaited.

This can create lead us into a big mess, which may be impossible to untangle, so this should help not running into that to begin with.

> - pass `DbConn` in as `ref` instead of `Copy`ing it around. This will help with the `async` migration, as we're currently passing all of PlumeRocket around as `ref`, which means that it ends up sitting *somewhere* in a function, until it's `.await`ed. This can create lead us into a big mess, which may be impossible to untangle, so this should help *not* running into that to begin with.
igalic hat vor 4 Monaten kommentiert
Besitzer

closing in favour of #813

closing in favour of #813
igalic hat diesen Pull-Request vor 4 Monaten geschlossen
Bitte diesen Pull-Request wieder öffnen, um die Merge-Operation auszuführen.
Anmelden, um an der Diskussion teilzunehmen.
Keine Reviewer
Kein Meilenstein
Niemand zuständig
2 Beteiligte
Nachrichten
Fällig am

Kein Fälligkeitsdatum gesetzt.

Abhängigkeiten

Dieser Pull-Request hat momentan keine Abhängigkeiten.

Laden…
Hier gibt es bis jetzt noch keinen Inhalt.