[![Crates.io](https://img.shields.io/crates/v/poppy-sql.svg)](https://crates.io/crates/poppy-sql)

## Poppy-sql
Parser and formatter for standalone and embedded SQL

### Dialect support
Explicit support for PostgreSQL, MySQL and SQlite dialects.

Generic SQL dialect supported.

### What is this for?
I like to use raw SQL queries, but maintaining consistent formatting for embedded SQL queries can be quite a pain.

This project aims to format SQL queries embedded in a variety of filetypes.

It does this by parsing strings in files and formatting them if they're valid SQL queries.

### How to use?
Poppy-sql is available to install through cargo using: `cargo install poppy-sql`

Run `poppy-sql` in a directory with the files you want formatted in it or `poppy-sql --file '{target_file}'` to format a specific file.

Poppy-sql is also available as a library for your rust projects.

### What file types are supported?
At the moment, `.sql` files and `.py` files.

Other file types will be ignored if poppy-sql is run in the containing folder, or print an error message if specifically targeted.
