feat: return with sqlx
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
2daa0864e2
commit
8b080f2f43
@ -62,29 +62,20 @@ impl DaggerMiddleware for Sqlx {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub trait SqlxExt {
|
pub trait SqlxExt {
|
||||||
fn with_sqlx(&mut self) -> &mut Self {
|
fn with_sqlx(&mut self) -> &mut Self;
|
||||||
self
|
fn with_sqlx_migrations(&mut self, path: impl Into<PathBuf>) -> &mut Self;
|
||||||
}
|
|
||||||
|
|
||||||
fn with_sqlx_migrations(&mut self, path: impl Into<PathBuf>) -> &mut Self {
|
|
||||||
self
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SqlxExt for RustService {
|
impl SqlxExt for RustService {
|
||||||
fn with_sqlx(&mut self) -> &mut Self {
|
fn with_sqlx(&mut self) -> &mut Self {
|
||||||
self.with_stage(super::RustServiceStage::BeforeBuild(Arc::new(Sqlx::new(
|
self.with_stage(super::RustServiceStage::BeforeBuild(Arc::new(Sqlx::new(
|
||||||
self.client.clone(),
|
self.client.clone(),
|
||||||
))));
|
))))
|
||||||
|
|
||||||
self
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn with_sqlx_migrations(&mut self, path: impl Into<PathBuf>) -> &mut Self {
|
fn with_sqlx_migrations(&mut self, path: impl Into<PathBuf>) -> &mut Self {
|
||||||
self.with_stage(super::RustServiceStage::BeforeBuild(Arc::new(
|
self.with_stage(super::RustServiceStage::BeforeBuild(Arc::new(
|
||||||
Sqlx::new(self.client.clone()).with_migration_path(path),
|
Sqlx::new(self.client.clone()).with_migration_path(path),
|
||||||
)));
|
)))
|
||||||
|
|
||||||
self
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user