Rocket
Rocket copied to clipboard
Modify todo example to use postgres and diesel_async
As requested. Notable: diesel_migrations does not work with diesel_async, so I establish a separate connection in the migration function.
I don't know if there is a postgres database present during CI, so I called it "epic_todo_database" to emphasise that that section is free form
What's the status of this? We were looking into having a postgres DB available when the CI runs to merge this. @ELD Were you working on that?
It would be nice if this example could run without a postgres DB as well, however. Perhaps we can have a dynamic switch for the database based on a profile and implement it for both backends in the same example?
@SergioBenitez I was working on getting the CI piece done. I got it running on macOS CI, but not Windows or Linux (these are being particularly tricky). It's also difficult to make this resilient to GHA rolling out a new machine images as the current ones have Postgres pre-installed, but future ones may not (and that complicates the configuration).
I haven't had time to revisit it since this time of year tends to be pretty busy. I'm hoping to get back to it after the Christmas holiday and finish this off.
I like the idea of a profile flag for whether we use something like SQLite in sync mode or Postgres in diesel-async
. Not sure what that implementation would look like, though.
Definitely think we can push this over the line by the early part of the new year.
Alright, I have Postgres working on Linux and macOS now. Just down to Windows: https://github.com/ELD/Rocket/actions/runs/7353097692
Finished off the CI work for Windows and Linux along with some vcpkg
changes to pull in the latest versions of libpq
for tests (and caching via actions/cache
). We can vendor the vcpkg
packages, but the actions/cache
solution seemingly works well. It'll take longer, though, when certain build deps increase their version.
We just need @ThouCheese (no rush on this, just tagging for the sake of visibility) to merge the upstream PR to then get a final review in this PR :)