prettier-plugin-sql-cst icon indicating copy to clipboard operation
prettier-plugin-sql-cst copied to clipboard

Export type that lists names of supported parsers

Open nene opened this issue 1 year ago • 4 comments

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

nene avatar Jan 08 '24 11:01 nene

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.

Sec-ant avatar Jan 08 '24 16:01 Sec-ant

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 avatar Jan 08 '24 17:01 nene

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.

nene avatar Jan 08 '24 17:01 nene

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

Sec-ant avatar Jan 09 '24 05:01 Sec-ant