From f711d2b7ed6e73bc88d6dc1808ea66b44d70bb13 Mon Sep 17 00:00:00 2001 From: Pekka Enberg Date: Thu, 16 Jan 2025 14:08:37 +0200 Subject: [PATCH] cli: Improve `.schema` command output on errors Improve `.schema` output on errors by marking them as comments. This allows you to pipe any `.schema` output to another shell. --- cli/app.rs | 4 ++-- testing/shelltests.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/app.rs b/cli/app.rs index 03ee75ffa..082249d8f 100644 --- a/cli/app.rs +++ b/cli/app.rs @@ -724,9 +724,9 @@ impl Limbo { if !found { if let Some(table_name) = table { let _ = self - .write_fmt(format_args!("Error: Table '{}' not found.", table_name)); + .write_fmt(format_args!("-- Error: Table '{}' not found.", table_name)); } else { - let _ = self.writeln("No tables or indexes found in the database."); + let _ = self.writeln("-- No tables or indexes found in the database."); } } } diff --git a/testing/shelltests.py b/testing/shelltests.py index 0f9fc0b23..bfe0b50f7 100755 --- a/testing/shelltests.py +++ b/testing/shelltests.py @@ -227,7 +227,7 @@ do_execshell_test( pipe, "test-can-switch-back-to-in-memory", ".schema users", - "Error: Table 'users' not found.", + "-- Error: Table 'users' not found.", ) do_execshell_test(pipe, "test-verify-null-value", "select NULL;", "LIMBO")