Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/cavo789/sql_formatter

Very straight-forward script for formatting SQL statement.
https://github.com/cavo789/sql_formatter

php sql sql-formatter

Last synced: about 1 month ago
JSON representation

Very straight-forward script for formatting SQL statement.

Awesome Lists containing this project

README

        

# SQL Formatter

![php 8.2](https://img.shields.io/badge/php-8.2-brightgreen?style=flat)

![Banner](./banner.svg)

Very straight-forward script for formatting SQL statement.

Format string like, f.i.,

```sql
SELECT LAT_N, CITY, TEMP_F FROM STATS, STATION WHERE MONTH = 7 AND STATS.ID = STATION.ID ORDER BY TEMP_F
```

into

```sql
SELECT
LAT_N,
CITY,
TEMP_F
FROM
STATS,
STATION
WHERE
MONTH = 7
AND STATS.ID = STATION.ID
ORDER BY
TEMP_F
```

## How to use

Just copy/paste your SQL statement into the text box as illustrated here below and click on the `Format` button.

![sql_formatter](images/demo.gif)

## Source

The `SqlFormatter` has been written by `Jeremy Dorn` and available on GitHub: https://github.com/jdorn/sql-formatter.