support for forcing marginalia inclusion #19

Closed
wants to merge 1 commit into
from

Projects

None yet

4 participants

@ossareh

Issue: Adding marginalia to systems which use AR plugins to manage replication and sharding results in no comments being appended to queries.

Context: AR replication libraries like [Octopus|https://github.com/tchandy/octopus] and [DBCharmer|https://github.com/kovyrin/db-charmer] give you Proxy objects back when you call ActiveRecord::Base.connection.is_a? - these Proxy objects then delegate to the correct Adapter.

Solution: I initially tried to avoid patching your gem, instead I looked to see whether these libraries were "doing it wrong". I think they're actually doing the right thing - this lead me to decide that giving users the ability to override the decision making is the right thing to do. That is "we're smart enough to know to use a non trivial piece of code like Octopus, we want to be smart enough to tell other pieces of software to do the right thing in these cases".

@inspire22

The current code does seem to work ok with slave_pools at least...

@ossareh

@inspire22, any chance you could provide more details? I'm happy to look into making this better.

@inspire22

I haven't looked into your patch specifically, was just chiming in that I use the slave_pools gem and marginalia seems to work OK with it. It's not quite as complex as octopus/dbcharmer though. But my comments are added to my queries as expected.

@dylanahsmith

Would pull #42 fix the issue?

@arthurnn

yes, #42 should solve this...

thanks all

@arthurnn arthurnn closed this Nov 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment