SQL Formatting

The SDF formatter is an extremely fast SQL formatter designed as a drop-in replacement for SQLFluff. It is available natively as part of the SDF cli.

sdf format

The entrypoint for the formatter is sdf format.

sdf format                     # Formats all files in the SDF Workspace
sdf format /path/to/file.sql   # Formats one specific file
sdf format /path/to/dir/*.sql  # Formats all files matching glob pattern

Formatting Configuration

You may set a formatting configuration for an SDF project.

workspace.sdf.yml
sdf-args:
   lint: >
    ...
   format: >
     -l line-length=80 
     -l indent=2 
     -l commas=leading

Formatting Reference

The following formatting options are supported.

TypeConfigurationAuto-FixDefault
Layoutline-length80
Layoutindent2
Layoutcommastrailing