Skip to content

This repository has the purpose to become a beautiful SurrealQL Formatter, shaped like a beautiful surql ⏣, always consistent like π.

Notifications You must be signed in to change notification settings

DariusCorvus/surreal-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SurrealQL Formatter

This repository has the purpose to become a beautiful SurrealQL Formatter, shaped like a beautiful surql ⏣, always consistent like π.

Why?

I never got satisfied by formatters for SQL, and never thought about writing my own to meet my wishes.

  • SurrealDB blowed a new wind into my direction and inspired me to give the community something back, for the gift of this stunning database.
  • I don't like it to think about formatting, i want to save my file and see the magic of a formatter coming to live.
  • Also the results for INFO FOR TABLE <table> are strings without formatting, to give my eyes a chill, a good formatter is needed.

Installation

Warning Never install from a source you don't trust.

git clone https://www.github.com/DariusCorvus/surreal-formatter.git
cd surreal-formatter
pip install .

Usage

To use the formatter, you can pipe the content you want to beautify into the programm surreal-formatter or pass the file name as an argument.

To get a overview over the programm, just run:

$ surreal-formatter --help
Usage: surreal-formatter [OPTIONS] [INPUT] [OUTPUT]

Options:
  --tabsize INTEGER
  --help             Show this message and exit.

The default in and output of surreal-formatter are stdin and stdout to give us the pipe functionality

$ echo 'SELECT * FROM user;' | surreal-formatter --tabsize 2
SELECT
     *
  FROM user
;

Contribute

Feel free to contribute and open a issue or pull request.

Development

The whole project builds on the amazing python package sly

to make it a cli, click is used, another amazing python package

About

This repository has the purpose to become a beautiful SurrealQL Formatter, shaped like a beautiful surql ⏣, always consistent like π.

Topics

Resources

Stars

Watchers

Forks

Languages