Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
2a988c33a4
commit
a0acb54896
@ -3,6 +3,8 @@ use dagger_sdk::Container;
|
||||
|
||||
use crate::dagger_middleware::DaggerMiddleware;
|
||||
|
||||
use super::RustService;
|
||||
|
||||
pub struct Sqlx {}
|
||||
#[async_trait]
|
||||
impl DaggerMiddleware for Sqlx {
|
||||
@ -10,3 +12,17 @@ impl DaggerMiddleware for Sqlx {
|
||||
Ok(container.with_env_variable("SQLX_OFFLINE", "true"))
|
||||
}
|
||||
}
|
||||
|
||||
pub trait SqlxExt {
|
||||
fn with_sqlx(&mut self) -> &mut Self {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl SqlxExt for RustService {
|
||||
fn with_sqlx(&mut self) -> &mut Self {
|
||||
self.with_stage(super::RustServiceStage::BeforeBuild(Box::new(Sqlx {})));
|
||||
|
||||
self
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user