Re: [pgadmin-support] Format SQL (external tool)

From: Shane StClair <shane(at)axiomalaska(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org, jinfroster(at)mail(dot)ru
Subject: Re: [pgadmin-support] Format SQL (external tool)
Date: 2014-02-04 21:59:55
Message-ID: CAPyomk5NT9Tm-r3wombLzoY60Vqa+QyRDy4u84_2K9UWLbWHTg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers pgadmin-support

Thanks J.F. I was thinking that being able to pipe the SQL through an
external tool would increase flexibility for users. Everyone likes their
SQL a certain way (look at the options on http://poorsql.com/ for
instance). Options like these could be built into pgadmin but that seems
like a lot of work.

Devs, I noticed some mentions of a built-in SQL formatter on this list from
2007. Does that functionality still exist? I can't seem to find it.

Thank you,
Shane

On Tue, Feb 4, 2014 at 1:56 PM, Shane StClair <shane(at)axiomalaska(dot)com> wrote:

> [Moved to pgadmin-hackers]
>
> Original message:
>
> Saturday, February 1, 2014, 2:17:20 AM, you wrote:
> Hi list,
>
>
> Just suggesting an idea. It would be really nice to be able
> to configure an external command to format SQL in pgAdmin. After
> configuring the external tool path in prefs, user hits a key combo
> (Shift-Ctrl F?) and the highlighted query text (or all text if
> none highlighted) gets run through the formatter and replaces the
> original text in the query window. Would be flexible for the user
> and seems fairly simple to implement in pgAdmin. Just a thought!
>
>
> One response from J.F.:
>
> From: J.F. Oster <jinfroster(at)mail(dot)ru>
> Date: Sat, Feb 1, 2014 at 10:06 AM
> Subject: Re: [pgadmin-support] Format SQL (external tool)
> To: Shane StClair <shane(at)axiomalaska(dot)com>
> Cc: pgadmin-support(at)postgresql(dot)org
>
>
>
> Hello Shane,
>
> I'd like to see some code beautifier in PgAdmin too.
> Do you already have an eye to a CLI tool for this job?
>
> I saw Free SQL Formatter (http://fsqlf.sourceforge.net/) under LGPL,
> which seems ok. May be, we can adopt it as a built-in default
> formatter (hope it will compile under MacOS, Solaris and FreeBSD).
> If things go well, it can be developed to support Postgre's SQL
> extensions and PL/pgSQL constructs as well.
>
> In short, seems a good idea to me, I could participate in it's
> implementation :)
>
> P.S. Should this be posted to [pgadmin-hackers]?
>
> --
> Best regards,
> J.F.
>
>

--
Shane StClair
Software Engineer
Axiom Consulting & Design
http://www.axiomalaska.com

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Akshay Joshi 2014-02-05 07:42:05 Re: Fixed some compiler warnings
Previous Message Shane StClair 2014-02-04 21:56:44 Fwd: [pgadmin-support] Format SQL (external tool)

Browse pgadmin-support by date

  From Date Subject
Next Message Jayadevan M 2014-02-05 02:56:24 ssh tunnelling via non-standard port
Previous Message Shane StClair 2014-02-04 21:56:44 Fwd: [pgadmin-support] Format SQL (external tool)