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

Support DELIMITER for MariaDB and MySQL

Open gpetrounrt opened this issue 2 years ago • 1 comments

This is my initial attempt to address https://github.com/inferrinizzard/prettier-sql/issues/72. I am not sure if this is the right approach to fix the issue. There are also a couple of pending issues, one with spaces before END in MariaDB and the other with missing new line before BEGIN in MySQL.

gpetrounrt avatar Mar 24 '22 09:03 gpetrounrt

I've thought about how an implementation for dynamic token input would work and I don't have an efficient solution yet since the RegEx for each language is baked and compiled into one hard-coded string, ie. the delimiter for all languages is always ';'.

Allowing users to dynamically regenerate this entire RegEx with custom delimiters/tokens would definitely be possible but will tank the processing time.

May implement this as an experimental feature once I am back from hiatus / as a part of 5.2.x release. Thank you for your help on the project! Feel free to share your thoughts on how best to implement this feature :)

inferrinizzard avatar Mar 30 '22 16:03 inferrinizzard