Comments (5)
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.
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.
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.
Implemented, you can test it online and also download the Updated Netbeans Plugin
from jsqlformatter.
.. 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.
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)
- BadLocationException: Wrong (offset+length) HOT 3
- How to be compatible with sqls containing keywords HOT 2
- TOP clause missing
- There is a bug in modifying the table name statement HOT 2
- `WINDOW` clause missing
- ParseException: Encountered unexpected token:<EOF> HOT 4
- missing "limit" keyword after format HOT 3
- formatter doesn't lower some keywords (in, distinct, union, all, and) HOT 5
- NullPointerException with a "select ... case when" query HOT 5
- "Encountered unexpected token" when SQL has comment
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsqlformatter.