Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Avoid message "-​- Loading resources from .sqliterc"

Tags:

sqlite

Minor problem, nevertheless irritating : Is there a way to avoid the following message from appearing each time I make a query :

-- Loading resources from /Users/ThG/.sqliterc

like image 869
ThG Avatar asked Nov 13 '10 21:11

ThG


1 Answers

As a stupid workaround, this works:

<. sqlite your_sqlite.db 'select * from your_table'

This is because the current code does this:

 if( stdin_is_interactive ){
   utf8_printf(stderr,"-- Loading resources from %s\n",sqliterc);
 }

Forcing a stdin redirect thwarts this due to this piece of code:

stdin_is_interactive = isatty(0);

This works as well:

sqlite -batch your_sqlite.db 'select * from your_table'

due to this piece of code:

}else if( strcmp(z,"-batch")==0 ){
  /* Need to check for batch mode here to so we can avoid printing
  ** informational messages (like from process_sqliterc) before
  ** we do the actual processing of arguments later in a second pass.
  */
  stdin_is_interactive = 0;
}

but it's longer, so kind of defeats the purpose.

like image 93
levant pied Avatar answered Sep 19 '22 07:09

levant pied