/sqlfmt

A naive Go library that provides SQL formatting capabilities by using the sql-formatter JavaScript library through go-quickjs

Primary LanguageGoMIT LicenseMIT

sqlfmt

A naive Go library that provides SQL formatting capabilities by using the sql-formatter JavaScript library through go-quickjs.

Installation

To use sqlfmt in your Go project, you can simply import it:

import "github.com/0x6b/sqlfmt"

Then, run go mod tidy to download the dependencies.

Usage

The sqlfmt package exposes a FormatSQL function and a DefaultFormatOptions variable. You can use DefaultFormatOptions and override specific fields as needed. See example for usage.

Acknowledgements

The assets directory contains sql-formatter.min.js (version 15.6.6), which is an artifact from the sql-formatter project.

License

MIT. See LICENSE for details.