Git Product home page Git Product logo

Comments (3)

nene avatar nene commented on August 25, 2024

Thanks for reporting.

This can probably be patched in sql-formatter. Though there are many scenarios like that where it fails.

If you want a Prettier plugin to format PostgreSQL, I suggest you try prettier-plugin-sql-cst. It does not yet support full PostgreSQL syntax, but it should work for most of the common scenarios (this issue tracks the current progress of PostgreSQL support) and it does an overall better job at formatting than SQL Formatter will ever be capable of.

from sql-formatter.

jonatanschroeder avatar jonatanschroeder commented on August 25, 2024

Thanks for the quick reply.

About the Prettier plugin, I just did a quick check, and it seems to work well in most cases, but there are some cases that it does not support which we use in our case, such as types (CREATE TYPE), DO code statements, FULL JOIN, and a few minor constructs. Also, the fact that it's in experimental stage means it's probably a good idea for us to stick with the custom plugin package has been working for us for the last 12 months until this package is in a more stable setting. That said, it looks promising, and it's likely something to consider in a future release. Also, some of the formatting choices in that plugin seem to me (personally) to make a bit more sense than the ones used in sql-formatter.

from sql-formatter.

nene avatar nene commented on August 25, 2024

Thanks for the feedback. Always good to learn which actual features, that people are using, are missing. I can then possibly prioritize these before others.

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.