Execute multiple independent statements in SQLAlchemy Core?
Question: I'm using SQLAlchemy Core to run a few independent statements. **The
statements are to separate tables and unrelated**. Because of that I can't use
the standard `table.insert()` with multiple dictionaries of params passed in.
Right now, I'm doing this:

    
    
    sql_conn.execute(query1)
    sql_conn.execute(query2)
    

Is there any way I can run these in one shot instead of needing two back-and-
forths to the db? I'm on MySQL 5.7 and Python 2.7.11.


Answer: It is neither wise, nor practical, to run two queries at once.

It is not wise allowing such give hackers another way to do nasty things via
"SQL Injection".

On the other hand, it is possible, but not necessarily practical. You would
create a Stored Procedure that contains any number of related (or unrelated)
queries in it. Then `CALL` that procedure. There some things that _may_ make
it impractical:

  * The only way to get data in is via a finite number of scalar arguments.
  * The output comes back as multiple resultsets; you need to code differently to see what happened.

Roundtrip latency is _insignificant_ if you are on the same machine with the
MySQL server. It can usually be ignored even if the two servers are in the
same datacenter. Latency becomes important when the client and server are
separated by a long distance. For cross-Atlantic latency, we are talking over
100ms. Brazil to China is about 250ms. (Be glad we are no living on Jupiter.)

