move functions back into query-generator from sql-generator