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 标记问题为已解决
igalic2020-07-19 17:02:38 +00:00 强制推送 refactor/extract-dbconn,从 9c7af7dcd4,至 3d8785e97b 比较
igalic2020-07-20 11:56:24 +00:00 修改标题 add rocket_contrib as dependencyextract DbConn from PlumeRocket
作者
管理员
  • 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.
igalic2020-07-20 14:12:51 +00:00 推送了 1 个提交
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
igalic2020-07-26 19:37:56 +00:00关闭此合并请求

合并请求已关闭

登录 并参与到对话中。
无评审员
未选择里程碑
暂无项目
未指派成员
2 位参与者
通知
到期时间
到期日期无效或超出范围。请使用“yyyy-mm-dd”格式。

未设置到期时间。

依赖工单

没有设置依赖项。

引用:Plume/Plume#805
没有提供说明。