mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-07-08 04:55:00 +00:00
close conn after executing limbo in cli
This commit is contained in:
parent
f2bf6251cd
commit
ab4eda59be
1 changed files with 4 additions and 3 deletions
|
@ -176,9 +176,9 @@ impl Limbo {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
fn first_run(&mut self, sql: Option<String>, quiet: bool) -> io::Result<()> {
|
fn first_run(&mut self, sql: Option<String>, quiet: bool) -> Result<(), LimboError> {
|
||||||
if let Some(sql) = sql {
|
if let Some(sql) = sql {
|
||||||
self.handle_first_input(&sql);
|
self.handle_first_input(&sql)?;
|
||||||
}
|
}
|
||||||
if !quiet {
|
if !quiet {
|
||||||
self.write_fmt(format_args!("Limbo v{}", env!("CARGO_PKG_VERSION")))?;
|
self.write_fmt(format_args!("Limbo v{}", env!("CARGO_PKG_VERSION")))?;
|
||||||
|
@ -188,12 +188,13 @@ impl Limbo {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn handle_first_input(&mut self, cmd: &str) {
|
fn handle_first_input(&mut self, cmd: &str) -> Result<(), LimboError> {
|
||||||
if cmd.trim().starts_with('.') {
|
if cmd.trim().starts_with('.') {
|
||||||
self.handle_dot_command(&cmd[1..]);
|
self.handle_dot_command(&cmd[1..]);
|
||||||
} else {
|
} else {
|
||||||
self.run_query(cmd);
|
self.run_query(cmd);
|
||||||
}
|
}
|
||||||
|
self.close_conn()?;
|
||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue