thank you
are the parameters set in Sequel.connect are global for all the connection?
I'm asking because I Im using RDS with IAM, and Im not sure where should I 
add the password update. my application performs Sequel.connect couple of 
times, and I will update the password this way for each Sequel.connect 
command

Thread.new do
loop do
db.opts[:password] = get_current_iam_password
sleep 890
end
end 

thanks
ב-יום ראשון, 19 בנובמבר 2023 בשעה 23:21:48 UTC+2, Jeremy Evans כתב/ה:

> On Sun, Nov 19, 2023 at 12:34 AM Sofia Dimant <[email protected]> wrote:
>
>> I have a rails application (with puma) and postgresql databases. As a DB 
>> driver gem Sequel is used. 
>>
>> I did a test in my program and saw that in this code:
>> def test_select
>> db = Sequel::Model.db = Sequel.connect(@database_url)
>> db['select 1'].first
>> db.disconnect
>> puts "valid? #{db.test_connection}"
>> true
>> rescue
>> false
>> end
>>
>>   and saw that db connection is valid after disconnect, and the 
>> Sequel.connect is called  automatically before test_connection
>>
>> what are the scenarios the Sequel.connect called?
>> I saw that if i run a simple query after db.disconnect the Sequel.connect 
>> is also called
>>
>
> Each Sequel::Database has a connection pool.  Database#disconnect 
> disconnects the current connections in the pool.  The next time you run a 
> query on the Database, a new connection is created.
>
> 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/02b8abcc-c76b-4eb6-ad85-c387894ce5ecn%40googlegroups.com.

Reply via email to