nene / prettier-plugin-sql-cst

Prettier SQL plugin that uses sql-parser-cst
https://nene.github.io/prettier-sql-playground/
GNU General Public License v3.0
123 stars 7 forks source link

Export type that lists names of supported parsers #19

Open nene opened 8 months ago

nene commented 8 months ago

So that prettier-plugin-embed would not need to update its parser list each time new dialect is added.

Sec-ant commented 8 months ago

Oh sorry I just realized I forgot to also update the prettier option definition here: https://github.com/Sec-ant/prettier-plugin-embed/blob/main/src%2Fembedded%2Fsql%2Foptions.ts#L84-L91

So the new parsers would probably still not work. And only exporting types looks also not enough because I still have to manually define these options.

However requiring a plugin to do some additional work to cope with another plugin seems not a good idea. I'm considering taking a snapshot of all the versions of 3rd party language-specifc plugins in each release and find a way to generate warning messages if the installed version is newer than the snapshot version.

nene commented 8 months ago

Well, on the good side, I'm not really expecting to be adding new dialects any time soon. Implementing full support for PostgreSQL and MySQL will likely be about a year's worth of effort.

nene commented 8 months ago

Though... one never knows. There are some SQL dialects that are very similar. Like in the case of MariaDB and MySQL, so including a support for such an additional dialect would be more likely on the table.

Sec-ant commented 8 months ago

Yeah, it's not a big problem and you're doing a great job, thanks!

Just a small update: I made some stupid mistakes in v0.4.0~v0.4.2, if you find yourself not being able to make prettier-plugin-embed work, please try v0.4.3.

And a bit of tangent: I really like the online playground you provide in the repo, I wonder if that is open sourced somewhere? Can you point me in the right direction? Oh, never mind, I just found it: https://github.com/nene/prettier-sql-playground