Skip to content

missing -- sql comment support for disable formatting #912

@lil5

Description

@lil5

/(\/\* *sql-formatter-disable *\*\/[\s\S]*?(?:\/\* *sql-formatter-enable *\*\/|$))/uy,

In MariaDB you can't use /* comment */ and need to use -- comment to disable formatting in mariadb sql files for queries, it would be handy to be able to use -- instead like so:

SELECT
-- sql-formatter-disable
  sqlc.embed(users),
-- sql-formatter-enable
  customers.id
FROM
  customers
  JOIN users ON users.customer_id = customers.id

My personal issue is the issue that this formatter adds a space after embed for my golang sqlc project (see #913)

--- sqlc.embed(users)
+++ sqlc.embed (users)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions