On Sep 2, 11:43 pm, Clive Crous <[email protected]> wrote:
> 2009/9/3 Jeremy Evans <[email protected]>:
>
> > 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.
>
> The only real use case for this however is slight performance increase
> when there's a huge latency (in my case I have expected latency in
> some apps due to vast geographic distances).
> I've never actually tried this within Ruby or SQL but have used it in
> C++ to gain incremental performance increases my using literal hard
> coded multi-statement concatenation in my SQL strings as I built them.

Unfortunately, I don't think that is a use case for allowing << to
return self.  You could send a single SQL string with multiple
statements (with the MySQL native adapter) by doing:

  DB << "create table t (a text, b text); insert into t values ('a',
'b')"

Doing the following:

  DB << "create table t (a text, b text)" << "insert into t values
('a', 'b')"

Wouldn't be any different from:

  DB << "create table t (a text, b text)"
  DB << "insert into t values ('a', 'b')"

In terms of what is sent to the database.

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
-~----------~----~----~----~------~----~------~--~---

Reply via email to