On Fri, Jun 16, 2023 at 10:48 AM Rui Santos <[email protected]> wrote:

> Hi, we are upgrading from sequel 4 to sequel 5 and we now since datasets
> are frozen I wonder how we could set the dataset database at runtime.
>
> We have a lot of code that will build a dataset with chaining and then
> change the database to run the dataset (on a reporting database for
> example).
>
> I found that we can clone the dataset and set opts, but I couldn't figure
> it out if we can do that do the db. Something like:
>
> dataset.clone(db: different_db)
>

This is not supported in Sequel 5.  You should build the dataset using the
Sequel::Database you plan to run it on.

However, if you don't mind something unsupported, you could try:

ds = DB1[:table]
ds = DB2.dataset.clone(ds.opts)

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/CADGZSSd5P1S0HLFEpPLLAWcFbThYz__3Wyh0CjKLN8L791URRg%40mail.gmail.com.

Reply via email to