How does Dataset#fetch_rows call Database#execute with adapters that don't support Database#execute?
Shawn On Aug 10, 8:50 am, Jeremy Evans <[email protected]> wrote: > On Aug 9, 9:39 pm, Shawn Van Ittersum <[email protected]> wrote: > > > How hard would it be to make 'execute' safe for public use, or to > > rename it so that a new public method 'execute' could be added? From > > an end user perspective, I think db.execute('...') is a much more > > readable syntax than db << '...'. Readability not only increases > > application maintainability, but also facilitates new user adoption, > > and the more developers who know Sequel, the better all of us who use > > it will be. :) > > If you want to work on a patch that allows that behavior and doesn't > break backwards compatibility significantly, I'd consider applying > it. Sequel supports 14 adapters, and if we wanted to make > Database#execute safe, for consistency reasons all adapters that > currently don't support it would need to. > > I will say this is one of the things I thought about doing during the > Sequel 2.12 -> 3.0 upgrade, and ended up scraping the idea because I > came to the conclusion that it was too much work for too little gain. > > The main issue is that Database#execute is what Dataset#fetch_rows > calls, so at least it has to support being called with a block given > by fetch rows. In some adapters, that is the only type of use > supported, in others, you can use execute for what you want. Here's a > breakdown by adapter for execute being used by itself (i.e. DB.execute > ('CREATE TABLE ...'): > > ado: execute probably works > amalgalite: execute will not work > db2: execute probably works > dbi: execute probably doesn't work > do: execute probably works > firebird: execute probably works > informix: execute will not work > jdbc: execute will not work > mysql: execute probably works > odbc: execute probably doesn't work > openbase: execute probably works > oracle: execute probably works > postgres: execute probably works > sqlite: execute probably doesn't work > > Jeremy --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sequel-talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en -~----------~----~----~----~------~----~------~--~---
