简体   繁体   English

防止从sql更新sqlite中的特定列

[英]preventing updation of specific columns in sqlite from python

i am developing a twisted app which interacts with a sqlite backend, in the sqlite db there is a users table of which certain columns should not be updated if they already contain a value. 我正在开发一个与sqlite后端交互的扭曲应用程序,在sqlite数据库中有一个users表,如果某些列已经包含值,则不应该对其进行更新。 one way of doing this would be to check the user table before each insert for existence of values in the columns of interest and proceed accordingly , but this will be a performance killer and people familiar with twisted will know how cumbersome this can be, can someone suggest a better way of doing this . 一种方法是在每次插入之前检查用户表中感兴趣的列中是否存在值,然后进行相应的操作,但这将是性能的杀手,而熟悉twist的人将知道这样做会很麻烦,有人提出一种更好的方法。

TIA TIA

尝试INSERT语句INSERT或IGNORE变体。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM