如何使用peewee更新多个记录 [英] How to update multiple records using peewee

查看:103
本文介绍了如何使用peewee更新多个记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 Peewee 与 Postgres 数据库一起使用.我想知道如何一次更新一个表中的多条记录?
我们可以使用这些命令在SQL中执行此更新,并且我'我正在寻找 Peewee 等效方法.

解决方案

ORM 通常不支持批量更新,你必须使用自定义 SQL,你可以在这个 link (db.excute_sql)

I'm using Peewee with Postgres database. I want to know how to update multiple records in a tabel at once?
We can perform this update in SQL using these commands, and I'm looking for a Peewee equivalent approach.

解决方案

ORMs usually dose not support bulk update and you have to use custom SQL, you can see samples in this link (db.excute_sql)

这篇关于如何使用peewee更新多个记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆