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
It probes the database to work out which driver to use (MySQL, PostgreSQL, etc). It does this by making SQL queries that only work on specific databases. This means some queries fail under normal operation which has caused confusion in the past.
I am suggesting that the choice of driver should be explicit. There are several ways we could approach this:
Replace New() with database-specific alternatives
Always pass a driver to New()
Add a Driver() method to the sqlprojection.MessageHandler interface
1 and 2 are much the same from a usability standpoint. Of these two I'd prefer 2, as it allows the user to supply a third-party driver implementation.
3 has the benefit of keeping the driver selection alongside the handler implementation. IMO this option makes the most sense because this where the application's database-specific code is.
The text was updated successfully, but these errors were encountered:
I'm referring to this logic.
It probes the database to work out which driver to use (MySQL, PostgreSQL, etc). It does this by making SQL queries that only work on specific databases. This means some queries fail under normal operation which has caused confusion in the past.
I am suggesting that the choice of driver should be explicit. There are several ways we could approach this:
New()
with database-specific alternativesNew()
Driver()
method to thesqlprojection.MessageHandler
interface1 and 2 are much the same from a usability standpoint. Of these two I'd prefer 2, as it allows the user to supply a third-party driver implementation.
3 has the benefit of keeping the driver selection alongside the handler implementation. IMO this option makes the most sense because this where the application's database-specific code is.
The text was updated successfully, but these errors were encountered: