Skip to content

Instantly share code, notes, and snippets.

View hilmanski's full-sized avatar

Hilman Ramadhan hilmanski

View GitHub Profile
@doobeh
doobeh / bulk_updates_sqlalchemy.py
Created September 8, 2015 18:24
SQLAlchemy bulk updates.
""" Quick example showing how to do a bulk update into the database
using SQLAlchemy, without interacting heavily with the ORM.
"""
from sqlalchemy.sql.expression import bindparam
stmt = addresses.update().\
where(addresses.c.id == bindparam('_id')).\
values({
'user_id': bindparam('user_id'),
'email_address': bindparam('email_address'),