Is there a pure sqlite request to find a string in a database ?
With a bit of shell, I can extract the schemas from the tables:
for i in *sqlite;
do sqlite3 $i ".tables"
| grep -Eoh "[^ ]+"
| while read t; do
echo -n "$i:$t ";
sqlite3 $i '.schema "'"$t"'"';
done;
echo;
done
Then I could find which column has the type TEXT, and make a request.
But is there a pure SQL way to do this in a terminal ?
TLDR; To dump a sqlite db to a file called
dump.sqlSQLite is designed as an embedded database and therefore does have only extremely basic programming capabilities (it has triggers, but no control logic like
ifor loops).So it is not possible to do anything dynamic in SQL – the result of
PRAGMA table_infocannot be directly used in SQL queries.A very quick and dirty way to search everywhere in a database is to show all contents with
.dumpand then justgrepthat. However, this isn’t actually quick because searching indexed columns would be faster in SQL.