sqlite - 避免消息 "-​- Loading resources from .sqliterc"

标签 sqlite

小问题,但很烦人:有没有办法避免每次查询时出现以下消息:

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

最佳答案

作为一个愚蠢的解决方法,这个有效:

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

这是因为 current code这样做:

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

由于 this piece of code,强制标准输入重定向会阻止此操作:

stdin_is_interactive = isatty(0);

这也适用:

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

由于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;
}

但它更长,所以有点违背了目的。

关于sqlite - 避免消息 "-​- Loading resources from .sqliterc",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4174897/

相关文章:

android - 如何在没有 android 设备监视器的情况下查看 sqlite 数据库?

c# - .Result()使方法挂起时,如何在构造函数中使用异步方法?

ruby-on-rails - Sqlite3 事件记录 :order => "time DESC" doesn't sort

sql - 在SQL中使用计数器值计算行之间的差异

java - 如果日期不在 Android 的该表中,如何将日期插入用户输入的表中

arrays - 为数组的每个注释属性添加周围的双引号(我认为)

sql - 触发自动将元组添加到关系

java - SQL语句花费大量时间,是否可以对其进行优化?

java - 从代码中查找运行时可用的内部存储器

android - Room Persistence Library 没有 "NOT NULL"和 "UNIQUE"约束