Giter Club home page Giter Club logo

Comments (5)

manticore-projects avatar manticore-projects commented on May 30, 2024

Thank you for reporting, the AGGREGATE functions are not fully supported yet because there is also an issue pending in JSQLParser which I wont' close before then other pending PRs are accepted.

That said: Also your Online example fails on it, the GROUP_CONCAT is formatted somehow, but certainly not correctly.

But I will see what I can do today.

from jsqlformatter.

manticore-projects avatar manticore-projects commented on May 30, 2024

You also will see some Warning like:

WARNING: Unhandled expression: net.sf.jsqlparser.expression.MySQLGroupConcat = GROUP_CONCAT(DISTINCT TRIM(Concat(m.title, ' ', m.firstname, ' ', m.lastname)) ORDER BY p2m.manufacturer_type_id ASC SEPARATOR ' ')

It indicates that this particular expression is not supported yet in JSQLFormatter.
Just send me a reminder whenever you any warning like that. I do not use MySQL and so far have focused on Oracle/MSSQL Server and H2. But of course we should support MySQL also as much as possible.

from jsqlformatter.

manticore-projects avatar manticore-projects commented on May 30, 2024

How would you like to get it actually formatted? This MySQL specific expression looks a bit alien to me, so right now I would format it like that:

-- GROUP_CONCAT
SELECT Group_Concat(    DISTINCT Trim( Concat(  m.title, ' ', m.firstname
                                                , ' ', m.lastname ) )
                        ORDER BY p2m.manufacturer_type_id ASC
                        SEPARATOR' ' ) AS manufacturer_name
FROM product_to_manufacturer p2m
    LEFT JOIN manufacturer m
        ON m.manufacturer_id = p2m.manufacturer_id
WHERE p2m.product_id = 574768
;

Any objections or suggestions?

from jsqlformatter.

manticore-projects avatar manticore-projects commented on May 30, 2024

Implemented, you can test it online and also download the Updated Netbeans Plugin

from jsqlformatter.

csonuryilmaz avatar csonuryilmaz commented on May 30, 2024

.. How would you like to get it actually formatted? This MySQL specific expression looks a bit alien to me, so right now I would format it like that: ..

Hi, your proposed formatting seems to be fine. 👍

Now, I'm using latest .nbm and query is much better and readable compared to previous one-line style.

2021-05-16_14-11

Thanks a lot. 🤗 🙏

.. You also will see some Warning like:

WARNING: Unhandled expression: net.sf.jsqlparser.expression.MySQLGroupConcat

I don't have any reported warning or exception on Netbeans "Notifications" window by now.

.. I do not use MySQL and so far have focused on Oracle/MSSQL Server and H2. But of course we should support MySQL also as much as possible. ..

👍 In the past I've also worked on MSSQL and Oracle databases. But now, in my current job, I'm only working on MySQL.

from jsqlformatter.

Related Issues (11)

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.