> Well, you don't have to provide a database in the connection string, > and you can use an options hash instead of a connection string and > just not provide the :database option. In either case, if you want an > error to be raised if no specific shard is given, the :default option > with the proc that raises will take care of that for you.
That sounds fine. I was under the mistaken impression that you had to provide a full connection string with a db. I can tell I haven't read the docs thoroughly enough. I guess that just goes to show I'm a total sequel noob. Anyhow, thanks for taking the time to explain that. > I made a few more tweaks and just merged the code into the master > branch:https://github.com/jeremyevans/sequel/compare/0f73864dcd...ca882f1171 > As always, additional testing is appreciated. :) Awesome :). I plan to play with this later today. I'll be sure to send my feedback. > The issue with doing this in the extensions themselves is that they > are independent and I don't want to couple them. If you are just > using server_block, you probably don't want the synchronize, and if > you are just using arbitrary_servers, with_server may not be defined. > It is possible to conditionally override with_server in > arbitrary_servers if it is already defined, but that brings up > ordering issues and magical behavior that I'd rather not deal with. > I'll add a note to the arbitrary_servers RDoc about this. Keeping these de-coupled sounds like the right approach. That said, it seems kinda funny to have the recommended API for this use case be "define a singleton method like so". Might it be worth defining an extension that simply enables both the with_server and arbitrary_servers extensions, and then defines the `with_server` method as you've shown above? That way the individual extensions stay de-coupled but the recommended way to combine them is clear. 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.
