Implement sql monad