sqlalchemy Adding Instances


Example

New or detached objects may be added to the session using add():

session.add(obj)

A sequence of objects may be added using add_all():

session.add_all([obj1, obj2, obj3])

An INSERT will be emitted to the database during the next flush, which happens automatically. Changes are persisted when the session is committed.