riverqueue / river

Fast and reliable background jobs in Go
https://riverqueue.com
Mozilla Public License 2.0
3.34k stars 89 forks source link

Accept `postgresql://`-schemed database URLs #532

Closed yawboakye closed 3 weeks ago

yawboakye commented 3 weeks ago

According to the official PostgresQL documentation (referenced 18/08/2024), postgresql:// is an acceptable database URL scheme. In fact that's what I use in my application. So I was surprised when River's migrations were failing. Turns out River only supports postgres://-schemed URLs.

Given that postgresq:// is accepted, and perhaps the preferred, I suggest that River accepts it to. Other changes are: fix grammar typo (unsupported instead of unsupport) and printing the URL the command was called with. I think it's good UX, especially if the user passed an environment variable.

yawboakye commented 3 weeks ago

@brandur i had been waiting for the checks to turn green before requesting for another review, but for reasons i don’t know they’ve stayed amber.

brandur commented 3 weeks ago

had been waiting for the checks to turn green before requesting for another review, but for reasons i don’t know they’ve stayed amber.

Ah yeah, GitHub requires us to approve CI runs from external contributors for security reasons (in case private vars or such leak into the build and could be extracted).

brandur commented 3 weeks ago

Thanks!

arp242 commented 1 week ago

The fact that no one's reported this before seems to suggest the sheer ubiquity of the postgres:// convention.

I ran into this as well a few weeks ago; I just changes postgresql:// to postgres://and called it a day 🙃

In-between doing a ton of other things and "just trying out this River thing to see if it works for us" (it does), I just never got around to reporting it.

I would be surprised if I was the first person. I've often found that getting feedback on these types of small things can be very difficult.

brandur commented 1 week ago

@arp242 Ah, fair enough. We used to have a rule of thumb at my last job that "for every one user that opened a support ticket, 10 users ran into the same problem and didn't". That's probably what happened here.