in reply to Re: DBI::Pretty
in thread DBIx::Pretty (was DBI::Pretty)
The thing that I was trying to do with this was (as indicated in the thread noted) to separate out SQL from programming logic as one tries to do with HTML and programming logic. Yes, I know SQL/logic are more closely tied, but I've found that once I've gotten most of the program logic down, I hardly touch the SQL from that point. SQL statements tend to be 'static' (regardless of placeholders), so isolating them once programming is done is not unreasonable.
As for other SQL engines and the idea of lists or sets, all you are giving DBI::Pretty are plain text SQL statements and a DBI handler; as you probably know what you are doing with what database, any problems with SQL statements not carrying over is your own fault; DBI::Pretty isn't trying to recreate a standard DBI. And as long as you can write the SQL to handle sets or lists, there's no reason why this doesn't work with it. You'll still be needing to use placeholders and the like.
I'm not offering DBI::Pretty as a placebo; I don't expect to see a "Use DBI::Pretty or die()" thread on PM anytime soon. But based on the indicated thread, there does seem to be a vested interest in cleaning SQL calls. Tangram is one approach as you've got above, though I've not used it myself; looking over the docs, it's more to rid the SQL-nature of database calls into a more OOP-type of way. Here, I assume that you still want to have SQL around, but not as embedded in the program as is typically done. What I believe DBI::Pretty offers is a way to develop SQL/DBI calls that are not only easier to read, but offer a way to genralize common SQL calls (eg "SELECT $fields FROM..." can be used assume the rest is the same with any number of combinations of $fields), as well as possibly helping to relieve maintainence nightmares. I have no expectations of where this might go; it was mostly built for curiosity's sake (and now I know how to use AUTOLOAD as well, which is a plus).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: DBI::Pretty
by miyagawa (Chaplain) on Jul 01, 2001 at 16:23 UTC |