On Tuesday, October 24, 2017 at 3:30:51 PM UTC-7, Troex Nevelin wrote:
>
> Hi, 
>
> I want to make one of my tables partitioned, while I can insert using 
> DB[:events].insert({...}) and fetch the ID using 
> DB[:events].get(Sequel.lit('currval(?)', 
> 'events_id_seq')) most of my code uses Models, is there a solution for 
> this case? Is it possible to enable `disable_insert_returning` only for one 
> model instead of entire DB connection?
>

Yes:

  class Event < Sequel::Model(DB[:events].disable_insert_returning)
  end

Note that you'll probably want to set the primary keys manually before 
inserting if you are disabling insert returning.

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 https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to