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

Changes to support looking up a Dialect by name. #682

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

Conversation

wynan
Copy link
Contributor

@wynan wynan commented Aug 5, 2024

Looking to be able to set a dialect using spring properties and looking for a way to select a dialect by name. See the Spring changes for an example of how this would be used.

As usual let me know if this doesn't make sense, you would prefer a different approach or if there is anything else you would like me to address.

@badgerwithagun
Copy link
Member

Thanks @wynan!

It's not completely obvious when you read the code, but there is a slow effort to decouple Dialect (which was originally an enum!) from its implementations. The end goal is that the individual DB implementations could be moved to separate modules.

The static references to the individual implementations in this interface purely exist for backwards compatibility, and will likely be removed at some point. Theoretically, also, someone out there may have some custom Dialect implementation for a different database which they've not shared with the project and won't be listed here.

All this means I instinctively dislike this approach. What I would prefer to see is:

  • The implementations extracted into their own classes (e.g. OracleDialect, H2Dialect...)
  • Spring configuration using a class FQN, e.g. com.gruelbox.transactionoutbox.OracleDialect.

Copy link
Member

@badgerwithagun badgerwithagun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change requested

@wynan
Copy link
Contributor Author

wynan commented Oct 11, 2024

Let me know if this refactoring is way off base. I’m not a fan of how the migrations are handled at this point but this allows them to operate in a similar manner and this allows me to achieve my objective and I think moves things in the right direction. Seems like we would have to pull more SQL statements out of the service methods and into the BaseDialect so they could be overwritten as needed.

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

Successfully merging this pull request may close these issues.

2 participants