general torch codes for databse