in reply to RFC: DBIx::Library
I do think I like your interface at first glance. It's fairly concise. But I really don't like the syntax needed for:
I think having the module do all the ugly quoting instead would be a little cleaner:# select $$what$$ from offices' $sql->offices(what => "`address`, `address2`, `city`, `state`");
I also don't see any mention of mixing DBI placeholders with your $$foo$$ placeholders. Can I have a query like this:# select $$what$$ from offices $sql->offices(what => [ qw/address address2 city state/ ]);
From a skim of the code, it looks as though this is possible -- perhaps an example in the POD is in order, since losing DBI placeholder functionality would be scary.# select $$what$$ from offices where office_id=? $sql->offices(what => [qw/name city/])->do($office_id);
And speaking of placeholders, have you given thought to the quoting of your $$foo$$ placeholders? If they quoted, I could use your module to do named placeholders as a complete replacement for DBI's positional placeholders (native RDBMS placeholder performance aside). Maybe you could even use different delimiters to specify different quoting rules (like the backtick-quoted column names above, single-quoted data like DBI placeholders, and non-quoted things like LIMIT clauses). I don't want to give your small module featuritis, but it's some food for thought.
$POD =~ s/quries/queries/
blokhead
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RFC: DBIx::Library
by eric256 (Parson) on Oct 13, 2004 at 18:24 UTC | |
by perrin (Chancellor) on Oct 13, 2004 at 18:48 UTC | |
by eric256 (Parson) on Oct 13, 2004 at 19:45 UTC | |
by perrin (Chancellor) on Oct 13, 2004 at 20:12 UTC |