Open ktogo opened 7 months ago
Or another approach:
package goqu
// RequireDialect returns an error if specified dialect is unavailable.
func RequireDialect(dialect string) (error)
Usage:
if err := goqu.RequireDialect("postgres"); err != nil {
panic(err)
}
goqu.Dialect("postgres").Select("*") //...
Is your feature request related to a problem? Please describe.
Goqu generates queries with unintended default dialect when forget to import the dialect in every files.
This situation especially occurs when running single unit test.
Describe the solution you'd like
Provide following functions which requires specific dialect to be imported.
Describe alternatives you've considered
The following code achieves it (by non-straightforward way though), but I would like to suggest this to be a part of goqu official functions.
Dialect
Additional context Add any other context or screenshots about the feature request here.