Add TH functions to generate SQLs.