Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>osavNew to Visual Studio Code? Get it now.
osav

osav

Maximilian Seipel

|
8 installs
| (0) | Free
osav
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

How To Use

  1. Go to File -> Preferences -> Settings ->
  2. Enable 'Editor: Format On Save'
  3. Profit

Features

1. SQL Formatting

Base: sql-formatter (https://github.com/vertical-blank/sql-formatter)

{
    language: 'bigquery',
    keywordCase: 'upper',
    linesBetweenQueries: 2
}

2. Replaces

Umlaute
ä, Ä, ü, Ü, ö, Ö, ß -> ae, Ae, ue, Ue, oe, Oe, ss
Keywords to Uppercase (that sql-formatter library missed) 
const manualKeywords = [
'min\\(', 'max\\(', 'cast\\(', 'row_number\\(', 'rank\\(', 'abs\\(', 'sum\\(', 'avg\\(', 'round\\(','date', 'datetime', 'timestamp', 'int', 'int64', 'numeric', 'string', 'bool','ifnull', 'if', 'elseif', 'while', 'coalesce', 'safe_cast\\(', 'array_length\\(', 'left\\(', 'right\\('
];

3. Remove Linebreaks / Empty Lines

(* = 1 or more linebreaks/empty lines)
- DECLARE...;*DECLARE...; -> DECLARE...;\nDECLARE...;
- STRUCT< e1, *e2, *e3> -> STRUCT< e1, e2, e3>
- IF * AND/OR -> IF AND/OR
- END * WHILE; -> END WHILE;
- SET * ...; -> SET...;

3. Add Linebreaks / Empty Lines

- WHILE DO -> WHILE\nDO
- BEGIN IF -> BEGIN\nIF
- Above a comment

4. Add Intent

- BEGIN ... END;
- WHILE DO ... END WHILE;
- IF...ENDIF;

4. OSAV Specific

Step Aliases
- Lower case
- Remove special character: Only [a-z][0-9][_] allowed
- Example: 
    CREATE OR REPLACE TEMP TABLE test-_TABLE1_ac AS
    -> 
    CREATE OR REPLACE TEMP TABLE test_table1_ac AS

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft