in reply to Module Design Review -- DB mini language
I personally can't quite see why this is any better than SQL.
Call me crazy, but I rather like SQL - it's pretty clear given enough whitespace.
Aliases make selecting from multiple tables and/or subselects tidy too.
Vanilla SQL* is going to be more portable than DAL - learn SQL and you can use it from Perl, PHP, $fave_language, whereas DAL is only being to be useful with your module to hand.
You're not providing anything clever (i.e. database independent SQL).
It'd be really cool if DAL spat out SQL that attempted to do The Right Thing, depending on the database it's talking too.
Interesting idea, but I can't see any practical use for it.
Cheers.
BazB
Update:
When I use SQL, I tend to go totally overkill on the whitespace.
Taking your example SQL, I have to admit the way you've formatted it is pretty nasty.
I'd lay it out as follows:
SELECT w.id, w.definition FROM words w, stock s, languages l, stockmatch m, types t WHERE s.word = ? AND l.name = ? AND s.languageID = l.id AND m.stockID = s.id AND w.id = m.wordID AND t.name = ? AND w.typeID = t.id;
If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.
That way everyone learns.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Module Design Review -- DB mini language
by tantarbobus (Hermit) on Feb 10, 2003 at 22:52 UTC |