79504477

Date: 2025-03-12 17:56:12
Score: 1
Natty:
Report link

After posting in the SQLite forum, I've got my answers:

"Why is this?" - apparently no real reason, it's "unspecified and untested behavior". It should be fixed in the next release of SQLite, but is not considered a bug and may be reverted later on.

As for a workaround - short of using an updated version of SQLite (as yet unreleased unless building from source), instead of specifying the command as an argument, use echo and pipe it to sqlite:

$ echo '.tables' | sqlite3 -echo database.db 
.tables
stuff

To specify multiple commands, use printf '%s\n' instead of echo:

$ printf '%s\n' '.tables' 'SELECT * FROM stuff;' | sqlite3 -echo database.db 
.tables
stuff
SELECT * FROM stuff;
apples|67
tissues|10
Reasons:
  • RegEx Blacklisted phrase (0.5): Why is this
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: NeatNit