@@ -443,7 +443,7 @@ pub struct RunnerInner<'a> {
443443 auto_index_selects : bool ,
444444 auto_transactions : bool ,
445445 enable_table_keys : bool ,
446- verbosity : u8 ,
446+ verbose : bool ,
447447 stdout : & ' a dyn WriteFmt ,
448448 _shutdown_trigger : trigger:: Trigger ,
449449 _server_thread : JoinOnDropHandle < ( ) > ,
@@ -1307,7 +1307,7 @@ impl<'a> RunnerInner<'a> {
13071307 auto_index_selects : config. auto_index_selects ,
13081308 auto_transactions : config. auto_transactions ,
13091309 enable_table_keys : config. enable_table_keys ,
1310- verbosity : config. verbosity ,
1310+ verbose : config. verbose ,
13111311 stdout : config. stdout ,
13121312 } ;
13131313 inner. ensure_fixed_features ( ) . await ?;
@@ -1696,7 +1696,7 @@ impl<'a> RunnerInner<'a> {
16961696 output : & ' r Result < QueryOutput < ' _ > , & ' r str > ,
16971697 location : Location ,
16981698 ) -> Result < Option < Outcome < ' r > > , anyhow:: Error > {
1699- print_sql_if ( self . stdout , sql, self . verbosity >= 2 ) ;
1699+ print_sql_if ( self . stdout , sql, self . verbose ) ;
17001700 let sql_result = self . client . execute ( sql, & [ ] ) . await ;
17011701
17021702 // Evaluate if we already reached an outcome or not.
@@ -1763,14 +1763,14 @@ impl<'a> RunnerInner<'a> {
17631763 if let Some ( outcome) = tentative_outcome {
17641764 view_outcome = outcome;
17651765 } else {
1766- print_sql_if ( self . stdout , view_sql. as_str ( ) , self . verbosity >= 2 ) ;
1766+ print_sql_if ( self . stdout , view_sql. as_str ( ) , self . verbose ) ;
17671767 view_outcome = self
17681768 . execute_query ( view_sql. as_str ( ) , output, location. clone ( ) )
17691769 . await ?;
17701770 }
17711771
17721772 // Remember to clean up after ourselves by dropping the view.
1773- print_sql_if ( self . stdout , drop_view. as_str ( ) , self . verbosity >= 2 ) ;
1773+ print_sql_if ( self . stdout , drop_view. as_str ( ) , self . verbose ) ;
17741774 self . client . execute ( drop_view. as_str ( ) , & [ ] ) . await ?;
17751775
17761776 Ok ( view_outcome)
@@ -1986,7 +1986,8 @@ pub trait WriteFmt {
19861986pub struct RunConfig < ' a > {
19871987 pub stdout : & ' a dyn WriteFmt ,
19881988 pub stderr : & ' a dyn WriteFmt ,
1989- pub verbosity : u8 ,
1989+ pub verbose : bool ,
1990+ pub quiet : bool ,
19901991 pub postgres_url : String ,
19911992 pub prefix : String ,
19921993 pub no_fail : bool ,
@@ -2120,10 +2121,10 @@ pub async fn run_string(
21202121 writeln ! ( runner. config. stdout, "--- {}" , source) ;
21212122
21222123 for record in parser. parse_records ( ) ? {
2123- // In maximal-verbosity mode, print the query before attempting to run
2124+ // In maximal-verbose mode, print the query before attempting to run
21242125 // it. Running the query might panic, so it is important to print out
21252126 // what query we are trying to run *before* we panic.
2126- if runner. config . verbosity >= 2 {
2127+ if runner. config . verbose {
21272128 print_record ( runner. config , & record) ;
21282129 }
21292130
@@ -2134,9 +2135,9 @@ pub async fn run_string(
21342135 . unwrap ( ) ;
21352136
21362137 // Print warnings and failures in verbose mode.
2137- if runner. config . verbosity >= 1 && !outcome. success ( ) {
2138- if runner. config . verbosity < 2 {
2139- // If `verbosity >= 2` , we'll already have printed the record,
2138+ if ! runner. config . quiet && !outcome. success ( ) {
2139+ if ! runner. config . verbose {
2140+ // If `verbose` is enabled , we'll already have printed the record,
21402141 // so don't print it again. Yes, this is an ugly bit of logic.
21412142 // Please don't try to consolidate it with the `print_record`
21422143 // call above, as it's important to have a mode in which records
@@ -2151,7 +2152,7 @@ pub async fn run_string(
21512152 }
21522153 print_record ( runner. config , & record) ;
21532154 }
2154- if runner. config . verbosity >= 2 || outcome. failure ( ) {
2155+ if runner. config . verbose || outcome. failure ( ) {
21552156 writeln ! (
21562157 runner. config. stdout,
21572158 "{}" ,
0 commit comments