Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
c3f9613541
commit
2daa0864e2
@ -31,12 +31,16 @@ impl Sqlx {
|
|||||||
impl DaggerMiddleware for Sqlx {
|
impl DaggerMiddleware for Sqlx {
|
||||||
async fn handle(&self, container: Container) -> eyre::Result<Container> {
|
async fn handle(&self, container: Container) -> eyre::Result<Container> {
|
||||||
let container = if std::path::PathBuf::from(".sqlx/").exists() {
|
let container = if std::path::PathBuf::from(".sqlx/").exists() {
|
||||||
|
tracing::debug!("found .sqlx folder enabling offline mode");
|
||||||
|
|
||||||
let src = self.client.host().directory(".sqlx/");
|
let src = self.client.host().directory(".sqlx/");
|
||||||
|
|
||||||
container
|
container
|
||||||
.with_directory(".sqlx", src)
|
.with_directory(".sqlx", src)
|
||||||
.with_env_variable("SQLX_OFFLINE", "true")
|
.with_env_variable("SQLX_OFFLINE", "true")
|
||||||
} else {
|
} else {
|
||||||
|
tracing::debug!("did not find a .sqlx folder, requires a running database");
|
||||||
|
|
||||||
container
|
container
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user