Git Product home page Git Product logo

Comments (4)

moltar avatar moltar commented on June 24, 2024 1

From testing this with PosgreSQL, the main issue seems to be the placeholder support.

Placeholders get disjointed:

INSERT INTO
  "user"("first_name", "last_name", "is_admin")
VALUES
  ($ 1, $ 2, $ 3) RETURNING "id",
  "is_admin"

Should be:

INSERT INTO
  "user"("first_name", "last_name", "is_admin")
VALUES
  ($1, $2, $3)
RETURNING
  "id", "is_admin"

from sql-formatter.

nene avatar nene commented on June 24, 2024 1

Initial postgresql support has now been released in 4.0.0-beta.1.

To enable it, one can pass "postgresql" as language option:

format("SELECT *", {language: "postgresql"});

from sql-formatter.

Deisss avatar Deisss commented on June 24, 2024

+1 on this

from sql-formatter.

estar avatar estar commented on June 24, 2024

For me, the main issue would be dollar-quoted strings, with extra work required in the tokenizer (because the start/token is variable). As of commit 2f3e9a8, using StandardSqlFormatter:

    Expected value to be (using ===):
      "SELECT $a$String example: $$Hello world!$$ - Did it work?$a$"
    Received:
      "SELECT
      $ a $ String example: $ $ Hello world ! $ $ - Did it work ? $ a $"

from sql-formatter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.