I saw this snippet in discussion. The code was given by janis.bielajs
I am posting it here as the original discussion is now rejected, probably because of being too basic.
This snippet uses a fancy combination of functional method call and singleton pattern to build range for DELETE..WHERE field IN <range> statement.
/.