#805 extract DbConn from PlumeRocket

닫힘
igalic igalic/Plume:refactor/extract-dbconn 에서 main 로 2 commits 를 머지하려 합니다
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 marked this conversation as resolved
igalic changed title from add rocket_contrib as dependency to 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 코멘트됨, 4 달 전
소유자

closing in favour of #813

closing in favour of #813
igalic closed this pull request 4 달 전
머지 작업을 수행하려면 이 풀 리퀘스트를 다시 열어주세요.
로그인하여 이 대화에 참여
No reviewers
마일스톤 없음
담당자 없음
참여자 2명
알림
마감일

마감일이 설정되지 않았습니다.

의존성

이 풀 리퀘스트는 어떠한 의존성도 가지지 않습니다.

불러오는 중...
아직 콘텐츠가 없습니다.