On 7/17/06, zdennis <[EMAIL PROTECTED]> wrote:
> That said, I think providing an 'import' method as a plugin would
> certainly be useful to some people (especially those too lazy to
> connect to a database by hand).
I like to automate tasks, if that makes me lazy, then I am lazy.
Me too - I must confess to having an AR model in one of my projects
for the explicit purpose of connecting to a DB, and nothing else.
Necessity is the mother of innovation; Lazyness is the mother of
pragmatism. I certainly have no issue taking Models out to dinner,
plying them with rich foods and cheap wines, and then swiping their
underlying DB connection using instance_eval before they know what's
happened to them. Don't hate the player baby, hate the game! Ahem.
> Another thing to do might be reworking
> it to use prepared statements, for an even bigger speed increase.
I like the idea of keeping logic outside of the DB itself.
Perhaps we're talking at cross purposes, but I don't think using a
prepared statement is pushing logic into the DB; rather it's taking
advantage of cache features so the DB can be a bit smarter (or in some
cases a LOT smarter) about how it handles your request. At the
ActiveRecord API level, whether you're using a prepared statement or
not should be transparent; your import(array) method needn't change
the argument it accepts or the result it returns. It might be worth
investigating in this context, since you essentially on a quest for
speed and efficiency.
Finally, implementing this as a plugin first will give people
(including the core team I'd imagine) the opportunity to evaluate this
addition in 'production' environments, which is an excellent way to
highlight its value. Don't think of doing as a plugin as a
'second-best' solution...
- james
--
* J *
~
_______________________________________________
Rails-core mailing list
Rails-core@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-core