Closed prust closed 9 years ago
(I moved .as()
to the Statement class and put _aliasToString()
in the Statement class so they would be together & so you could easily access & override them... I suppose I could leave it on the Select class and you could manually copy the methods from there... or put them in a separate mixin or something... not quite sure what's best)
This should work. It's up to you if you want it on Statement or Insert. I am ok with copying it. A separate mixin sounds like too much hassle to me.
It's up to you ... I am ok with copying it. A separate mixin sounds like too much hassle
Agreed. I'm thinking it would make the most sense to move them back to Select (since it doesn't make sense for Update/Insert/Delete).
You should be able to copy it via something like this:
// copy nested aliasing methods
_.extend(Values.prototype, _.pick(Select.prototype, 'as', '_toNestedString', '_aliasToString'));
Published as v1.0.2
@Suor: This way you should be able to add columns support by overriding
_aliasToString
& you wouldn't need to re-implement the _alias bits, like this: