Is there a way to use transactions without pgx?
I have a project with bun sql and I would like to insert a job as part of a transaction, but I can only use pgx.Tx transactions. Also I can use sql.Tx but the driver does not support this
Not currently — I have a branch where this almost works, but it's going to take a little more work still. I think I'll get this sooner than later.
@brandur great to hear that, hope to use that feature soon
We also use bun and would love to see support for bun.Tx and/or sql.Tx. Otherwise it seems impossible to integrate with existing transactions.
Okay, good to know. Going to try and get to this pretty soon.
I think with bun you can use the sql.Tx transactions since bun.Tx is a wrapper for sql.Tx, btw I am using bun as well
Hey guys, could you tell me what underlying driver you're using to power database/sql in general? Do you use lib/pq or is it database/sql + Pgx, or something else like Bun's Postgres driver?
Hey @brandur
Currently, we consider only pgx to be a viable driver. We switch old apps from lib/pq. And bun native driver has some problems that we don't have using pgx.
Excellent, that's helpful. Thanks Igor.
Chiming in here! We are currently using database/sql with github.com/jackc/pgx/v5/stdlib as the actual driver.
Opened #351. We'll need some additional docs, but it make use of River with Bun possible.
We use lib/pq with sqlc and would love to see River working with it. Happy to do some legwork
Actually, ignore this request. Sounds like after some research it's better that we just migrate over to pgx anyways.
This one's pretty close in that there's a working driver in #351, but yes, you should definitely switch to pgx anyway.
If anybody out there is interested in giving this a try, database/sql functionality was merged in #351. We still haven't cut an official release with it (should come in v0.10.0) nor have we finished documentation on it, but the actual support has been merged.
This was officially shipped last week: https://riverqueue.com/blog/database-sql
Please let us know if you run into any issues with it!
Hey @bgentry
I found that docs about drivers are now outdated, without database/sql not mentioned. https://riverqueue.com/docs/database-drivers