All Projects → future-architect → Sublime-uroboroSQL-formatter

future-architect / Sublime-uroboroSQL-formatter

Licence: BSD-2-Clause license
Beautiful SQL Formatter for Sublime Text 3

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Sublime-uroboroSQL-formatter

Sublime-Pretty-Shell
🐚 Shell Script Formatter / Syntax Checker (Powered by shfmt)
Stars: ✭ 28 (+12%)
Mutual labels:  formatter, sublime-text-3, sublime-package, sublime-plugin
Golite
Add essential language support for the Go language to Sublime Text 3.
Stars: ✭ 14 (-44%)
Mutual labels:  formatter, formatting, sublime-text-3
sublime-live-server
🌍️ Launch a Development Server directly from Sublime Text
Stars: ✭ 49 (+96%)
Mutual labels:  sublime-text-3, sublime-package, sublime-plugin
laravel-formatters
«‎Formatter» pattern for Laravel
Stars: ✭ 86 (+244%)
Mutual labels:  formatter, formatting
awesome-python-code-formatters
A curated list of awesome Python code formatters
Stars: ✭ 168 (+572%)
Mutual labels:  formatter, formatting
Sublime Jekyll
A Sublime Text package for Jekyll static sites.
Stars: ✭ 160 (+540%)
Mutual labels:  sublime-text-3, sublime-package
Carbonsublime
🚀 A Sublime Text 3 Plugin for Carbon. (https://carbon.now.sh)
Stars: ✭ 104 (+316%)
Mutual labels:  sublime-text-3, sublime-package
AutoFormatInputWatcher
This repository contains input watcher for auto formatting digits in edit text
Stars: ✭ 15 (-40%)
Mutual labels:  formatter, formatting
unicode-formatter
Convert portions of text to fancy text using unicode fonts for use on Twitter and other sites that don't support rich text
Stars: ✭ 31 (+24%)
Mutual labels:  formatter, formatting
Nginx Config Formatter
nginx config file formatter/beautifier written in Python.
Stars: ✭ 222 (+788%)
Mutual labels:  formatter, formatting
formatting
源码格式自动化调整工具
Stars: ✭ 37 (+48%)
Mutual labels:  formatter, formatting
idea-uroborosql-formatter
Beautiful SQL Formatter for IntelliJ Platform
Stars: ✭ 18 (-28%)
Mutual labels:  formatter, formatting
Sublime Filterlines
Quickly find all lines matching a string or regular expression
Stars: ✭ 179 (+616%)
Mutual labels:  sublime-text-3, sublime-package
teks
Easily get custom go template based outputs to your command-line tool. Like in docker/kubernetes
Stars: ✭ 41 (+64%)
Mutual labels:  formatter, formatting
Juliaformatter.jl
An opinionated code formatter for Julia. Plot twist - the opinion is your own.
Stars: ✭ 217 (+768%)
Mutual labels:  formatter, formatting
ufmt
Safe, atomic formatting with black and µsort
Stars: ✭ 46 (+84%)
Mutual labels:  formatter, formatting
Vse Formatdocumentonsave
Visual Studio - Format Document on Save
Stars: ✭ 61 (+144%)
Mutual labels:  formatter, formatting
Hugofy Sublime
Hugo plugin for Sublime Text 3
Stars: ✭ 64 (+156%)
Mutual labels:  sublime-text-3, sublime-package
Pipenv Sublime
A Sublime Text 3 plugin for Pipenv projects!
Stars: ✭ 65 (+160%)
Mutual labels:  sublime-text-3, sublime-package
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-32%)
Mutual labels:  formatter, formatting

Sublime uroboroSQL Formatter

Package Control

Sublime uroboroSQL Formatter is often used in enterprise systems, For formatting to a highly maintainable style even for very long SQL (1 K step or more) It is a plug-in of Sublime Text 3.

In particular, in countries where English is not their mother tongue, such as Japan, comments may be included in SELECT clauses. In that case, we will align the vertical position of the AS clause and the comment, pursuing the viewability which can be said as artistic anymore, This was developed to realize this automatically.

for Japanese, Readme.ja.md

In case of general formatter

SELECT MI.MAKER_CD AS ITEM_MAKER_CD -- maker code
,
       MI.BRAND_CD AS ITEM_BRAND_CD -- brand code
,
       MI.ITEM_CD AS ITEM_CD -- item code
,
       MI.CATEGORY AS ITEM_CATEGORY -- item category
FROM M_ITEM MI -- item master

WHERE 1 = 1
  AND MI.ARRIVAL_DATE = '2016-12-01' -- arrival date

In case of Sublime uroboroSQL Formatter

SELECT
    MI.MAKER_CD AS  ITEM_MAKER_CD   -- maker code
,   MI.BRAND_CD AS  ITEM_BRAND_CD   -- brand code
,   MI.ITEM_CD  AS  ITEM_CD         -- item code
,   MI.CATEGORY AS  ITEM_CATEGORY   -- item category
FROM
    M_ITEM  MI  -- item master
WHERE
    1               =   1
AND MI.ARRIVAL_DATE =   '2016-12-01'    -- arrival date

Features

  • Formatting by aligning the vertical position of AS and operator in SELECT clause, WHERE clause
  • Even if there is a comment at the end of each line, the format

How to Use

  • Select "SQL Format" from the Edit menu
  • Select "SQL Format" from the context menu on the editor
  • Select "uroboroSQL Formatter: Format SQL" from the command Palette
  • ctrl + cmd + f on OS X, or ctrl + alt + f on Windows

Settings

{
    "uf_tab_size": 4,
    "uf_translate_tabs_to_spaces": true,
    "uf_case": "upper", // "upper" or "lower" or "capitalize" or "nochange"
    "uf_reserved_case": "upper", // "upper" or "lower" or "capitalize" or "nochange"
    "uf_reserved_words":"SELECT, FROM, WHERE, CREATE", // Put commas to separate reserved words
    "uf_comment_syntax": "uroboroSQL", // "uroboroSQL" or "doma2"
    "uf_escapesequence_u005c": false,
    "uf_save_on_format": true,
    "uf_save_on_format_extensions": [".sql"]
}
  • uf_tab_size
    • Specify the tab size of the indent after formatting. We recommend 4.
  • uf_translate_tabs_to_spaces
    • Specify whether the indent after formatting is tab or space. It becomes a space by setting it to true.
  • uf_case
    • If you want to convert all words to a specific case, set "upper", "lower", "capitalize". If the "nochange" option is selected, the word cases will not be changed from the original.
  • uf_reserved_case
    • If you want to convert reserved words to a specific case, set "upper", "lower" or "capitalize". If the "nochange" option is selected, it will not change the cases of resered words and they will be changed based on the "uf_case" setting.
  • uf_reserved_words
    • If you want to convert only reserved words to a specific case, please input reserved words sepalated by a comma. (The input is not case sensitive. So you can input reserved words in any case.)
  • uf_comment_syntax
    • It specifies the comment syntax format.
    • You can specify the "uroboroSQL" or "doma2".
      • In the case of normal SQL, you can specify either.
  • uf_escapesequence_u005c
    • If you have specified the escape sequence with a backslash in the SQL to specify the true.
  • uf_save_on_format
    • Specify true when formatting automatically when saving files.
  • uf_save_on_format_extensions
    • Specify the extension of the file to be formatted in a list.

License

python-sqlparse library and this code are both on 2-clauses BSD


Copyright 2018 by Future Architect.

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].