Move custom SQL to cyder app