idea_gallery sqlbuilder implementation