Skip to content

How to use Postgres MERGE Command with Diesel? #4323

Answered by weiznich
marvin-hansen asked this question in Q&A
Discussion options

You must be logged in to vote

For tests with a pool you want to do two things:

  • Set the pool size to 1
  • Add a connection customizer that calls Connection::begin_test_transaction on checkout.

The diesel master branch provides an test customizer implementation for this: https://docs.diesel.rs/master/diesel/r2d2/struct.TestCustomizer.html
That's not released yet, but you likely can just copy the implementation and look onto the implementation to understand how it works

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@weiznich
Comment options

Answer selected by marvin-hansen
@marvin-hansen
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants