On Monday, June 1, 2015 at 3:27:19 AM UTC-7, Ian Winter wrote: > > I've got the following block: > > dataset = DB[:old_table]. > select(:cola, :colb, :colc). > where(:cold => ratings[$options[:type].to_sym].to_i). > where(:colc => Time.at(range_start)..(Time.at(range_end))) > ins = DB[table_name.to_sym].with_sql(:insert_sql, [:cola, :colb, > table_stamp.to_sym], dataset).update_ignore.update > > And a subsequent > > rescue Sequel::UniqueConstraintViolation => e > > Now I thought that'd stop dupe key errors, but, it doesn't. Is the > with_sql stopping that? >
Yes, with_sql sets static SQL for the dataset, so future changes that would affect the SQL generated would not have an effect. For things like this, it's best to either call the related sql method (e.g. update_sql) or use a database logger in order to see what SQL Sequel is sending to the database. 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 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.
