TaoK / PoorMansTSqlFormatter

A small free .Net and JS library (with demo UI, command-line bulk formatter, SSMS/VS add-in, notepad++ plugin, winmerge plugin, and demo webpage) for reformatting and coloring T-SQL code to the user's preferences.
http://www.architectshack.com/PoorMansTSqlFormatter.ashx
GNU Affero General Public License v3.0
947 stars 266 forks source link

Postgresql Json Column Add Spaces #289

Closed hugorn closed 9 months ago

hugorn commented 9 months ago

Before formating

select params->>'name' from events;

After formatting it is adding spaces ->> causing error

select params - > > 'name' from events;

Perhaps a parameter that allows you to indicate certain keywords that should not be changed would be a good idea.

CZEMacLeod commented 9 months ago

This is designed specifically for the T-SQL variant as used by Microsoft SQL Server. While it probably works okay with generic SQL statements for other databases - they do have differing escape characters and keywords, so I don't think it can really be used for any specific stuff like Postgres Json statements.

hugorn commented 9 months ago

What a shame, of all the ones I tested, this was by far the one with the best overall results.

crazycga commented 9 months ago

What a shame, of all the ones I tested, this was by far the one with the best overall results.

Maybe you could help me understand this, but I don't get why you're disappointed that a Microsoft format like an SSRS report doesn't work for non-Microsoft products? RDL type reports are SSRS specific (unless I'm mistaken?)

hugorn commented 9 months ago

All doubts were clarified. Thank you and I'm already closing this issue