mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-19 01:24:20 +01:00
close conn after executing limbo in cli
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user