extract DbConn from PlumeRocket #805

Fechado
igalic quer aplicar o merge de 2 commits de igalic/Plume:refactor/extract-dbconn em main
Proprietário

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 revisou 4 anos atrás
@ -41,3 +12,1 @@
&self.0
}
}
#[database("plume")]
Proprietário

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
Proprietário

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 marcou esta conversa como resolvida
igalic forçou o push refactor/extract-dbconn de 9c7af7dcd4 para 3d8785e97b 4 anos atrás
igalic alterou o título de add rocket_contrib as dependency para extract DbConn from PlumeRocket 4 anos atrás
Autor
Proprietário
  • 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 adicionou 1 commit 4 anos atrás
e19069f750
remove DbConn from PlumeRocket
this means compilation fails, and for the next while, we'll try to make
it compile again ;)
Autor
Proprietário

closing in favour of #813

closing in favour of #813
igalic fechou este pull request 4 anos atrás
Por favor reabra este pull request para aplicar o merge.
Acesse para participar desta conversação.
Sem revisor
Sem marco
Sem responsável
2 participante(s)
Notificações
Data limite
A data limite é inválida ou está fora do intervalo. Por favor, use o formato 'dd/mm/aaaa'.

Data limite não informada.

Dependências

Nenhuma dependência definida.

Referência: Plume/Plume#805
Carregando…
Ainda não há conteúdo.