Skip to content

[Bug]: Strange indentation when formatting duckdb SQL #2586

@hermeschen1116

Description

@hermeschen1116

What happened?

I tried to format the duckdb SQL below but sqruff keep formatting the first bracket in a strange way.

FROM
Stream.Stream
WHERE
(
(
$create_at_start IS NULL)
        OR (create_at >= $create_at_start)
    )
    AND (
        ($create_at_end IS NULL)
        OR (create_at <= $create_at_end)
    )
    AND (
        ($create_at IS NULL)
        OR (create_at == $create_at)
    )
    AND (
        ($update_at_start IS NULL)
        OR (update_at >= $update_at_start)
    )
    AND (
        ($update_at_end IS NULL)
        OR (update_at <= $update_at_end)
    )
    AND (
        ($update_at IS NULL)
        OR (update_at == $update_at)
    )
    AND (
        ($channels IS NULL)
        OR (list_contains($channels, channel))
    )
    AND (
        ($stream_id IS NULL)
        OR (stream_id == $stream_id)
    )
    AND (
        ($direction IS NULL)
        OR (direction == $direction::DIRECTION)
    )
    AND (
        ($name IS NULL)
        OR (name LIKE $name)
    )
ORDER BY
    channel;

Version

v0.38.0

Checked in Playground

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions