Skip to main content

Collapse Short Statements

When shortStatementsOneLine is enabled with maxLineWidth, short queries that fit on one line are collapsed. Only applies to top-level statements (subqueries are unaffected since they format via the normal config during render).

Short query fits — collapsed

select a from t where x > 1
select a from t where x > 1

Long query doesn't fit — normal formatting

select customer_id, order_date, total_amount, status, region from orders where status = 'active' and region = 'US'
select customer_id, order_date, total_amount, status, region
from orders
where status = 'active' and region = 'US'

Disabled by default

select a from t where x > 1
select a from t where x > 1

Requires maxLineWidth to be set

Without maxLineWidth, shortStatementsOneLine has no effect (no width threshold to compare against).

select a from t where x > 1
select a from t where x > 1