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
Currently the builder types like *Query and *Update are mutable. This works similar to the standard library text/template package where they return themselves for convenience.
Some other packages (like goqu for example) use immutable types instead. The advantage of this method is that you can create base queries and easily extend them.
The disadvantage of switching is it would break any v1 code that relies on the mutability.
Alternatively we could ditch the builder pattern. Functional parameters are the current best practice but we have a lot of disparate parameters so it would probably be annoying to work with 🤔
The text was updated successfully, but these errors were encountered:
This is a question for v2.
Currently the builder types like
*Query
and*Update
are mutable. This works similar to the standard library text/template package where they return themselves for convenience.Some other packages (like goqu for example) use immutable types instead. The advantage of this method is that you can create base queries and easily extend them.
The disadvantage of switching is it would break any v1 code that relies on the mutability.
Alternatively we could ditch the builder pattern. Functional parameters are the current best practice but we have a lot of disparate parameters so it would probably be annoying to work with 🤔
The text was updated successfully, but these errors were encountered: