ship-hold icon indicating copy to clipboard operation
ship-hold copied to clipboard

[Feature request] create a function on select builders to output with an alias

Open lorenzofox3 opened this issue 5 years ago • 2 comments

Feature request:

Select builders are often used in sub query with aliases. It would be a nice syntax addition if instead of using an object we could output the builder with a alias directly thanks to an as method

//currently 
sh.select().from({
  as:'foo',
  value:sh.select().from('users').where('age','>',42).noop()
});

could be written:

sh.select().from(sh.select().from('users').where('age','>',42).as('foo'));

lorenzofox3 avatar Dec 11 '18 22:12 lorenzofox3

I would love to see this feature implemented.

ansarizafar avatar Sep 02 '19 12:09 ansarizafar

That's a good one to start, I can help you to make a pull request if you want

lorenzofox3 avatar Sep 04 '19 15:09 lorenzofox3