Separate formatting for subquery
It would be very nice to have options for separate formatting for subquery, for example:
SELECT
OrderID,
OrderName,
OrderDate
FROM Orders
WHERE ClientID = (SELECT ClientID FROM Clients WHERE ClientCode = 'ABC')
Here, I need the main SELECT to be stacked and formatted appropriately, and subquery SELECT - to be wrapped and in one line).
In large and complex SQL script this feature is invaluable.
Currently it is not possible - one format is applied for everything.
Thanks.
-
Sam commented
I don't think the solution implemented currently is that helpful. It has no way to disambiguate between complicated subqueries and simple subqueries as in the original example above. There needs to be an option to prefer the subquery on a single line, if it fits within the line limits, otherwise apply the same formatting as a normal query.
-
Jack commented
It would be nice to have a configuration option for this, where if the length of the subquery is less than X characters, is formatted as compact instead of expanded.