Open iintothewind opened 7 years ago
This is slightly complicated. SQL builder is a simple query builder. It does not build up any type of state tree that can remember where subselects start and end. If from and join methods where to allow subselects directly we would have to build up a pointer to the From/Join that the select came from. This would be a larger rewrite of the SQL builder I think.
Would it be possible to add overloads for the FROM(), WHERE() and various JOIN() methods that accept an SQL object parameter, and an optional alias? Then the parent SQL could append (SELECT ...) AS alias
on output, without creating intermediate strings for each sub-query.
Feature request
The initial sql statement is like:
By using SQL builder, it could be:
It could be better if we can add SELECT directly to FROM and ...JOIN methods instead of doing "("+ stuff.