If you look at the docs 
at 
https://github.com/jeremyevans/sequel/blob/master/doc/opening_databases.rdoc, 
there is a `test` option you can pass to the connect method. I believe that 
is what you're looking for. 

On Friday, April 7, 2023 at 3:01:27 PM UTC-4 [email protected] wrote:

> I'll preface this question: We still have to work through upgrading 
> deprecation warnings so we can upgrade to Sequel 5.0/Ruby 3 (we're on 
> 4.49.0/2.7.3)
>
> The system I work on has numerous postgres databases it connects to (it's 
> a bit of a monolith).  We have servers that only use parts of the system, 
> but we end up connecting to every database at startup.
>
> I'm wondering if there's a lazy way to load databases, where it doesn't 
> make an attempt to connect until a "real" reason to do so is needed.    We 
> currently have code that does `Sequel.connect` for each of the db urls, the 
> loads a default set of extensions.  
>
> If there was a `lazy_connect` for example, everything would work exactly 
> the same until a model was queried, etc.
>
> I looked through the `connect` documentation and couldn't really come up 
> with a way to do it.  
>
> I'm just wondering if it's even possible to do something like this.
>
>
>
>
>
>

-- 
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/c3dfdc03-28d0-468c-a297-ea50d0eb2043n%40googlegroups.com.

Reply via email to