yesodweb / persistent

Persistence interface for Haskell allowing multiple storage methods.
MIT License
467 stars 297 forks source link

Update mongoDB backend mongoDB driver interface #1545

Closed darycabrera closed 2 months ago

darycabrera commented 2 months ago

The mongoDB driver library introduced breaking changes to the current API calls used in persistent when interfacing with a mongoDB Server version 6.0 and above. Two of those changes, namely the change in behavior of the delete and update functions, seem irrational to me, but regardless they're already officially incorporated.

This PR makes the necessary changes to restore expected functionality whilst remaining backwards compatible with previous mongoDB versions, namely MongoDB 5.0, the EOL for which comes up this October. As alluded to, these changes were prompted for the mongoDB upgrade effort at work.

The mongo driver package itself needs a little more work to conform the server spec changes brought along with the Mongo Wire version 17, however, that is independent of these changes.

parsonsmatt commented 2 months ago

Hm, incompatible with GHC 8.4.4 because of mongoDB's version constraints - would require dropping support for GHC 8.4 and 8.6. That's unfortunate. GHC 8.4 is ~8 years old now, and 8.6 is 6 years old. I think I'm OK dropping those versions from our CI.

We can do a follow-up PR to tighten our own base bounds and see what things we can adopt with 8.8 as our oldest compiler target.

parsonsmatt commented 2 months ago

OK, changes look good to me! Please add a changelog entry and a version bump for persistent-mongoDB and we'll get it released.