All Projects → mrdziuban → sql-formatter

mrdziuban / sql-formatter

Licence: other
Polyglot SQL formatter

Programming Languages

javascript
184084 projects - #8 most used programming language
purescript
368 projects
elm
856 projects
rust
11053 projects
PHP
23972 projects - #3 most used programming language
dart
5743 projects

Projects that are alternatives of or similar to sql-formatter

Nginx Config Formatter
nginx config file formatter/beautifier written in Python.
Stars: ✭ 222 (+692.86%)
Mutual labels:  formatter
Mbeautifier
MBeautifier is a MATLAB source code formatter, beautifier. It can be used directly in the MATLAB Editor and it is configurable.
Stars: ✭ 248 (+785.71%)
Mutual labels:  formatter
node-lintspaces
A validator for checking different kinds of whitespaces in your files.
Stars: ✭ 31 (+10.71%)
Mutual labels:  whitespace
Stringformatter
Simple Text Formetter (Credit Card Number, Phone Number, Serial Number etc.) Can be used in all text inputs according to the format pattern. If desired, large minor character restrictions can be made in the format pattern.
Stars: ✭ 231 (+725%)
Mutual labels:  formatter
Luaformatter
Code formatter for Lua
Stars: ✭ 244 (+771.43%)
Mutual labels:  formatter
Sublime-uroboroSQL-formatter
Beautiful SQL Formatter for Sublime Text 3
Stars: ✭ 25 (-10.71%)
Mutual labels:  formatter
Juliaformatter.jl
An opinionated code formatter for Julia. Plot twist - the opinion is your own.
Stars: ✭ 217 (+675%)
Mutual labels:  formatter
palantir-java-format
A modern, lambda-friendly, 120 character Java formatter.
Stars: ✭ 203 (+625%)
Mutual labels:  formatter
Formatting
Type-safe, functional string formatting in Swift.
Stars: ✭ 248 (+785.71%)
Mutual labels:  formatter
blackbricks
Black for Databricks notebooks
Stars: ✭ 40 (+42.86%)
Mutual labels:  formatter
Webpack Messages
Beautifully format Webpack messages throughout your bundle lifecycle(s)!
Stars: ✭ 238 (+750%)
Mutual labels:  formatter
Typescript Express Starter
🚀 TypeScript Express Starter
Stars: ✭ 238 (+750%)
Mutual labels:  formatter
react-signature-canvas
A React wrapper component around signature_pad (in < 150 LoC). Unopinionated and heavily updated fork of react-signature-pad
Stars: ✭ 420 (+1400%)
Mutual labels:  whitespace
Prettier Plugin Csharp
Prettier C# Plugin
Stars: ✭ 224 (+700%)
Mutual labels:  formatter
fixjson
JSON Fixer for Humans using (relaxed) JSON5
Stars: ✭ 96 (+242.86%)
Mutual labels:  formatter
Pp sql
Rails ActiveRecord SQL queries log beautifier
Stars: ✭ 223 (+696.43%)
Mutual labels:  formatter
Best Of Python Dev
🏆 A ranked list of awesome python developer tools and libraries. Updated weekly.
Stars: ✭ 243 (+767.86%)
Mutual labels:  formatter
lit-date
Light-weight, faster datetime formatter for modern browsers.
Stars: ✭ 33 (+17.86%)
Mutual labels:  formatter
TypeNameFormatter
A small .NET library for formatting type names à la C#.
Stars: ✭ 26 (-7.14%)
Mutual labels:  formatter
idea-uroborosql-formatter
Beautiful SQL Formatter for IntelliJ Platform
Stars: ✭ 18 (-35.71%)
Mutual labels:  formatter

SQL Formatter

Build Status

This is a simple SQL formatter that handles formatting whitespace and capitalization of keywords. I originally wrote it for the purpose of learning Elm, but it soon became a project where I could try out languages that I'm unfamiliar with and see how many different languages can be compiled down to JavaScript. Most of the languages used, plus a lot of others, can be found here.

The app logic in each language is compiled to JavaScript using various Webpack loaders, some of which I implemented as wrappers around shell commands. The current languages are:

Check it out at http://mattdziuban.com/sql-formatter/.

demo

Setup

Install npm dependencies first with npm install, then follow the steps for each language below.

Dart

Find the correct Dart SDK URL for the desired version and OS here, then run the following:

mkdir -p "$HOME/.dart"
curl -L <dart-sdk-url> -o "$HOME/.dart/dart.zip"
unzip -q "$HOME/.dart/dart.zip" -d "$HOME/.dart"
export PATH="$HOME/.dart/dart-sdk/bin:$PATH"
pub get

ElixirScript

First, install Erlang and Elixir. On Mac, you can install Erlang with brew install erlang. To install Elixir, I recommend using Kiex.

Then install ElixirScript:

export EXS_VERSION=56cb2c5
mkdir -p "$HOME/.elixirscript/$EXS_VERSION"
curl -o- -L https://s3.amazonaws.com/mrdziuban-resources/elixirscript-$EXS_VERSION.tar.gz -o "$HOME/.elixirscript/elixirscript-$EXS_VERSION.tar.gz" | tar xvzf - -C "$HOME/.elixirscript/$EXS_VERSION"
export PATH="$HOME/.elixirscript/$EXS_VERSION/dist/elixirscript/bin:$PATH"

Elm

Install Elm packages:

$(npm bin)/elm-package install

ES6

The ES6 build doesn't require any additional dependencies!

Fable

Install F#. On Mac, you can run brew install mono. On Linux, check out the docs.

GopherJS

First, install Go 1.8, then run:

go get -u github.com/gopherjs/gopherjs

Opal

First, install Ruby if you don't already have it. I recommend using RVM. Then run:

bundle install

PHP

Install PHP (any version 5.3-5.6 should work fine), then install PHPUnit:

mkdir -p "$HOME/.phpunit/bin"
curl -sL https://phar.phpunit.de/phpunit-4.8.phar -o "$HOME/.phpunit/bin/phpunit"
chmod +x "$HOME/.phpunit/bin/phpunit"
export PATH="$HOME/.phpunit/bin:$PATH"

PureScript

Install psc-package and install dependencies:

export PSC_PACKAGE_VERSION=0.2.5
mkdir -p "$HOME/.psc-package/$PSC_PACKAGE_VERSION"
# Replace macos with linux64 if necessary
curl -o- -sL https://github.com/purescript/psc-package/releases/download/v$PSC_PACKAGE_VERSION/macos.tar.gz | tar xzf - -C "$HOME/.psc-package/$PSC_PACKAGE_VERSION" --strip-components 1
export PATH="$HOME/.psc-package/$PSC_PACKAGE_VERSION:$PATH"
psc-package update

Rust

Rust has the most experimental compilation process, using support for WebAssembly via nightly builds. Run the following:

# Install Rust
curl -L https://sh.rustup.rs | sh -s -- -y --default-toolchain=nightly
source ~/.cargo/env
rustup target add wasm32-unknown-unknown
cargo install cargo-web

Scala.js

Run the following to setup SBT:

export SBT_VERSION=0.13.15
mkdir -p "$HOME/.sbt-bin/$SBT_VERSION"
curl -o- -L https://dl.bintray.com/sbt/native-packages/sbt/$SBT_VERSION/sbt-$SBT_VERSION.tgz | tar xvzf - -C "$HOME/.sbt-bin/$SBT_VERSION" --strip-components 1
export PATH="$HOME/.sbt-bin/$SBT_VERSION/bin:$PATH"

Development

Compile

Compile all code to JavaScript:

npm run compile

Compile certain languages

The compile command accepts comma-separated only and exclude arguments to filter what languages are compiled, e.g.

# Only compile ES6 and Opal
npm run compile -- --env.only es6,opal

# Compile everything but GopherJS and Dart
npm run compile -- --env.exclude gopherjs,dart

Run

Run the Webpack dev server:

npm run dev

Note: The dev command also accepts the only and exclude arguments mentioned above

Then visit http://localhost:8000 in your browser.

Test

Tests are run using a variety tools to match the different languages. To run them:

npm run test

Build for production

npm run dist

Note: The dist command also accepts the only and exclude arguments mentioned above

Deployment

Deployment to GitHub pages is scripted.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].