Sublime Forum

SQL Formatting Plugin

#1

Hi,

I’ve written a plugin that formats long SQL statement to a more readable form by using python-sqlparse library.

You may install via Package Control, or find manual setup instructions and examples here: github.com/freewizard/SublimeFormatSQL

0 Likes

#2

Hi,

I just installed this plugin, but i can’t make it work. When i select my SQL statement in a PHP file and click menu “Selection”, i don’t see any menu called “Format”. I’m running Ubuntu 11.10 32bit.

Thank you for creating an awesome plugin like this :smile:

Thank you in advance
Adam

0 Likes

#3

[quote=“theadamlt”]Hi,

I just installed this plugin, but i can’t make it work. When i select my SQL statement in a PHP file and click menu “Selection”, i don’t see any menu called “Format”. I’m running Ubuntu 11.10 32bit.

Thank you for creating an awesome plugin like this :smile:

Thank you in advance
Adam[/quote]

Hi,
I tested it with a fresh installed latest dev build (b2160) on my Mac and works ok.

As a troubleshooting step, could you open console and see if the plugin get loaded like this without any error:

Reloading plugin /Users/xxxx/Library/Application Support/Sublime Text 2/Packages/Format SQL/FormatSQL.py

Also if it did load, can you check if the key bind config mentioned in the web site works?

0 Likes

#4

Hello. Thanks for the plugin.

Of note, this seems to have problems whenever brackets are present. I had to remove all of my brackets from the sql for it to work.

0 Likes

#5

This is a great plugin!

Anyone know if it’s possible to get comma first formatting with this?

select joe
, bob
, sue

I’ve tinkered with the settings but so far no luck.

Thanks for great plugin, it’s a huge timesaver!

Jim

0 Likes

#6

Hi,

Am trying to install Format SQL in Sublime Text 3 but Format SQL is not getting listed in Install Package.

Thanks in advance

0 Likes

#7

Hello, I found a way to add this to Sublime Text 3, and it appears to be working well.

With package manger installed, you can add a repository. Command is Package Contrl: Add repository

You will want to add github.com/freewizard/SublimeFormatSQL

And then you can install the sublimeformatsql package.

For a detailed walkthrough of adding a repository, see macdrifter.com/2012/08/insta … ithub.html

Hope that helps.

0 Likes