[Vtigercrm-developers] Postgres Integration in 4.2.5

Joel Rydbeck Joel.Rydbeck at nubrek.com
Tue Mar 14 09:45:48 PST 2006


Is this something the code=beautifier can take care of for us?  If so, my vote is whatever that does.

________________________________

From: vtigercrm-developers-bounces at lists.vtigercrm.com on behalf of Allan Bush
Sent: Tue 3/14/2006 11:01 AM
To: vtigercrm-developers at lists.vtigercrm.com
Subject: Re: [Vtigercrm-developers] Postgres Integration in 4.2.5



I usually write queries in a slightly more compact format:

$query = "SELECT <select list>
                 FROM <table1>
                           INNER JOIN <table2>
                                     ON <clause>
                 WHERE <clause1>
                           AND <clause2>
                 GROUP BY <clause>
                 ORDER BY <order>";

The uppercase SQL commands and lower case tables/columns is definitely
a must though.  Also for short queries I find putting everything in
one line to be reasonable, as a rule of thumb if the query doesn't
wrap in an 80 character wide terminal I usually put it in one line.

On 3/14/06, Jeff Kowalczyk <jtk at yahoo.com> wrote:
> Sergio A. Kessler wrote:
> > I always write queries like this:
> >
> > $query = <<<END
> >     select
> >         *
> >     from
> >         table1,
> >         table2,
> >     where
> >         foo = ?
> >         and
> >         zeta = ?
> >     group by
> >         tita
> >     order by
> >         zeta
> > END;
>
> I usually don't go the extra mile to indent, but your way is the clearest
> and most diff-friendly, by far.
>
> I do like to capitalize SQL keywords though, could we agree on adding that
> to the style standard?
>
>  $query = <<<END
>      SELECT
>          *
>      FROM
>          table1,
>          table2,
>      WHERE
>          foo = ?
>          AND
>          zeta = ?
>      GROUP BY
>          tita
>      ORDER BY
>          zeta
>  END;
>
> +1 on reformatting SQL queries according to a strict style standard.
>
> Once consensus is reached on a style, a trac ticket should be created, and
> each reformat-only commit should include 'refs #XX' in the checkin
> message
>
> _______________________________________________
> 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! http://zohoplanner.com/?vt
>

_______________________________________________
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! http://zohoplanner.com/?vt




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.vtigercrm.com/pipermail/vtigercrm-developers/attachments/20060314/563fe117/attachment-0003.html 


More information about the vtigercrm-developers mailing list