Malcolm Greene wrote:
> By manage I mean format, pretty print, version, audit, comment, re-use,
> etc?
Formatting SQL: sql is plain-text, so I format using whitespace. I like
looking at everything in lower-case, but there's a valid argument for
putting all the SQL keywords in UPPER, and everything else lower.
select customers.id as id,
customers.name as name
from customers
left join invoices
on invoices.cust_id = customers.id
Pretty-printing SQL would mean coloring and formatting words, mostly. I
see that when I copy/paste the above sql into vim, it colorizes the
keywords. I'd google for "pretty print sql" and see what you find.
Version: I keep my .sql files separated by "module", so all
customer-related tables are in customers.sql. I don't bother attaching a
version number, but if I wanted to I'd do it in the comments in the
header of the file. I let Subversion handle the revision tracking, and I
enter detailed notes on why I changed what I did in the commit log.
Audit: I don't understand what you mean. Do you mean change auditing?
Whenever I make a change, test it and accept it, I commit the change to
Subversion. So the audit trail is kept for me.
Comment: ??? Use the comment conventions for the sql dialect you are
using. Most SQL is self-explanatory, especially if you write wordy
instead of terse (full of 1-letter aliases) SQL, and take care to use
whitespace to format it nicely. I do comment things when I want to
remind myself in the future why this or that is here, but too many
comments is just too much noise.
Re-use: ??? Copy/paste?
...but I get the feeling you are looking for some sort of monolithic
tool that does everything for you, and I'm not going to be able to help
you with that. I suggest embracing the Unix philosophy where you use
several well-defined, small tools to solve a given problem.
Vim + Subversion + some python scripts you've hacked together should get
you there.
Paul
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[EMAIL PROTECTED]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.