Repository: sql-formatter-org/sql-formatter
Pull request #490 (2022-10-04 12:00:36)

Format ALTER TABLE and some other statements using oneline style
`ALTER TABLE`, `DROP TABLE`, `DELETE FROM` and `UPDATE` are now formatted as follows:

```sql
ALTER TABLE foo
ALTER COLUMN col1
SET DEFAULT 10;

DROP TABLE my_tbl;

DELETE FROM customers
WHERE
  age > 99;

UPDATE orders
SET
  price = 0,
  total = 0
WHERE
  deleted = TRUE;
```


Patch:
diff --git a/src/languages/bigquery/bigquery.formatter.ts b/src/languages/bigquery/bigquery.formatter.ts
index 9b210d02..9c7b13e4 100644
--- a/src/languages/bigquery/bigquery.formatter.ts
+++ b/src/languages/bigquery/bigquery.formatter.ts
@@ -27,10 +27,7 @@ const reservedClauses = expandPhrases([
   'INSERT [INTO]',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  // - delete:
-  'DELETE [FROM]',
   // - merge:
   'MERGE [INTO]',
   'WHEN [NOT] MATCHED [BY SOURCE | BY TARGET] [THEN]',
@@ -38,6 +35,20 @@ const reservedClauses = expandPhrases([
   // Data definition, https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language
   'CREATE [OR REPLACE] [MATERIALIZED] VIEW [IF NOT EXISTS]',
   'CREATE [OR REPLACE] [TEMP|TEMPORARY|SNAPSHOT|EXTERNAL] TABLE [IF NOT EXISTS]',
+
+  'CLUSTER BY',
+  'FOR SYSTEM_TIME AS OF', // CREATE SNAPSHOT TABLE
+  'WITH CONNECTION',
+  'WITH PARTITION COLUMNS',
+  'REMOTE WITH CONNECTION',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  // - delete:
+  'DELETE [FROM]',
+  // - drop table:
   'DROP [SNAPSHOT | EXTERNAL] TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE [IF EXISTS]',
@@ -49,19 +60,12 @@ const reservedClauses = expandPhrases([
   'SET OPTIONS', // for alter column
   'DROP NOT NULL', // for alter column
   'SET DATA TYPE', // for alter column
-
-  'CLUSTER BY',
-  'FOR SYSTEM_TIME AS OF', // CREATE SNAPSHOT TABLE
-  'WITH CONNECTION',
-  'WITH PARTITION COLUMNS',
-  'REMOTE WITH CONNECTION',
+  // - alter schema
   'ALTER SCHEMA [IF EXISTS]',
-
+  // - alter view
   'ALTER [MATERIALIZED] VIEW [IF EXISTS]',
+  // - alter bi_capacity
   'ALTER BI_CAPACITY',
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE TABLE',
   // - create schema
diff --git a/src/languages/db2/db2.formatter.ts b/src/languages/db2/db2.formatter.ts
index b42dfb89..7fdef5c6 100644
--- a/src/languages/db2/db2.formatter.ts
+++ b/src/languages/db2/db2.formatter.ts
@@ -22,12 +22,7 @@ const reservedClauses = expandPhrases([
   'INSERT INTO',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  'WHERE CURRENT OF',
-  'WITH {RR | RS | CS | UR}',
-  // - delete:
-  'DELETE FROM',
   // - merge:
   'MERGE INTO',
   'WHEN [NOT] MATCHED [THEN]',
@@ -36,6 +31,16 @@ const reservedClauses = expandPhrases([
   // Data definition
   'CREATE [OR REPLACE] VIEW',
   'CREATE [GLOBAL TEMPORARY] TABLE',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  'WHERE CURRENT OF',
+  'WITH {RR | RS | CS | UR}',
+  // - delete:
+  'DELETE FROM',
+  // - drop table:
   'DROP TABLE [HIERARCHY]',
   // alter table:
   'ALTER TABLE',
@@ -46,9 +51,6 @@ const reservedClauses = expandPhrases([
   'SET DATA TYPE', // for alter column
   'SET NOT NULL', // for alter column
   'DROP {IDENTITY | EXPRESSION | DEFAULT | NOT NULL}', // for alter column
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE [TABLE]',
   // other
diff --git a/src/languages/hive/hive.formatter.ts b/src/languages/hive/hive.formatter.ts
index bf42e29c..997c829a 100644
--- a/src/languages/hive/hive.formatter.ts
+++ b/src/languages/hive/hive.formatter.ts
@@ -28,10 +28,7 @@ const reservedClauses = expandPhrases([
   'INSERT INTO [TABLE]',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  // - delete:
-  'DELETE FROM',
   // - merge:
   'MERGE INTO',
   'WHEN [NOT] MATCHED [THEN]',
@@ -47,13 +44,18 @@ const reservedClauses = expandPhrases([
   // Data definition
   'CREATE [MATERIALIZED] VIEW [IF NOT EXISTS]',
   'CREATE [TEMPORARY] [EXTERNAL] TABLE [IF NOT EXISTS]',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  // - delete:
+  'DELETE FROM',
+  // - drop table:
   'DROP TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE',
   'RENAME TO',
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE [TABLE]',
   // other
diff --git a/src/languages/mariadb/mariadb.formatter.ts b/src/languages/mariadb/mariadb.formatter.ts
index bd26f5e5..89ceac0d 100644
--- a/src/languages/mariadb/mariadb.formatter.ts
+++ b/src/languages/mariadb/mariadb.formatter.ts
@@ -26,13 +26,20 @@ const reservedClauses = expandPhrases([
   'REPLACE [LOW_PRIORITY | DELAYED] [INTO]',
   'VALUES',
   // - update:
-  'UPDATE [LOW_PRIORITY] [IGNORE]',
   'SET',
-  // - delete:
-  'DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM',
   // Data definition
   'CREATE [OR REPLACE] [SQL SECURITY DEFINER | SQL SECURITY INVOKER] VIEW [IF NOT EXISTS]',
   'CREATE [OR REPLACE] [TEMPORARY] TABLE [IF NOT EXISTS]',
+  // other
+  'RETURNING',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE [LOW_PRIORITY] [IGNORE]',
+  // - delete:
+  'DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM',
+  // - drop table:
   'DROP [TEMPORARY] TABLE [IF EXISTS]',
   // - alter table:
   'ALTER [ONLINE] [IGNORE] TABLE [IF EXISTS]',
@@ -44,11 +51,6 @@ const reservedClauses = expandPhrases([
   'ALTER [COLUMN]',
   '{SET | DROP} DEFAULT', // for alter column
   'SET {VISIBLE | INVISIBLE}', // for alter column
-  // other
-  'RETURNING',
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE [TABLE]',
   // https://mariadb.com/docs/reference/mdb/sql-statements/
diff --git a/src/languages/mysql/mysql.formatter.ts b/src/languages/mysql/mysql.formatter.ts
index fab1aec9..a21e102c 100644
--- a/src/languages/mysql/mysql.formatter.ts
+++ b/src/languages/mysql/mysql.formatter.ts
@@ -26,13 +26,18 @@ const reservedClauses = expandPhrases([
   'REPLACE [LOW_PRIORITY | DELAYED] [INTO]',
   'VALUES',
   // - update:
-  'UPDATE [LOW_PRIORITY] [IGNORE]',
   'SET',
-  // - delete:
-  'DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM',
   // Data definition
   'CREATE [OR REPLACE] [SQL SECURITY DEFINER | SQL SECURITY INVOKER] VIEW [IF NOT EXISTS]',
   'CREATE [TEMPORARY] TABLE [IF NOT EXISTS]',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE [LOW_PRIORITY] [IGNORE]',
+  // - delete:
+  'DELETE [LOW_PRIORITY] [QUICK] [IGNORE] FROM',
+  // - drop table:
   'DROP [TEMPORARY] TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE',
@@ -43,9 +48,6 @@ const reservedClauses = expandPhrases([
   'RENAME COLUMN',
   'ALTER [COLUMN]',
   '{SET | DROP} DEFAULT', // for alter column
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE [TABLE]',
   // https://dev.mysql.com/doc/refman/8.0/en/sql-statements.html
diff --git a/src/languages/n1ql/n1ql.formatter.ts b/src/languages/n1ql/n1ql.formatter.ts
index 307439d2..7e7029ca 100644
--- a/src/languages/n1ql/n1ql.formatter.ts
+++ b/src/languages/n1ql/n1ql.formatter.ts
@@ -24,23 +24,24 @@ const reservedClauses = expandPhrases([
   'INSERT INTO',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  // - delete:
-  'DELETE FROM',
   // - merge:
   'MERGE INTO',
   'WHEN [NOT] MATCHED THEN',
   'UPDATE SET',
   'INSERT',
   // other
-  'USE KEYS',
   'NEST',
   'UNNEST',
   'RETURNING',
 ]);
 
 const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  // - delete:
+  'DELETE FROM',
+  // - set schema:
   'SET SCHEMA',
   // https://docs.couchbase.com/server/current/n1ql/n1ql-language-reference/reservedwords.html
   'ADVISE',
@@ -74,6 +75,7 @@ const onelineClauses = expandPhrases([
   'LET',
   'SET CURRENT SCHEMA',
   'SHOW',
+  'USE [PRIMARY] KEYS',
 ]);
 
 const reservedSetOperations = expandPhrases(['UNION [ALL]', 'EXCEPT [ALL]', 'INTERSECT [ALL]']);
diff --git a/src/languages/plsql/plsql.formatter.ts b/src/languages/plsql/plsql.formatter.ts
index 7a9742dc..9879c2dd 100644
--- a/src/languages/plsql/plsql.formatter.ts
+++ b/src/languages/plsql/plsql.formatter.ts
@@ -25,10 +25,7 @@ const reservedClauses = expandPhrases([
   'INSERT [INTO | ALL INTO]',
   'VALUES',
   // - update:
-  'UPDATE [ONLY]',
   'SET',
-  // - delete:
-  'DELETE FROM [ONLY]',
   // - merge:
   'MERGE [INTO]',
   'WHEN [NOT] MATCHED [THEN]',
@@ -37,6 +34,16 @@ const reservedClauses = expandPhrases([
   'CREATE [OR REPLACE] [NO FORCE | FORCE] [EDITIONING | EDITIONABLE | EDITIONABLE EDITIONING | NONEDITIONABLE] VIEW',
   'CREATE MATERIALIZED VIEW',
   'CREATE [GLOBAL TEMPORARY | PRIVATE TEMPORARY | SHARDED | DUPLICATED | IMMUTABLE BLOCKCHAIN | BLOCKCHAIN | IMMUTABLE] TABLE',
+  // other
+  'RETURNING',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE [ONLY]',
+  // - delete:
+  'DELETE FROM [ONLY]',
+  // - drop table:
   'DROP TABLE',
   // - alter table:
   'ALTER TABLE',
@@ -45,11 +52,6 @@ const reservedClauses = expandPhrases([
   'MODIFY',
   'RENAME TO',
   'RENAME COLUMN',
-  // other
-  'RETURNING',
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE TABLE',
   // other
diff --git a/src/languages/postgresql/postgresql.formatter.ts b/src/languages/postgresql/postgresql.formatter.ts
index 7990a10e..5ad88bd0 100644
--- a/src/languages/postgresql/postgresql.formatter.ts
+++ b/src/languages/postgresql/postgresql.formatter.ts
@@ -25,15 +25,22 @@ const reservedClauses = expandPhrases([
   'INSERT INTO',
   'VALUES',
   // - update:
-  'UPDATE [ONLY]',
   'SET',
-  'WHERE CURRENT OF',
-  // - delete:
-  'DELETE FROM [ONLY]',
   // Data definition
   'CREATE [OR REPLACE] [TEMP | TEMPORARY] [RECURSIVE] VIEW',
   'CREATE MATERIALIZED VIEW [IF NOT EXISTS]',
   'CREATE [GLOBAL | LOCAL] [TEMPORARY | TEMP | UNLOGGED] TABLE [IF NOT EXISTS]',
+  // other
+  'RETURNING',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE [ONLY]',
+  'WHERE CURRENT OF',
+  // - delete:
+  'DELETE FROM [ONLY]',
+  // - drop table:
   'DROP TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE [IF EXISTS] [ONLY]',
@@ -46,11 +53,6 @@ const reservedClauses = expandPhrases([
   '[SET DATA] TYPE', // for alter column
   '{SET | DROP} DEFAULT', // for alter column
   '{SET | DROP} NOT NULL', // for alter column
-  // other
-  'RETURNING',
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE [TABLE] [ONLY]',
   // other
diff --git a/src/languages/redshift/redshift.formatter.ts b/src/languages/redshift/redshift.formatter.ts
index 3ae39ca0..8d14294b 100644
--- a/src/languages/redshift/redshift.formatter.ts
+++ b/src/languages/redshift/redshift.formatter.ts
@@ -23,13 +23,18 @@ const reservedClauses = expandPhrases([
   'INSERT INTO',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  // - delete:
-  'DELETE [FROM]',
   // Data definition
   'CREATE [OR REPLACE | MATERIALIZED] VIEW',
   'CREATE [TEMPORARY | TEMP | LOCAL TEMPORARY | LOCAL TEMP] TABLE [IF NOT EXISTS]',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  // - delete:
+  'DELETE [FROM]',
+  // - drop table:
   'DROP TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE',
@@ -41,9 +46,6 @@ const reservedClauses = expandPhrases([
   'ALTER COLUMN',
   'TYPE', // for alter column
   'ENCODE', // for alter column
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE [TABLE]',
   // https://docs.aws.amazon.com/redshift/latest/dg/c_SQL_commands.html
diff --git a/src/languages/singlestoredb/singlestoredb.formatter.ts b/src/languages/singlestoredb/singlestoredb.formatter.ts
index 7d3cc0bb..1c4bd310 100644
--- a/src/languages/singlestoredb/singlestoredb.formatter.ts
+++ b/src/languages/singlestoredb/singlestoredb.formatter.ts
@@ -25,15 +25,20 @@ const reservedClauses = expandPhrases([
   'VALUES',
   'REPLACE [INTO]',
   // - update:
-  'UPDATE',
   'SET',
-  // - delete:
-  'DELETE [FROM]',
   // Data definition
   'CREATE VIEW',
   'CREATE [ROWSTORE] [REFERENCE | TEMPORARY | GLOBAL TEMPORARY] TABLE [IF NOT EXISTS]',
   'CREATE [OR REPLACE] [TEMPORARY] PROCEDURE [IF NOT EXISTS]',
   'CREATE [OR REPLACE] [EXTERNAL] FUNCTION',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  // - delete:
+  'DELETE [FROM]',
+  // - drop table:
   'DROP [TEMPORARY] TABLE [IF EXISTS]',
   // - alter table:
   'ALTER [ONLINE] TABLE',
@@ -43,9 +48,6 @@ const reservedClauses = expandPhrases([
   'MODIFY [COLUMN]',
   'CHANGE',
   'RENAME [TO | AS]',
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE [TABLE]',
   // https://docs.singlestore.com/managed-service/en/reference/sql-reference.html
diff --git a/src/languages/snowflake/snowflake.formatter.ts b/src/languages/snowflake/snowflake.formatter.ts
index b89dad82..b0dbaaf8 100644
--- a/src/languages/snowflake/snowflake.formatter.ts
+++ b/src/languages/snowflake/snowflake.formatter.ts
@@ -25,10 +25,7 @@ const reservedClauses = expandPhrases([
   '{THEN | ELSE} INTO',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  // - delete:
-  'DELETE FROM',
   // Data definition
   // - view
   'CREATE [OR REPLACE] [SECURE] [RECURSIVE] VIEW [IF NOT EXISTS]',
@@ -43,6 +40,14 @@ const reservedClauses = expandPhrases([
   'WHEN MATCHED [AND]',
   'THEN {UPDATE SET | DELETE}',
   'WHEN NOT MATCHED THEN INSERT',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  // - delete:
+  'DELETE FROM',
+  // - drop table:
   'DROP TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE [IF EXISTS]',
@@ -57,7 +62,7 @@ const reservedClauses = expandPhrases([
   '{ADD | ALTER | MODIFY | DROP} [CONSTRAINT]',
   'RENAME CONSTRAINT',
   '{ADD | DROP} SEARCH OPTIMIZATION',
-  '{SET | UNSET} [TAG]',
+  '{SET | UNSET} TAG', // Actually TAG is optional, but that conflicts with UPDATE..SET statement
   '{ADD | DROP} ROW ACCESS POLICY',
   'DROP ALL ROW ACCESS POLICIES',
   '{SET | DROP} DEFAULT', // for alter column
@@ -65,9 +70,6 @@ const reservedClauses = expandPhrases([
   '[SET DATA] TYPE', // for alter column
   '[UNSET] COMMENT', // for alter column
   '{SET | UNSET} MASKING POLICY', // for alter column
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE [TABLE] [IF EXISTS]',
   // other
diff --git a/src/languages/spark/spark.formatter.ts b/src/languages/spark/spark.formatter.ts
index c80284dc..22734370 100644
--- a/src/languages/spark/spark.formatter.ts
+++ b/src/languages/spark/spark.formatter.ts
@@ -37,6 +37,10 @@ const reservedClauses = expandPhrases([
   // Data definition
   'CREATE [OR REPLACE] [GLOBAL TEMPORARY | TEMPORARY] VIEW [IF NOT EXISTS]',
   'CREATE [EXTERNAL] TABLE [IF NOT EXISTS]',
+]);
+
+const onelineClauses = expandPhrases([
+  // - drop table:
   'DROP TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE',
@@ -45,9 +49,6 @@ const reservedClauses = expandPhrases([
   'RENAME TO',
   'RENAME COLUMN',
   'ALTER COLUMN',
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE TABLE',
   // other
diff --git a/src/languages/sql/sql.formatter.ts b/src/languages/sql/sql.formatter.ts
index 2b9410b1..51f31ddb 100644
--- a/src/languages/sql/sql.formatter.ts
+++ b/src/languages/sql/sql.formatter.ts
@@ -25,14 +25,19 @@ const reservedClauses = expandPhrases([
   'INSERT INTO',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  'WHERE CURRENT OF',
-  // - delete:
-  'DELETE FROM',
   // Data definition
   'CREATE [RECURSIVE] VIEW',
   'CREATE [GLOBAL TEMPORARY | LOCAL TEMPORARY] TABLE',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  'WHERE CURRENT OF',
+  // - delete:
+  'DELETE FROM',
+  // - drop table:
   'DROP TABLE',
   // - alter table:
   'ALTER TABLE',
@@ -45,9 +50,6 @@ const reservedClauses = expandPhrases([
   'ADD SCOPE', // for alter column
   'DROP SCOPE {CASCADE | RESTRICT}', // for alter column
   'RESTART WITH', // for alter column
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE TABLE',
   // other
diff --git a/src/languages/sqlite/sqlite.formatter.ts b/src/languages/sqlite/sqlite.formatter.ts
index 9f12880f..5c4c9efe 100644
--- a/src/languages/sqlite/sqlite.formatter.ts
+++ b/src/languages/sqlite/sqlite.formatter.ts
@@ -25,13 +25,18 @@ const reservedClauses = expandPhrases([
   'REPLACE INTO',
   'VALUES',
   // - update:
-  'UPDATE [OR ABORT | OR FAIL | OR IGNORE | OR REPLACE | OR ROLLBACK]',
   'SET',
-  // - delete:
-  'DELETE FROM',
   // Data definition
   'CREATE [TEMPORARY | TEMP] VIEW [IF NOT EXISTS]',
   'CREATE [TEMPORARY | TEMP] TABLE [IF NOT EXISTS]',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE [OR ABORT | OR FAIL | OR IGNORE | OR REPLACE | OR ROLLBACK]',
+  // - delete:
+  'DELETE FROM',
+  // - drop table:
   'DROP TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE',
@@ -39,10 +44,10 @@ const reservedClauses = expandPhrases([
   'DROP [COLUMN]',
   'RENAME [COLUMN]',
   'RENAME TO',
+  // - set schema
+  'SET SCHEMA',
 ]);
 
-const onelineClauses = expandPhrases(['SET SCHEMA']);
-
 const reservedSetOperations = expandPhrases(['UNION [ALL]', 'EXCEPT', 'INTERSECT']);
 
 // joins - https://www.sqlite.org/syntax/join-operator.html
diff --git a/src/languages/transactsql/transactsql.formatter.ts b/src/languages/transactsql/transactsql.formatter.ts
index d0d57c0c..cbda06b6 100644
--- a/src/languages/transactsql/transactsql.formatter.ts
+++ b/src/languages/transactsql/transactsql.formatter.ts
@@ -24,11 +24,7 @@ const reservedClauses = expandPhrases([
   'INSERT [INTO]',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  'WHERE CURRENT OF',
-  // - delete:
-  'DELETE [FROM]',
   // - merge:
   'MERGE [INTO]',
   'WHEN [NOT] MATCHED [BY TARGET | BY SOURCE] [THEN]',
@@ -36,15 +32,21 @@ const reservedClauses = expandPhrases([
   // Data definition
   'CREATE [OR ALTER] [MATERIALIZED] VIEW',
   'CREATE TABLE',
+]);
+
+const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  'WHERE CURRENT OF',
+  // - delete:
+  'DELETE [FROM]',
+  // - drop table:
   'DROP TABLE [IF EXISTS]',
   // - alter table:
   'ALTER TABLE',
   'ADD',
   'DROP COLUMN [IF EXISTS]',
   'ALTER COLUMN',
-]);
-
-const onelineClauses = expandPhrases([
   // - truncate:
   'TRUNCATE TABLE',
   // https://docs.microsoft.com/en-us/sql/t-sql/statements/statements?view=sql-server-ver15
diff --git a/src/languages/trino/trino.formatter.ts b/src/languages/trino/trino.formatter.ts
index 560cb2f1..3965dd90 100644
--- a/src/languages/trino/trino.formatter.ts
+++ b/src/languages/trino/trino.formatter.ts
@@ -26,23 +26,10 @@ const reservedClauses = expandPhrases([
   'INSERT INTO',
   'VALUES',
   // - update:
-  'UPDATE',
   'SET',
-  // - delete:
-  'DELETE FROM',
   // Data definition
   'CREATE [OR REPLACE] [MATERIALIZED] VIEW',
   'CREATE TABLE [IF NOT EXISTS]',
-  'DROP TABLE [IF EXISTS]',
-  // - alter table:
-  'ALTER TABLE [IF EXISTS]',
-  'ADD COLUMN [IF NOT EXISTS]',
-  'DROP COLUMN [IF EXISTS]',
-  'RENAME COLUMN [IF EXISTS]',
-  'RENAME TO',
-  'SET AUTHORIZATION [USER | ROLE]',
-  'SET PROPERTIES',
-  'EXECUTE',
   // MATCH_RECOGNIZE
   'MATCH_RECOGNIZE',
   'MEASURES',
@@ -55,6 +42,21 @@ const reservedClauses = expandPhrases([
 ]);
 
 const onelineClauses = expandPhrases([
+  // - update:
+  'UPDATE',
+  // - delete:
+  'DELETE FROM',
+  // - drop table:
+  'DROP TABLE [IF EXISTS]',
+  // - alter table:
+  'ALTER TABLE [IF EXISTS]',
+  'ADD COLUMN [IF NOT EXISTS]',
+  'DROP COLUMN [IF EXISTS]',
+  'RENAME COLUMN [IF EXISTS]',
+  'RENAME TO',
+  'SET AUTHORIZATION [USER | ROLE]',
+  'SET PROPERTIES',
+  'EXECUTE',
   // - truncate:
   'TRUNCATE TABLE',
 


Test patch:
diff --git a/test/behavesLikeMariaDbFormatter.ts b/test/behavesLikeMariaDbFormatter.ts
index 9824cef5..f35ceff4 100644
--- a/test/behavesLikeMariaDbFormatter.ts
+++ b/test/behavesLikeMariaDbFormatter.ts
@@ -102,10 +102,8 @@ export default function behavesLikeMariaDbFormatter(format: FormatFn) {
   // Issue #181
   it('does not wrap CHARACTER SET to multiple lines', () => {
     expect(format('ALTER TABLE t MODIFY col1 VARCHAR(50) CHARACTER SET greek')).toBe(dedent`
-      ALTER TABLE
-        t
-      MODIFY
-        col1 VARCHAR(50) CHARACTER SET greek
+      ALTER TABLE t
+      MODIFY col1 VARCHAR(50) CHARACTER SET greek
     `);
   });
 
diff --git a/test/bigquery.test.ts b/test/bigquery.test.ts
index 07087303..9afe4d5b 100644
--- a/test/bigquery.test.ts
+++ b/test/bigquery.test.ts
@@ -436,10 +436,8 @@ describe('BigQueryFormatter', () => {
         ALTER SCHEMA mydataset
         SET DEFAULT COLLATE 'und:ci'`;
       const expected = dedent`
-        ALTER SCHEMA
-          mydataset
-        SET DEFAULT COLLATE
-          'und:ci'`;
+        ALTER SCHEMA mydataset
+        SET DEFAULT COLLATE 'und:ci'`;
       expect(format(input)).toBe(expected);
     });
 
@@ -450,10 +448,8 @@ describe('BigQueryFormatter', () => {
           default_table_expiration_days=3.75
           )`;
       const expected = dedent`
-        ALTER SCHEMA
-          mydataset
-        SET OPTIONS
-          (default_table_expiration_days = 3.75)`;
+        ALTER SCHEMA mydataset
+        SET OPTIONS (default_table_expiration_days = 3.75)`;
       expect(format(input)).toBe(expected);
     });
 
@@ -464,12 +460,10 @@ describe('BigQueryFormatter', () => {
           expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
         )`;
       const expected = dedent`
-        ALTER TABLE
-          mydataset.mytable
-        SET OPTIONS
-          (
-            expiration_timestamp = TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
-          )`;
+        ALTER TABLE mydataset.mytable
+        SET OPTIONS (
+          expiration_timestamp = TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
+        )`;
       expect(format(input)).toBe(expected);
     });
 
@@ -478,10 +472,8 @@ describe('BigQueryFormatter', () => {
         ALTER TABLE mydataset.mytable
         SET DEFAULT COLLATE 'und:ci'`;
       const expected = dedent`
-        ALTER TABLE
-          mydataset.mytable
-        SET DEFAULT COLLATE
-          'und:ci'`;
+        ALTER TABLE mydataset.mytable
+        SET DEFAULT COLLATE 'und:ci'`;
       expect(format(input)).toBe(expected);
     });
 
@@ -493,12 +485,9 @@ describe('BigQueryFormatter', () => {
           description="Price per unit"
         )`;
       const expected = dedent`
-        ALTER TABLE
-          mydataset.mytable
-        ALTER COLUMN
-          price
-        SET OPTIONS
-          (description = "Price per unit")`;
+        ALTER TABLE mydataset.mytable
+        ALTER COLUMN price
+        SET OPTIONS (description = "Price per unit")`;
       expect(format(input)).toBe(expected);
     });
 
@@ -508,10 +497,8 @@ describe('BigQueryFormatter', () => {
         ALTER COLUMN price
         DROP NOT NULL`;
       const expected = dedent`
-        ALTER TABLE
-          mydataset.mytable
-        ALTER COLUMN
-          price
+        ALTER TABLE mydataset.mytable
+        ALTER COLUMN price
         DROP NOT NULL`;
       expect(format(input)).toBe(expected);
     });
@@ -522,12 +509,9 @@ describe('BigQueryFormatter', () => {
         ALTER COLUMN price
         SET DATA TYPE NUMERIC`;
       const expected = dedent`
-        ALTER TABLE
-          mydataset.mytable
-        ALTER COLUMN
-          price
-        SET DATA TYPE
-          NUMERIC`;
+        ALTER TABLE mydataset.mytable
+        ALTER COLUMN price
+        SET DATA TYPE NUMERIC`;
       expect(format(input)).toBe(expected);
     });
 
@@ -538,12 +522,10 @@ describe('BigQueryFormatter', () => {
           expiration_timestamp=TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
         )`;
       const expected = dedent`
-        ALTER VIEW
-          mydataset.myview
-        SET OPTIONS
-          (
-            expiration_timestamp = TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
-          )`;
+        ALTER VIEW mydataset.myview
+        SET OPTIONS (
+          expiration_timestamp = TIMESTAMP_ADD(CURRENT_TIMESTAMP(), INTERVAL 7 DAY)
+        )`;
       expect(format(input)).toBe(expected);
     });
 
@@ -554,10 +536,8 @@ describe('BigQueryFormatter', () => {
           size_gb = 250
         )`;
       const expected = dedent`
-        ALTER BI_CAPACITY
-          my-project.region-us.default
-        SET OPTIONS
-          (size_gb = 250)`;
+        ALTER BI_CAPACITY my-project.region-us.default
+        SET OPTIONS (size_gb = 250)`;
       expect(format(input)).toBe(expected);
     });
   });
diff --git a/test/db2.test.ts b/test/db2.test.ts
index 87480c83..ec028200 100644
--- a/test/db2.test.ts
+++ b/test/db2.test.ts
@@ -103,8 +103,7 @@ describe('Db2Formatter', () => {
 
   it('supports WITH isolation level modifiers for UPDATE statement', () => {
     expect(format('UPDATE foo SET x = 10 WITH CS')).toBe(dedent`
-      UPDATE
-        foo
+      UPDATE foo
       SET
         x = 10
       WITH CS
@@ -118,17 +117,12 @@ describe('Db2Formatter', () => {
          ALTER TABLE t ALTER COLUMN foo SET NOT NULL;`
       )
     ).toBe(dedent`
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET DATA TYPE
-        VARCHAR;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET DATA TYPE VARCHAR;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       SET NOT NULL;
     `);
   });
diff --git a/test/features/alterTable.ts b/test/features/alterTable.ts
index 6494a84a..9f0feaa0 100644
--- a/test/features/alterTable.ts
+++ b/test/features/alterTable.ts
@@ -15,10 +15,8 @@ export default function supportsAlterTable(format: FormatFn, cfg: AlterTableConf
     it('formats ALTER TABLE ... ADD COLUMN query', () => {
       const result = format('ALTER TABLE supplier ADD COLUMN unit_price DECIMAL NOT NULL;');
       expect(result).toBe(dedent`
-        ALTER TABLE
-          supplier
-        ADD COLUMN
-          unit_price DECIMAL NOT NULL;
+        ALTER TABLE supplier
+        ADD COLUMN unit_price DECIMAL NOT NULL;
       `);
     });
   }
@@ -27,10 +25,8 @@ export default function supportsAlterTable(format: FormatFn, cfg: AlterTableConf
     it('formats ALTER TABLE ... DROP COLUMN query', () => {
       const result = format('ALTER TABLE supplier DROP COLUMN unit_price;');
       expect(result).toBe(dedent`
-        ALTER TABLE
-          supplier
-        DROP COLUMN
-          unit_price;
+        ALTER TABLE supplier
+        DROP COLUMN unit_price;
       `);
     });
   }
@@ -39,10 +35,8 @@ export default function supportsAlterTable(format: FormatFn, cfg: AlterTableConf
     it('formats ALTER TABLE ... MODIFY statement', () => {
       const result = format('ALTER TABLE supplier MODIFY supplier_id DECIMAL NULL;');
       expect(result).toBe(dedent`
-        ALTER TABLE
-          supplier
-        MODIFY
-          supplier_id DECIMAL NULL;
+        ALTER TABLE supplier
+        MODIFY supplier_id DECIMAL NULL;
       `);
     });
   }
@@ -51,10 +45,8 @@ export default function supportsAlterTable(format: FormatFn, cfg: AlterTableConf
     it('formats ALTER TABLE ... RENAME TO statement', () => {
       const result = format('ALTER TABLE supplier RENAME TO the_one_who_supplies;');
       expect(result).toBe(dedent`
-        ALTER TABLE
-          supplier
-        RENAME TO
-          the_one_who_supplies;
+        ALTER TABLE supplier
+        RENAME TO the_one_who_supplies;
       `);
     });
   }
@@ -63,10 +55,8 @@ export default function supportsAlterTable(format: FormatFn, cfg: AlterTableConf
     it('formats ALTER TABLE ... RENAME COLUMN statement', () => {
       const result = format('ALTER TABLE supplier RENAME COLUMN supplier_id TO id;');
       expect(result).toBe(dedent`
-        ALTER TABLE
-          supplier
-        RENAME COLUMN
-          supplier_id TO id;
+        ALTER TABLE supplier
+        RENAME COLUMN supplier_id TO id;
       `);
     });
   }
diff --git a/test/features/deleteFrom.ts b/test/features/deleteFrom.ts
index 542a2a4f..2b26cc54 100644
--- a/test/features/deleteFrom.ts
+++ b/test/features/deleteFrom.ts
@@ -13,8 +13,7 @@ export default function supportsDeleteFrom(
   it('formats DELETE FROM statement', () => {
     const result = format("DELETE FROM Customers WHERE CustomerName='Alfred' AND Phone=5002132;");
     expect(result).toBe(dedent`
-      DELETE FROM
-        Customers
+      DELETE FROM Customers
       WHERE
         CustomerName = 'Alfred'
         AND Phone = 5002132;
@@ -25,8 +24,7 @@ export default function supportsDeleteFrom(
     it('formats DELETE statement (without FROM)', () => {
       const result = format("DELETE Customers WHERE CustomerName='Alfred';");
       expect(result).toBe(dedent`
-        DELETE
-          Customers
+        DELETE Customers
         WHERE
           CustomerName = 'Alfred';
       `);
diff --git a/test/features/dropTable.ts b/test/features/dropTable.ts
index 25b44ed8..5802c080 100644
--- a/test/features/dropTable.ts
+++ b/test/features/dropTable.ts
@@ -10,8 +10,7 @@ export default function supportsDropTable(format: FormatFn, { ifExists }: DropTa
   it('formats DROP TABLE statement', () => {
     const result = format('DROP TABLE admin_role;');
     expect(result).toBe(dedent`
-      DROP TABLE
-        admin_role;
+      DROP TABLE admin_role;
     `);
   });
 
@@ -19,8 +18,7 @@ export default function supportsDropTable(format: FormatFn, { ifExists }: DropTa
     it('formats DROP TABLE IF EXISTS statement', () => {
       const result = format('DROP TABLE IF EXISTS admin_role;');
       expect(result).toBe(dedent`
-        DROP TABLE IF EXISTS
-          admin_role;
+        DROP TABLE IF EXISTS admin_role;
       `);
     });
   }
diff --git a/test/features/update.ts b/test/features/update.ts
index 533e0f9f..a412cba9 100644
--- a/test/features/update.ts
+++ b/test/features/update.ts
@@ -12,8 +12,7 @@ export default function supportsUpdate(format: FormatFn, { whereCurrentOf }: Upd
       "UPDATE Customers SET ContactName='Alfred Schmidt', City='Hamburg' WHERE CustomerName='Alfreds Futterkiste';"
     );
     expect(result).toBe(dedent`
-      UPDATE
-        Customers
+      UPDATE Customers
       SET
         ContactName = 'Alfred Schmidt',
         City = 'Hamburg'
@@ -27,8 +26,7 @@ export default function supportsUpdate(format: FormatFn, { whereCurrentOf }: Upd
       'UPDATE customers SET total_orders = order_summary.total  FROM ( SELECT * FROM bank) AS order_summary'
     );
     expect(result).toBe(dedent`
-      UPDATE
-        customers
+      UPDATE customers
       SET
         total_orders = order_summary.total
       FROM
@@ -45,12 +43,10 @@ export default function supportsUpdate(format: FormatFn, { whereCurrentOf }: Upd
     it('formats UPDATE statement with cursor position', () => {
       const result = format("UPDATE Customers SET Name='John' WHERE CURRENT OF my_cursor;");
       expect(result).toBe(dedent`
-        UPDATE
-          Customers
+        UPDATE Customers
         SET
           Name = 'John'
-        WHERE CURRENT OF
-          my_cursor;
+        WHERE CURRENT OF my_cursor;
       `);
     });
   }
diff --git a/test/mariadb.test.ts b/test/mariadb.test.ts
index 0a5b7411..cc08418a 100644
--- a/test/mariadb.test.ts
+++ b/test/mariadb.test.ts
@@ -77,17 +77,12 @@ describe('MariaDbFormatter', () => {
          ALTER TABLE t ALTER COLUMN foo DROP DEFAULT;`
       )
     ).toBe(dedent`
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET DEFAULT
-        10;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET DEFAULT 10;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       DROP DEFAULT;
     `);
   });
diff --git a/test/mysql.test.ts b/test/mysql.test.ts
index 2acbe367..13dc1ff4 100644
--- a/test/mysql.test.ts
+++ b/test/mysql.test.ts
@@ -84,17 +84,12 @@ describe('MySqlFormatter', () => {
          ALTER TABLE t ALTER COLUMN foo DROP DEFAULT;`
       )
     ).toBe(dedent`
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET DEFAULT
-        10;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET DEFAULT 10;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       DROP DEFAULT;
     `);
   });
diff --git a/test/n1ql.test.ts b/test/n1ql.test.ts
index fe45b349..2629e74e 100644
--- a/test/n1ql.test.ts
+++ b/test/n1ql.test.ts
@@ -115,8 +115,7 @@ describe('N1qlFormatter', () => {
         *
       FROM
         usr
-      USE KEYS
-        'Elinor_33313792'
+      USE KEYS 'Elinor_33313792'
       NEST
         orders_with_users orders ON KEYS ARRAY s.order_id FOR s IN usr.shipped_order_history END;
     `);
@@ -126,20 +125,16 @@ describe('N1qlFormatter', () => {
     const result = format("EXPLAIN DELETE FROM tutorial t USE KEYS 'baldwin'");
     expect(result).toBe(dedent`
       EXPLAIN
-      DELETE FROM
-        tutorial t
-      USE KEYS
-        'baldwin'
+      DELETE FROM tutorial t
+      USE KEYS 'baldwin'
     `);
   });
 
   it('formats UPDATE query with USE KEYS', () => {
     const result = format("UPDATE tutorial USE KEYS 'baldwin' SET type = 'actor'");
     expect(result).toBe(dedent`
-      UPDATE
-        tutorial
-      USE KEYS
-        'baldwin'
+      UPDATE tutorial
+      USE KEYS 'baldwin'
       SET
         type = 'actor'
     `);
diff --git a/test/postgresql.test.ts b/test/postgresql.test.ts
index 59d1a0bf..8ba232ca 100644
--- a/test/postgresql.test.ts
+++ b/test/postgresql.test.ts
@@ -237,36 +237,24 @@ describe('PostgreSqlFormatter', () => {
          ALTER TABLE t ALTER COLUMN foo DROP NOT NULL;`
       )
     ).toBe(dedent`
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET DATA TYPE
-        VARCHAR;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET DATA TYPE VARCHAR;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET DEFAULT
-        5;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET DEFAULT 5;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       DROP DEFAULT;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       SET NOT NULL;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       DROP NOT NULL;
     `);
   });
diff --git a/test/redshift.test.ts b/test/redshift.test.ts
index 3a8a9221..6b5ff209 100644
--- a/test/redshift.test.ts
+++ b/test/redshift.test.ts
@@ -134,19 +134,13 @@ describe('RedshiftFormatter', () => {
          ALTER TABLE t ALTER COLUMN foo ENCODE my_encoding;`
       )
     ).toBe(dedent`
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      TYPE
-        VARCHAR;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      TYPE VARCHAR;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      ENCODE
-        my_encoding;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      ENCODE my_encoding;
     `);
   });
 });
diff --git a/test/snowflake.test.ts b/test/snowflake.test.ts
index cd9168ce..791a6b6c 100644
--- a/test/snowflake.test.ts
+++ b/test/snowflake.test.ts
@@ -106,77 +106,49 @@ describe('SnowflakeFormatter', () => {
          ALTER TABLE t ALTER COLUMN foo UNSET TAG tname;`
       )
     ).toBe(dedent`
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET DATA TYPE
-        VARCHAR;
-
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET DEFAULT
-        5;
-
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET DATA TYPE VARCHAR;
+
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET DEFAULT 5;
+
+      ALTER TABLE t
+      ALTER COLUMN foo
       DROP DEFAULT;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       SET NOT NULL;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       DROP NOT NULL;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      COMMENT
-        'blah';
-
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
+      COMMENT 'blah';
+
+      ALTER TABLE t
+      ALTER COLUMN foo
       UNSET COMMENT;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET MASKING POLICY
-        polis;
-
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET MASKING POLICY polis;
+
+      ALTER TABLE t
+      ALTER COLUMN foo
       UNSET MASKING POLICY;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET TAG
-        tname = 10;
-
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      UNSET TAG
-        tname;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET TAG tname = 10;
+
+      ALTER TABLE t
+      ALTER COLUMN foo
+      UNSET TAG tname;
     `);
   });
 });
diff --git a/test/spark.test.ts b/test/spark.test.ts
index 5bbb2ecc..447d6fed 100644
--- a/test/spark.test.ts
+++ b/test/spark.test.ts
@@ -128,10 +128,8 @@ describe('SparkFormatter', () => {
   it('formats ALTER TABLE ... ALTER COLUMN', () => {
     expect(format(`ALTER TABLE StudentInfo ALTER COLUMN FirstName COMMENT "new comment";`))
       .toBe(dedent`
-      ALTER TABLE
-        StudentInfo
-      ALTER COLUMN
-        FirstName COMMENT "new comment";
+      ALTER TABLE StudentInfo
+      ALTER COLUMN FirstName COMMENT "new comment";
     `);
   });
 });
diff --git a/test/sql.test.ts b/test/sql.test.ts
index 1cc78ea0..9a8bf580 100644
--- a/test/sql.test.ts
+++ b/test/sql.test.ts
@@ -79,31 +79,21 @@ describe('SqlFormatter', () => {
          ALTER TABLE t ALTER COLUMN foo RESTART WITH 10;`
       )
     ).toBe(dedent`
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      SET DEFAULT
-        5;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      SET DEFAULT 5;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       DROP DEFAULT;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
+      ALTER TABLE t
+      ALTER COLUMN foo
       DROP SCOPE CASCADE;
 
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo
-      RESTART WITH
-        10;
+      ALTER TABLE t
+      ALTER COLUMN foo
+      RESTART WITH 10;
     `);
   });
 });
diff --git a/test/transactsql.test.ts b/test/transactsql.test.ts
index cdcfe4d0..83ea3142 100644
--- a/test/transactsql.test.ts
+++ b/test/transactsql.test.ts
@@ -113,10 +113,8 @@ describe('TransactSqlFormatter', () => {
 
   it('formats ALTER TABLE ... ALTER COLUMN', () => {
     expect(format(`ALTER TABLE t ALTER COLUMN foo INT NOT NULL DEFAULT 5;`)).toBe(dedent`
-      ALTER TABLE
-        t
-      ALTER COLUMN
-        foo INT NOT NULL DEFAULT 5;
+      ALTER TABLE t
+      ALTER COLUMN foo INT NOT NULL DEFAULT 5;
     `);
   });
 });