Hi all,
I am trying to insert/update a record based on their existence in mysql db
table.
But it produces Sequel::UniqueConstraintViolation.
A simplified code is something like below:
ds = db[:mytable].where(:id => 1234)
if ds.empty?
db[:mytable].insert({:id => 1234, :value => "aaaa"})
else
db[:mytable].where(:id => 1234).update({:id => 1234, :value => "aaaa"})
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.