Okay, i will do more research with add a trigger for find out this issue 
caused by UPDATE statement invalid, or just stored generated column not 
updated when do UPDATE, even, DB.run not works with Roda request?

will be in touch, thanks


在2021年11月20日星期六 UTC+8 上午1:38:06<Jeremy Evans> 写道:

> On Fri, Nov 19, 2021 at 9:05 AM Billy Zheng <[email protected]> wrote:
>
>> Okay, i update my code, like this:
>>
>> ```
>>   r.is 'add-ts-keyword' do
>>         new_keyword = r.params['new_keyword']
>>
>>         if new_keyword.present?
>>           DB.run(Sequel.lit("INSERT INTO zhparser.zhprs_custom_word 
>> values(?) ON CONFLICT DO NOTHING;", new_keyword))
>>         end
>>
>>         r.redirect request.referrer
>>       end
>>
>>       r.is 'remove-ts-keyword' do
>>         keyword = r.params['keyword']
>>
>>         if keyword.present?
>>           DB.run(Sequel.lit("DELETE FROM zhparser.zhprs_custom_word WHERE 
>> word=?;", keyword))
>>         end
>>
>>         r.redirect request.referrer
>>       end
>>
>>       r.is 'sync-ts-keyword' do
>>         DB.run("SELECT sync_zhprs_custom_word();")
>>         DB.run("UPDATE investing_latest_news SET title = title, preview = 
>> preview;")
>>         r.redirect request.referrer
>>       end
>> ```
>>
>> But it still not work.
>>
>> For describe my issue, i record a video, and upload here.
>>
>> https://raw.githubusercontent.com/zw963/zw963.github.io/master/files/1.mp4
>>
>> Could you please check?
>>
>>
>> > UPDATE just sets columns to their current value, so it will only have 
>> an effect if there are triggers or something similar in play.
>>
>> As you can see in the video, the first time, i add "美元“ token into 
>> parser, the UPDATE statement works, but then after i remove add from parser,
>> the UPDATE not work anymore,  and finally, when i UPDATE from 
>> bin/console, it works again.
>>
>
> Sorry, I don't have time to watch vidoes.  This is a Sequel help form, so 
> if you think there is a problem, please post a minimal self contained 
> example showing it using just Sequel, with no other libraries.
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/db603f77-7e8f-47a3-8c02-1be5c8816c63n%40googlegroups.com.

Reply via email to