-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
feature requestUse this to propose new features.Use this to propose new features.
Milestone
Description
Add support for executing statements like:
# insertmany style:
stmt = insert(students).returning(students.c.name)
result = connection.execute(
stmt,
[
{"name": "Galileo Galilei", "is_active": False, "grade": "A"},
{"name": "Isaac Newton", "is_active": False, "grade": "B"},
{"name": "Albert Einstein", "is_active": False, "grade": "C"},
]
)
# new_rows contains all the new pages just added, with the coulmn values for "name" only
new_rows = result.all()
assert len(rows) == 3
# inserted_primary_keys_rows return the inserted page ids as rows
# process bulk data
stmt = (
update(students)
.values(is_active = False)
.where(students.c.start_on.before(date(1999,1,1))
.returning(students.c.name)
)
result = connection.execute(stmt)
rows = result.all()
# rows contain all the students name that were updated
# sys cols are automatically availableReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestUse this to propose new features.Use this to propose new features.
Projects
Status
No status