In lieu of a more ergonomic option within Go's type system (that feels reasonable) to resolve #8, I'm proposing removing TransformBuilder and simply reassigning its associated methods to FilterBuilder. As you'd expect, this lets you do:
c.From("users").Select("*", "", false).Limit(10)
Of course, it also somewhat unfortunately lets you do:
Since the transformer methods aren't usable in the current release, this is probably also a good time to discuss some of ergonomics around the transformer methods. Having four params with type similarities in Order, for example, feels a bit unnatural, so I'd propose having it instead accept a struct of options (or nil to get the defaults).
This also roughly mirrors the interface in postgres-js. I'm unsure whether it'd be useful to also update Limit and Range similarly, given they both also currently accept foreignTable.
A full PR would need tests/docs -- this is just aimed at opening up discussion.
In lieu of a more ergonomic option within Go's type system (that feels reasonable) to resolve #8, I'm proposing removing
TransformBuilder
and simply reassigning its associated methods toFilterBuilder
. As you'd expect, this lets you do:Of course, it also somewhat unfortunately lets you do:
Which obviously looks weird.
Since the transformer methods aren't usable in the current release, this is probably also a good time to discuss some of ergonomics around the transformer methods. Having four params with type similarities in
Order
, for example, feels a bit unnatural, so I'd propose having it instead accept a struct of options (ornil
to get the defaults).This also roughly mirrors the interface in postgres-js. I'm unsure whether it'd be useful to also update
Limit
andRange
similarly, given they both also currently acceptforeignTable
.A full PR would need tests/docs -- this is just aimed at opening up discussion.