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
|
||||
}
|
||||
|
||||
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 {
|
||||
self.handle_first_input(&sql);
|
||||
self.handle_first_input(&sql)?;
|
||||
}
|
||||
if !quiet {
|
||||
self.write_fmt(format_args!("Limbo v{}", env!("CARGO_PKG_VERSION")))?;
|
||||
|
@ -188,12 +188,13 @@ impl Limbo {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn handle_first_input(&mut self, cmd: &str) {
|
||||
fn handle_first_input(&mut self, cmd: &str) -> Result<(), LimboError> {
|
||||
if cmd.trim().starts_with('.') {
|
||||
self.handle_dot_command(&cmd[1..]);
|
||||
} else {
|
||||
self.run_query(cmd);
|
||||
}
|
||||
self.close_conn()?;
|
||||
std::process::exit(0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue