SQL pretty pritner?

Started by stanover 6 years ago13 messagesgeneral
Jump to latest
#1stan
stanb@panix.com

I have a presentation later in the week, and i plan on printing out some
files containing SQL commands. I have used some "pretty printers" in the
past for things like Perl scripts. What I am thinking of s something that
bolds keywords, handles page breaks, and does some formatting.

Development being done in an Ubuntu Linux environment.

Anyone have a recommendation?

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

#2Adrian Klaver
adrian.klaver@aklaver.com
In reply to: stan (#1)
Re: SQL pretty pritner?

On 10/27/19 3:21 PM, stan wrote:

I have a presentation later in the week, and i plan on printing out some
files containing SQL commands. I have used some "pretty printers" in the
past for things like Perl scripts. What I am thinking of s something that
bolds keywords, handles page breaks, and does some formatting.

Development being done in an Ubuntu Linux environment.

Anyone have a recommendation?

http://sqlformat.darold.net/

https://sourceforge.net/projects/pgformatter/

--
Adrian Klaver
adrian.klaver@aklaver.com

#3Basques, Bob (CI-StPaul)
bob.basques@ci.stpaul.mn.us
In reply to: stan (#1)
Re: SQL pretty pritner?

All,

Take a look at the VI(m) editor. There is a Syntax mode for highlighting different file types, as well as tools for exporting the highlighted text to HTML. I have yet to find a file type that it doesn’t already handle.

Works really slick.

bobb

Show quoted text

On Oct 27, 2019, at 5:21 PM, stan <stanb@panix.com> wrote:

Think Before You Click: This email originated outside our organization.

I have a presentation later in the week, and i plan on printing out some
files containing SQL commands. I have used some "pretty printers" in the
past for things like Perl scripts. What I am thinking of s something that
bolds keywords, handles page breaks, and does some formatting.

Development being done in an Ubuntu Linux environment.

Anyone have a recommendation?

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

#4Rob Sargent
robjsargent@gmail.com
In reply to: Basques, Bob (CI-StPaul) (#3)
Re: SQL pretty pritner?

On Oct 28, 2019, at 7:00 AM, Basques, Bob (CI-StPaul) <bob.basques@ci.stpaul.mn.us> wrote:

All,

Take a look at the VI(m) editor. There is a Syntax mode for highlighting different file types, as well as tools for exporting the highlighted text to HTML. I have yet to find a file type that it doesn’t already handle.

Works really slick.

bobb

Well if you’re going to go there, emacs will hilite and execute your sql.

Show quoted text

On Oct 27, 2019, at 5:21 PM, stan

#5Ron
ronljohnsonjr@gmail.com
In reply to: Basques, Bob (CI-StPaul) (#3)
Re: SQL pretty pritner?

But does it reformat the text?

On 10/28/19 8:00 AM, Basques, Bob (CI-StPaul) wrote:

All,

Take a look at the VI(m) editor. There is a Syntax mode for highlighting different file types, as well as tools for exporting the highlighted text to HTML. I have yet to find a file type that it doesn’t already handle.

Works really slick.

bobb

On Oct 27, 2019, at 5:21 PM, stan <stanb@panix.com> wrote:

Think Before You Click: This email originated outside our organization.

I have a presentation later in the week, and i plan on printing out some
files containing SQL commands. I have used some "pretty printers" in the
past for things like Perl scripts. What I am thinking of s something that
bolds keywords, handles page breaks, and does some formatting.

Development being done in an Ubuntu Linux environment.

Anyone have a recommendation?

--
Angular momentum makes the world go 'round.

#6Rob Sargent
robjsargent@gmail.com
In reply to: Ron (#5)
Re: SQL pretty pritner?

On Oct 28, 2019, at 7:37 AM, Ron <ronljohnsonjr@gmail.com> wrote:

But does it reformat the text?

It’s an “indented text mode” so beeline respect current indentation. I don’t think it will take an stream out sql and add newlines at predictable places. Not at My desk to try.

Show quoted text

On 10/28/19 8:00 AM, Basques, Bob (CI-StPaul) wrote:
All,

Take a look at the VI(m) editor. There is a Syntax mode for highlighting different file types, as well as tools for exporting the highlighted text to HTML. I have yet to find a file type that it doesn’t already handle.

Works really slick.

bobb

On Oct 27, 2019, at 5:21 PM, stan <stanb@panix.com> wrote:

Think Before You Click: This email originated outside our organization.

I have a presentation later in the week, and i plan on printing out some
files containing SQL commands. I have used some "pretty printers" in the
past for things like Perl scripts. What I am thinking of s something that
bolds keywords, handles page breaks, and does some formatting.

Development being done in an Ubuntu Linux environment.

Anyone have a recommendation?

--
Angular momentum makes the world go 'round.

#7Thomas Boussekey
thomas.boussekey@gmail.com
In reply to: Ron (#5)
Re: SQL pretty pritner?

Hello all,

I use this github project in order to highlight SQL code on my slides:
https://romannurik.github.io/SlidesCodeHighlighter/

It doesn't highlight 100% of Postgres SQL code, but it's a correct basis!

Hope this helps,
Thomas

Le lun. 28 oct. 2019 à 14:37, Ron <ronljohnsonjr@gmail.com> a écrit :

Show quoted text

But does it reformat the text?

On 10/28/19 8:00 AM, Basques, Bob (CI-StPaul) wrote:

All,

Take a look at the VI(m) editor. There is a Syntax mode for

highlighting different file types, as well as tools for exporting the
highlighted text to HTML. I have yet to find a file type that it doesn’t
already handle.

Works really slick.

bobb

On Oct 27, 2019, at 5:21 PM, stan <stanb@panix.com> wrote:

Think Before You Click: This email originated outside our organization.

I have a presentation later in the week, and i plan on printing out some
files containing SQL commands. I have used some "pretty printers" in the
past for things like Perl scripts. What I am thinking of s something

that

bolds keywords, handles page breaks, and does some formatting.

Development being done in an Ubuntu Linux environment.

Anyone have a recommendation?

--
Angular momentum makes the world go 'round.

#8Basques, Bob (CI-StPaul)
bob.basques@ci.stpaul.mn.us
In reply to: Rob Sargent (#4)
Re: SQL pretty pritner?

As far using VIM (vs EMACS):

https://en.wikipedia.org/wiki/Editor_war

:c)

bobb

On Oct 28, 2019, at 8:33 AM, Rob Sargent <robjsargent@gmail.com<mailto:robjsargent@gmail.com>> wrote:

Think Before You Click: This email originated outside our organization.

On Oct 28, 2019, at 7:00 AM, Basques, Bob (CI-StPaul) <bob.basques@ci.stpaul.mn.us<mailto:bob.basques@ci.stpaul.mn.us>> wrote:

All,

Take a look at the VI(m) editor. There is a Syntax mode for highlighting different file types, as well as tools for exporting the highlighted text to HTML. I have yet to find a file type that it doesn’t already handle.

Works really slick.

bobb

Well if you’re going to go there, emacs will hilite and execute your sql.

On Oct 27, 2019, at 5:21 PM, stan

#9Basques, Bob (CI-StPaul)
bob.basques@ci.stpaul.mn.us
In reply to: Rob Sargent (#6)
Re: SQL pretty pritner?

All,

VI has a lot of option ( that I haven’t tried) and I would bet that there are options for formatting and page breaks, etc. It’s a bit of a learning curve though.

bobb

Show quoted text

On Oct 28, 2019, at 8:44 AM, Rob Sargent <robjsargent@gmail.com> wrote:

Think Before You Click: This email originated outside our organization.

On Oct 28, 2019, at 7:37 AM, Ron <ronljohnsonjr@gmail.com> wrote:

But does it reformat the text?

It’s an “indented text mode” so beeline respect current indentation. I don’t think it will take an stream out sql and add newlines at predictable places. Not at My desk to try.

On 10/28/19 8:00 AM, Basques, Bob (CI-StPaul) wrote:
All,

Take a look at the VI(m) editor. There is a Syntax mode for highlighting different file types, as well as tools for exporting the highlighted text to HTML. I have yet to find a file type that it doesn’t already handle.

Works really slick.

bobb

On Oct 27, 2019, at 5:21 PM, stan <stanb@panix.com> wrote:

Think Before You Click: This email originated outside our organization.

I have a presentation later in the week, and i plan on printing out some
files containing SQL commands. I have used some "pretty printers" in the
past for things like Perl scripts. What I am thinking of s something that
bolds keywords, handles page breaks, and does some formatting.

Development being done in an Ubuntu Linux environment.

Anyone have a recommendation?

--
Angular momentum makes the world go 'round.

#10Kevin Brannen
KBrannen@efji.com
In reply to: Adrian Klaver (#2)
RE: SQL pretty pritner?

From: Adrian Klaver <adrian.klaver@aklaver.com>
On 10/27/19 3:21 PM, stan wrote:

I have a presentation later in the week, and i plan on printing out
some files containing SQL commands. I have used some "pretty printers"
in the past for things like Perl scripts. What I am thinking of s
something that bolds keywords, handles page breaks, and does some formatting.

http://sqlformat.darold.net/

https://sourceforge.net/projects/pgformatter/

If I had that task, I'd use a combo of tools. "pgFormatter" that Adrian shows
above is what you use to reformat to make it aligned nicely, plus it does some
colorization. The first link is the online tool; the 2nd link is if you want
to download the code to your own server.

Example:
select count(*) from tablea where x is null;
Result:
SELECT
count(*)
FROM
tablea
WHERE
x IS NULL;

You can't see it here, but all the keywords are bold and colored, and "count" is
colored but not bolded.

If that colorization isn't good enough for you, then as others have said,
paste the result into "vim" to get the colorization, pasting that into
PowerPoint/Word or something that honors the colors...or just take a screen
shot of that...or whatever works for you.

HTH,
Kevin
This e-mail transmission, and any documents, files or previous e-mail messages attached to it, may contain confidential information. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are hereby notified that any disclosure, distribution, review, copy or use of any of the information contained in or attached to this message is STRICTLY PROHIBITED. If you have received this transmission in error, please immediately notify us by reply e-mail, and destroy the original transmission and its attachments without reading them or saving them to disk. Thank you.

#12DiasCosta
diascosta@diascosta.org
In reply to: Reid Thompson (#11)
Re: SQL pretty pritner?

Hello,

For some formatting I use PSPad.exe (https://www.pspad.com/)
It has, at least, some of the features you are looking for.
It is free and has the possibility to format SQL and other languages.

Dias Costa

On 28-10-2019 17:06, Reid Thompson wrote:

On Sun, 2019-10-27 at 16:54 -0700, Adrian Klaver wrote:

https://urldefense.proofpoint.com/v2/url?u=https-3A__sourceforge.net_projects_pgformatter_&amp;d=DwICaQ&amp;c=w8fEmIi-B5lsC0MnOiGTloUx5YmN70-3jVCmqqbXNxM&amp;r=4r1gVE34nFB7YgioINuzq1cdGrlIBszDh26sKYP7ux8&amp;m=9zYVbOR6UMXoTr5abTczqiDnMEYJ1mNU7uePMEtYLJ8&amp;s=7jw7I_b0hNpBHZAfA2NLtvgbWepTlS5zqSGEt6xq9IA&amp;e=

this ^^^^^^^

--
J. M. Dias Costa
Telef. 214026948

Se divulgar esta mensagem por terceiros, por favor:
1. Apague o meu endereço de correio electrónico e o meu nome.
2. Apague também os endereços dos seus amigos antes de distribuir.
3. Enderece como cópia oculta (Cc ou Bcc) para os SEUS destinatários.
Agindo deste modo, dificultará a disseminação de "vírus", "spams" e
"banners" e contribuirá para manter a privacidade de todos e cada um.
Obrigado.

Nota: Não se deverá ao acaso a ocorrência de palavras na minha escrita que não respeitem o
malfadado acordo ortográfico.

#13Thiemo Kellner
thiemo@gelassene-pferde.biz
In reply to: stan (#1)
Re: SQL pretty pritner?

https://www.sqlinform.com/

Quoting stan <stanb@panix.com>:

I have a presentation later in the week, and i plan on printing out some
files containing SQL commands. I have used some "pretty printers" in the
past for things like Perl scripts. What I am thinking of s something that
bolds keywords, handles page breaks, and does some formatting.

Development being done in an Ubuntu Linux environment.

Anyone have a recommendation?

--
"They that would give up essential liberty for temporary safety deserve
neither liberty nor safety."
-- Benjamin Franklin

--
S/MIME Public Key: https://oc.gelassene-pferde.biz/index.php/s/eJuAUFONag6ofnH
Signal (Safer than WhatsApp): +49 1578 7723737
Handys: +41 78 947 36 21 | +49 1578 772 37 37
Tox-Id:
B7282A9E31D944DDAD1ECC5B33C36AAE80B32D119AB7391D602C937A65E8CA0625C495C5322B