<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7638.1">
<TITLE>Re: [Vtigercrm-developers] Postgres Integration in 4.2.5</TITLE>
</HEAD>
<BODY>
<DIV id=idOWAReplyText93445 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Is this something the
code=beautifier can take care of for us? If so, my vote is whatever that
does.</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
vtigercrm-developers-bounces@lists.vtigercrm.com on behalf of Allan
Bush<BR><B>Sent:</B> Tue 3/14/2006 11:01 AM<BR><B>To:</B>
vtigercrm-developers@lists.vtigercrm.com<BR><B>Subject:</B> Re:
[Vtigercrm-developers] Postgres Integration in 4.2.5<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>I usually write queries in a slightly more compact
format:<BR><BR>$query = "SELECT <select
list><BR>
FROM
<table1><BR>
INNER JOIN
<table2><BR>
ON
<clause><BR>
WHERE
<clause1><BR>
AND
<clause2><BR>
GROUP BY
<clause><BR>
ORDER BY <order>";<BR><BR>The uppercase SQL commands and lower case
tables/columns is definitely<BR>a must though. Also for short queries I
find putting everything in<BR>one line to be reasonable, as a rule of thumb if
the query doesn't<BR>wrap in an 80 character wide terminal I usually put it in
one line.<BR><BR>On 3/14/06, Jeff Kowalczyk <jtk@yahoo.com> wrote:<BR>>
Sergio A. Kessler wrote:<BR>> > I always write queries like this:<BR>>
><BR>> > $query = <<<END<BR>> >
select<BR>> > *<BR>>
> from<BR>>
> table1,<BR>>
> table2,<BR>>
> where<BR>>
> foo = ?<BR>>
> and<BR>>
> zeta = ?<BR>>
> group by<BR>>
> tita<BR>>
> order by<BR>>
> zeta<BR>> >
END;<BR>><BR>> I usually don't go the extra mile to indent, but your way
is the clearest<BR>> and most diff-friendly, by far.<BR>><BR>> I do
like to capitalize SQL keywords though, could we agree on adding that<BR>> to
the style standard?<BR>><BR>> $query =
<<<END<BR>>
SELECT<BR>>
*<BR>>
FROM<BR>>
table1,<BR>>
table2,<BR>>
WHERE<BR>> foo =
?<BR>>
AND<BR>> zeta =
?<BR>> GROUP
BY<BR>>
tita<BR>> ORDER
BY<BR>>
zeta<BR>> END;<BR>><BR>> +1 on reformatting SQL queries according
to a strict style standard.<BR>><BR>> Once consensus is reached on a
style, a trac ticket should be created, and<BR>> each reformat-only commit
should include 'refs #XX' in the checkin<BR>> message<BR>><BR>>
_______________________________________________<BR>> This vtiger.com email is
sponsored by Zoho Planner. Still scribbling down your To-Do's on bits of paper
& palms of your hands? Try the AJAX enabled, personal organizer online, Zoho
Planner for FREE instead! <A
href="http://zohoplanner.com/?vt">http://zohoplanner.com/?vt</A><BR>><BR><BR>_______________________________________________<BR>This
vtiger.com email is sponsored by Zoho Planner. Still scribbling down your
To-Do's on bits of paper & palms of your hands? Try the AJAX enabled,
personal organizer online, Zoho Planner for FREE instead! <A
href="http://zohoplanner.com/?vt">http://zohoplanner.com/?vt</A><BR><BR><BR></FONT></P></DIV>
</BODY>
</HTML>