Working sqlite insertion and update