extract DbConn from PlumeRocket #805

Закрито
igalic хоче злити 2 комітів з igalic/Plume:refactor/extract-dbconn в main
igalic прокоментував(ла) 4 роки тому
Власник

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 рецензовано 4 роки тому
plume-models/src/db_conn.rs Застарілі
@ -41,3 +12,1 @@
&self.0
}
}
#[database("plume")]
kiwii прокоментував(ла) 4 роки тому
Власник

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 прокоментував(ла) 4 роки тому
Автор
Власник

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 позначив обговорення завершеним
igalic примусово залито refactor/extract-dbconn з %!<(string=9c7af7dcd4)/code> до 3d8785e97b 4 роки тому
igalic змінився заголовок з add rocket_contrib as dependency на extract DbConn from PlumeRocket 4 роки тому
igalic прокоментував(ла) 4 роки тому
Автор
Власник
  • 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 додав 1 коміт 4 роки тому
e19069f750
remove DbConn from PlumeRocket
this means compilation fails, and for the next while, we'll try to make
it compile again ;)
igalic прокоментував(ла) 4 роки тому
Автор
Власник

closing in favour of #813

closing in favour of #813
igalic закрив цей запит на злиття 4 роки тому
Будь ласка перевідкрийте цей запит щоб здіснити операцію злиття.
Підпишіться щоб приєднатися до обговорення.
Немає рецензентів
Етап відсутній
Немає виконавця
2 учасників
Сповіщення
Дата завершення
Термін дії не дійсний або знаходиться за межами допустимого діапазону. Будь ласка використовуйте формат 'yyyy-mm-dd'.

Термін виконання не встановлений.

Залежності

No dependencies set.

Reference: Plume/Plume#805
Завантаження…
Тут ще немає жодного змісту.