From 23d11325263488adb74f8cfd890e169d3cc1c420 Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Thu, 15 Sep 2022 00:39:01 +0100 Subject: [PATCH] Ignore blank/empty lines in SurrealDB SQL REPL Closes #147 --- src/cli/sql.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cli/sql.rs b/src/cli/sql.rs index 30af8e82..205d7d38 100644 --- a/src/cli/sql.rs +++ b/src/cli/sql.rs @@ -32,6 +32,10 @@ pub fn init(matches: &clap::ArgMatches) -> Result<(), Error> { match readline { // The user typed a query Ok(line) => { + // Ignore all empty lines + if line.is_empty() { + continue; + } // Add the entry to the history rl.add_history_entry(line.as_str()); // Make a new remote request