Skip to content

Don't format s-strings #1284

@max-sixty

Description

@max-sixty

From #965, broadening that issue to being able to avoid the auto-formatting. For context, this is can be important with non-standard SQL, like Snowflake's semi-structured data.

A couple of options for how we could do this:

  • Implement an "ignore" option upstream, in Possible to provide an escape hatch for expressions? shssoichiro/sqlformat-rs#15. I'm not sure whether upstream would accept a PR (though it seems reasonable, and worst case we could maintain a fork)
  • Replace s-strings after the auto-formatting, using $s_string_n. This requires passing s-strings all the way through the compiler, reducing the modularity of the compiler phases, but otherwise being fairly simple.
  • Relying on the new Options struct to disable formatting entirely. This has the disadvantage of being an all-or-nothing option, but might be an acceptable temporary solution.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions