You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a small go coding test for potential new employees at my company. From what I can tell a lot of our candidates dont understand how RunInTransaction works. The "tricky" part is that you have to actually use the inner pg.Tx to make use of the transaction which many of them doesnt seem to get. Now since this is a coding test it doesnt have any critical effect except it makes it easy for us to filter them out, but I suspect that a lot of normal users of go-pg will make the same mistake.
Maybe you can add an example / clarify the documentation of this function? I think that can save a lot of tricky debugging for unexperienced users of this library.
The text was updated successfully, but these errors were encountered:
We have a small go coding test for potential new employees at my company. From what I can tell a lot of our candidates dont understand how RunInTransaction works. The "tricky" part is that you have to actually use the inner
pg.Tx
to make use of the transaction which many of them doesnt seem to get. Now since this is a coding test it doesnt have any critical effect except it makes it easy for us to filter them out, but I suspect that a lot of normal users of go-pg will make the same mistake.What Ive seen people do is this:
Instead you should of course do it this way if you want the insert to be rollbacked:
Maybe you can add an example / clarify the documentation of this function? I think that can save a lot of tricky debugging for unexperienced users of this library.
The text was updated successfully, but these errors were encountered: