elixir-ecto / db_connection

Database connection behaviour
http://hexdocs.pm/db_connection/DBConnection.html
306 stars 113 forks source link

Add example implementation for a connection_listener #266

Closed pdgonzalez872 closed 2 years ago

pdgonzalez872 commented 2 years ago

Hi!

As usual, thank you for the work in this repo! I noticed we didn't have a small example implementation for a connection_listener. After playing around with some code, I arrived at the the one below think it may serve as a nice starting point for folks wanting to implement their own connection_listeners.

The simplest way I found to test/prove it worked was to add it to a test, I do it here

Hope this helps!

pdgonzalez872 commented 2 years ago

@v0idpwn sorry for taking so long. Pretty crazy couple of weeks. Thanks for the comments, they were good ones. I'm interested in the discussion here, I think that will make this an awesome example. Thanks again!

josevalim commented 2 years ago

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart: