clustering with sqlite generator function