Skip to content

dql format

Synopsis

dql format [options] [<source>]

Description

Parse and pretty-print DelightQL source code. Reads from a file, a literal string, or stdin.

Options

<source>
File path or literal DQL string. Reads stdin if omitted.

--color mode
Color output: always, auto (default), never.

--fail-if-not-formatted
Exit 1 if input is not already correctly formatted. Produces no output. Intended for CI enforcement.

--highlights path
Path to a custom highlights.scm file.

--theme path
Path to a TextMate theme file.

Examples

# Format a file
dql format query.dql

# Format from stdin
echo 'users(name,age)|>where(age>30)' | dql format

# CI check
dql format --fail-if-not-formatted query.dql

dql-fmt

Synopsis

dql-fmt [options] [<source>]

Description

Standalone formatting binary. Produces identical output to dql format but has no database dependencies. Suitable for editor integrations, CI pipelines, and pre-commit hooks.

Options

<source>
File path or literal DQL string. Reads stdin if omitted.

-c, --config path
Path to a .dql-format configuration file.

--fail-if-not-formatted
Exit 1 if input is not already correctly formatted.

Configuration

Both dql format and dql-fmt read a .dql-format file from the working directory (or via --config). Format is key = value:

pipe_indent = 3
continuation_indent = 5
projection_length = 40
continuation_length = 40
cte_style = subordinate

Building

cargo build -p delightql-formatter --features bundled-parser

Produces target/debug/dql-fmt (or target/release/dql-fmt with --release).

See Also

dql(1)