> I haven't run it through the full test suite yet, but I don't expect
> problems there.  If anyone wants to review the diff and give me
> feedback, I'd appreciate it.

Looks good to me, but I don't know Sequel's code base at all.  I do
plan to try this out tomorrow at work.  Should I respond here with
feedback or do you have a pull request open on github to comment on or
something?

Returning to a discussion point from earlier in the thread:

> That API looks great.  One question, though: how do I get the DB
> object?  Presumably through `Sequel.connect`, but I'm not sure what
> connection string I would pass, given that there's not default DB that
> makes sense.

>> If you don't have a default DB that makes sense, then having
>> a :default entry that raises an error is fine.  You would probably
>> want to set your default/shared options in the main connection string/
>> options, and have the shards only override the parts they need.
>> Putting it all together, this could possibly work for you currently:
>>
>>  DB = Sequel.connect('postgres://user:password@host/db',
>>        :servers=>{:default=>proc{raise ...},
>>          ['host1', 'db1']=>{:host=>'host1', :database=>'db1'},
>>          ['host2', 'db2']=>{:host=>'host2', :database=>'db2'},
>>          ...})

`Sequel.connect('postgres://user:password@host/db', ...` makes sense
to me if `db` is valid database on `host`, and it's one you plan to
use.  In a case like mine, where all DB access will be through a
particular shard...there isn't really a DB that makes sense to specify
in the connection string.  But I guess I just need to provide one, and
then have the default option raise an error?  It just seems like a
semantically weird/confusing API to have to pass a valid connection
string for a DB that I don't actually ever use.  Not sure what (if
anything) can/should be done about it, though.

Thanks again,
Myron

-- 
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