On Monday, October 22, 2018 at 6:22:03 PM UTC-7, genc wrote:
>
> Hi Jeremy,
>
> I am trying to achieve this:
>
> update files set name = '--DELETED--' ||  files.name
>
> basically i would like to prepend deleted text to fields. How can I do 
> that with Sequel? I couldn't find any documentation about transforming 
> existing data on the fly with sequel.
>
> I tried something like:
>
> ...update{ ... }. However, it seems Update method does not support 
> brackets.
>

One way is:

  DB[:files].update(:name=>Sequel['--DELETED--'] + Sequel[:files][:name]) 

Note that virtual row blocks (the brackets you refer to) are just a 
shortcut, everything you can do inside a virtual row block you can do 
without a virtual row block.

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 sequel-talk+unsubscr...@googlegroups.com.
To post to this group, send email to sequel-talk@googlegroups.com.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to