yes:

http://docs.sqlalchemy.org/en/rel_0_9/core/tutorial.html#executing-multiple-statements

"When executing multiple sets of parameters, each dictionary must have the same 
set of keys; i.e. you cant have fewer keys in some dictionaries than others. 
This is because the Insert statement is compiled against the first dictionary 
in the list, and it’s assumed that all subsequent argument dictionaries are 
compatible with that statement.”





Pavel Aborilov <abori...@gmail.com> wrote:

> I understood, but it's not obvious, for me. Is it mentioned in the docs?
> 
> 
> On Monday, January 19, 2015 at 4:47:18 PM UTC+3, Michael Bayer wrote:
> the first entry in the list of parameters determines how the INSERT statement 
> will be written. 
> 
> if you have different sets of keys in each parameter set, then you should 
> invoke session.execute() individually for each set of parameters. 
> 
> 
> 
> Pavel Aborilov <abor...@gmail.com> wrote: 
> 
> > Hi! 
> > 
> > I have model with nullable fields and try to add bulk of items: 
> > 
> > insert = model.__table__.insert() 
> > session.execute(insert, events) 
> > where events in the list of dicts with params 
> > and if first element in list don't have that nullable params, then event if 
> > other elements have one, 
> > they won't be added. 
> > Where I am wrong? 
> > 
> > -- 
> > 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+...@googlegroups.com. 
> > To post to this group, send email to sqlal...@googlegroups.com. 
> > Visit this group at http://groups.google.com/group/sqlalchemy. 
> > For more options, visit https://groups.google.com/d/optout.
> 
> -- 
> 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 post to this group, send email to sqlalchemy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to