PabloRMira / sql_formatter

A Python based SQL formatter
https://pablormira.github.io/sql_formatter/
Apache License 2.0
43 stars 10 forks source link

Add formatting for MERGE statements #158

Open AHulshoff opened 3 years ago

AHulshoff commented 3 years ago

While testing my code with sql_formatter, I saw that the project lacks support for MERGE statements. Since many databases support MERGE, it would be great to get them formatted as well.

Currently, I am using sql_formatter to compare SQL statements stored in files with ones I am generating from metadata.

PabloRMira commented 3 years ago

Hi @AHulshoff , that's right, up to now sql_formatter only supports CTAS and SELECTs as described in the README

Could you please describe in detail how the formatting for MERGE statements should look like?

A couple of examples for it would also be helpful :-)

AHulshoff commented 3 years ago

Hi @PabloRMira, sorry for my late response. But a few good examples can be found at:

PabloRMira commented 3 years ago

Hi @AHulshoff , thanks for providing the examples!

Since I've never worked with MERGE statements and because of time contraints at the moment I have to admit that I will not be able to develop this feature in the short term.

But if you would like to develop it yourself feel free to contribute with a pull request. In that case please follow the instructions under Contributing to the code basis