There seem to be two kinds of parsers in the sqlite shell, one that interprets escape sequences only inside double quotes and only for dot-commands ("\n"
, e.g. for .separator
), and one that doesn't, for everything else:
sq3> CREATE TABLE bhist (cmd varchar not null);
sq3> .mode csv
sq3> SELECT length('\n');
"length('\n')"
2
sq3> SELECT length("\n");
"length(""\n"")"
2
sq3>
sq3> .separator '\t'
sq3> .import .bash_history bhist
Error: multi-character column separators not allowed for import
sq3> .separator "\t" "\n"
sq3> .import .bash_history bhist
sq3> SELECT count(*) from bhist;
count(*)
3404
sq3>
Note how only the last .separator (double-quoted escape sequences in dot-command) seems to work. I can find no documentation on this. What gives?