Replies: 1 comment 1 reply
-
The SQL is precached so it is always available and precalculated. You could do the following before loading the extension: # Or whatever SQL is valid for your database.
def DB.valid_connection_sql = "SELECT NULL" Note that the I'm not sure the precaching is required on all Database adapters that Sequel supports. However, it is required on some of them. If the SQL isn't precached, then Sequel would need to try to generate it, but the connection_validator extension calls it when trying to checkout a connection, so you would end up with infinite recursion if it wasn't precached in that case. I can say if the adapter you are using it checks out a connection when calling |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
When connecting to a database, I am passing the parameter
:test => false
parameter to avoid connecting right away. But when I add the connection_validator plugin, it seems that the parameter is ignored and Sequel is connecting to the database immediately.Presumably because of
sequel/lib/sequel/extensions/connection_validator.rb
Line 80 in bdeb862
Is there a reason that SQL needs to be precached? Is there a way to suppress this behavior?
Beta Was this translation helpful? Give feedback.
All reactions