Convert string to int automatically when query and update