On Wed, Nov 25, 2020, at 10:30 AM, Kata Char wrote:
> Hi, sorry if this post is a duplicate, my first one didn't seem to make it.
> 
> I was reading the documentation:
> - https://docs.sqlalchemy.org/en/13/core/tutorial.html#execute-multiple
> 
> - 
> https://docs.sqlalchemy.org/en/13/_modules/examples/performance/bulk_inserts.html
> 
> Is there any difference between conn.execute(TableClause.insert(), [...]) vs 
> conn.execute(Model.__table__.insert(), [...])?
> 
> The first one is documented to use execumany(), but what about the second 
> one? 

Any conn.execute() that passes a list of dictionaries as the second argument, 
where there is more than one entry in the list, will use the executemany() 
style with the DBAPI connection.

With the ORM the Model.__table__ attribute is a Table object.  That tutorial 
seems to be referencing TableClause which is the base class for Table, but all 
the examples there are using Table objects.


> 

> -- 
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
>  
> http://www.sqlalchemy.org/
>  
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/1ffe48c6-4124-40ab-902f-ffa86885ea94n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/1ffe48c6-4124-40ab-902f-ffa86885ea94n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/2019f1cc-3e29-4b24-b1d5-180788c83d8a%40www.fastmail.com.

Reply via email to