Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streamline the database interfaces and add pgx adapter #29

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

julesjcraske
Copy link

@julesjcraske julesjcraske commented Feb 8, 2024

I am opening this draft PR to see if you are interested in this direction for the library (trimming down the interfaces to only what is used). If so I can put the effort in to get it up to your required standards and resolve the final issues. If not I can close it and keep my fork.

Thanks for all the great work you have done on the lib so far!

I want to use watermill to fulfil the outbox pattern (persisting events that will be asynchronously broadcast as part of the main persistence transaction) but my company mainly uses the pgx library.

This change makes this library more flexible to allow for the use of the pgx library. I can keep the pgx adapter itself elsewhere, outside of this repo if you would like.

  • Strips out all of the unused methods declared in the database Beginner and Executor (totally unused) and ContextExecutor interfaces.
  • Adds interfaces for the Exec Result type and the Query Rows type.
  • Adds small plumbing adapters for the StdSQL and Pgx types

Still to do:

  • Make it so that it is backwards compatible initialising a Publisher or Subscriber with a raw StdSQL connection or transaction.
  • Add to documentation.
  • Add tests against a pgx adapter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant