extract DbConn from PlumeRocket #805

已關閉
igalic 想從 igalic/Plume:refactor/extract-dbconn 合併 2 個提交至 main
所有者

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

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.
作者
所有者

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 自 9c7af7dcd43d8785e97b 2020-07-19 17:02:38 +00:00 比較
igalic 將標題從 add rocket_contrib as dependency 改為 extract DbConn from PlumeRocket 2020-07-20 11:56:24 +00:00
作者
所有者
  • 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 個提交 2020-07-20 14:12:51 +00:00
this means compilation fails, and for the next while, we'll try to make
it compile again ;)
作者
所有者

closing in favour of #813

closing in favour of #813
igalic 關閉了這個合併請求 2020-07-26 19:37:56 +00:00

合併請求已關閉

登入 才能加入這對話。
沒有審核者
沒有里程碑
未選擇專案
沒有負責人
2 位參與者
通知
截止日期
截止日期無效或超出範圍,請使用「yyyy-mm-dd」的格式。

未設定截止日期。

先決條件

未設定先決條件。

參考: Plume/Plume#805
沒有提供敘述。