sql calls for purge, commented todo code for client-store