On Sep 2, 2:45 pm, Clive Crous <[email protected]> wrote: > 2009/9/2 Jeremy Evans <[email protected]>: > > > DB << "create table t (a text, b text)" << "insert into t values > > ('a', 'b')" > > > I think that makes the code harder to read. If you can come up with a > > good use case for having << return self, I'll certainly consider > > switching it. > > The only possible use for this that I can think of is if statements > where joined (when chained) for a single communication burst - ie: a > multi statement execute.
Hmm, could you give an example of this with Sequel? In general, most of the database adapters don't support multiple SQL statements inside a single call. The native MySQL adapter is an exception. > Then this kind of usage might have a use. Other than that it just > makes the code messier for no gain other than making it messy. > > On a side note, another use I've experienced/seen: > I remember years ago, one of the first ORMs I ever used (might even > have been in Python actually before I saw the light ;)) automatically > wrapped chained statements into a single transaction. > I personally don't like this behaviour anymore and prefer explicitly > defining my transactions where required, but thought I'd share anyway. It may have been SQL Alchemy, I know they use the unit-of-work pattern. I prefer the more explicit transaction behavior too. 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 -~----------~----~----~----~------~----~------~--~---
