-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/03/2014 11:44 PM, Baruch Burstein wrote:
> Is it possible to somehow search for/replace a string in all
> columns of all tables?

(Disclosure: I am the APSW author)

The APSW shell includes a .find command that does the searching bit.
You also get coloured output which is nice.  It was implemented to
help find things in a database where you are unfamiliar with the
schema and wondering where the heck things are referenced amongst lots
of tables and columns.

http://rogerbinns.github.io/apsw/shell.html

The code that implements it is here:

https://github.com/rogerbinns/apsw/blob/master/tools/shell.py#L1384

It essentially has to loop over all tables, and then uses an OR
statement to check for the value in each column.  From the code you
can see it does additional work based on the value so that it may do
string, integer and LIKE comparisons simultaneously as appropriate.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlSAsisACgkQmOOfHg372QQC+QCgt4YAbvrxt1luvsnhK/r2R/0Q
l4kAoI3PvnQRvmObQqqGMAGJC1cEvehf
=X77t
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to