9
18
Fork 24

extract DbConn from PlumeRocket #805

Geschlossen
igalic möchte 2 Commits von igalic/Plume:refactor/extract-dbconn nach main zusammenführen
Besitzer

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 2020-07-19 12:08:57 +00:00 gereviewt
@ -41,3 +12,1 @@
&self.0
}
}
#[database("plume")]
Besitzer

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.
Autor
Besitzer

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 2020-07-19 17:02:38 +00:00 refactor/extract-dbconn von 9c7af7dcd4 zu 3d8785e97b force-gepusht Vergleichen
igalic hat den Titel von add rocket_contrib as dependency zu extract DbConn from PlumeRocket 2020-07-20 11:56:24 +00:00 geändert
Autor
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 1 Commit 2020-07-20 14:12:51 +00:00 hinzugefügt
this means compilation fails, and for the next while, we'll try to make
it compile again ;)
Autor
Besitzer

closing in favour of #813

closing in favour of #813
igalic hat diesen Pull-Request 2020-07-26 19:37:56 +00:00 geschlossen

Pull-Request geschlossen

Anmelden, um an der Diskussion teilzunehmen.
Keine Reviewer
Kein Meilenstein
Kein Projekt
Niemand zuständig
2 Beteiligte
Nachrichten
Fällig am
Das Fälligkeitsdatum ist ungültig oder außerhalb des zulässigen Bereichs. Bitte verwende das Format „jjjj-mm-tt“.

Kein Fälligkeitsdatum gesetzt.

Abhängigkeiten

Keine Abhängigkeiten gesetzt.

Referenz: Plume/Plume#805
Keine Beschreibung angegeben.