Project

pretty_sql

0.0
No commit activity in last 3 years
No release in over 3 years
Uses pygmentize and anbt-sql-formatter to auto-indent and colorize SQL
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

pretty_sql

SQL formatting and syntax highlighting, for debugging.

Note

If you want syntax highlighing, install the python package pygments: http://pygments.org/docs/cmdline/ and ensure that it's in your PATH.

Warning!

This was not intended for anything other than debugging. It is likely INSECURE to use this for any other purpose.

Sample usage:

In this example we're monkeypaching String to add a to_prety_sql method.

require 'pretty_sql'

class String

  include PrettySql

  def to_pretty_sql
    prettify_sql(self.dup)
  end
end

puts 'SELECT * FROM poop'.to_pretty_sql