On 01/12/2010 10:11 PM, Jeremy Evans wrote:
On Dec 1, 1:56 pm, Gary Doades<[email protected]>  wrote:
So it seems that I MUST add a valid :read_only entry to the servers hash
or bizarre behaviour ensues.
That's misleading.  You only need to add a valid :read_only entry to
servers if you are also overriding the :servers_hash option.  If you
don't override the :servers_hash option, then you don't need a
read_only entry in the servers hash.
OK, I agree and in this case that's what I meant, only if you specify a :servers_hash option do you need to specify a :read_only entry, but that still needs documenting?
This may or not be the intended behaviour.
If so it needs documenting I think.
It is the intended behavior.  It's how the master/slave database
support works without any configuration other than setting up the
database connection.  If you think it should be documented somewhere,
I'll certainly consider a patch.
I think it just needs stating that if you override the :servers_hash option then you MUST add a valid :read_only entry to the servers hash. That seems to do the trick.

Clearly without the :servers_hash option you don't need to do that, or at least I never did before when only using the :servers option.

Maybe if the call to Sequel.connect (with a :servers_hash override) doesn't include a :read_only entry you can add one that is the same as :default. That seems to adhere to the principle of least surprise?

Anyway, as long as we know what to do it all seems to work OK.

Thanks again,
Gary.

--
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en.

Reply via email to