feat: open psql in the database container

This commit is contained in:
2026-09-08 14:16:18 +00:00
parent 61f35f5ae4
commit 6389f3f1f5
6 changed files with 65 additions and 12 deletions

View File

@@ -4,6 +4,7 @@ use super::{Argv, Cmd};
pub struct Exec {
container: String,
interactive: bool,
tty: bool,
inner: Argv,
}
@@ -12,10 +13,17 @@ impl Exec {
Self {
container: container.to_string(),
interactive: false,
tty: false,
inner,
}
}
// a terminal, for a command that is a shell rather than a pipe stage
pub fn tty(mut self, tty: bool) -> Self {
self.tty = tty;
self
}
// keep stdin open, for a command that is fed a dump
pub fn interactive(mut self) -> Self {
self.interactive = true;
@@ -31,6 +39,10 @@ impl Cmd for Exec {
argv = argv.arg("--interactive");
}
if self.tty {
argv = argv.arg("--tty");
}
argv.arg(&self.container).args(self.inner.words())
}
}