Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sql.sequel support #127

Merged
merged 1 commit into from
Feb 22, 2018
Merged

add sql.sequel support #127

merged 1 commit into from
Feb 22, 2018

Conversation

modosc
Copy link
Collaborator

@modosc modosc commented Jun 26, 2017

this hacks in sequel support by pretending it's sql.active_record data.

i'm not sure it's the right solution but i'm hesitant to make any ui changes. i thought about altering the tab's title based on some flag but i don't know if people would potentially be using sequel and activerecord at the same time. for now this probably is a good enough solution?

@modosc modosc requested a review from dejan June 26, 2017 18:47
@gencer
Copy link

gencer commented Jun 27, 2017

@modosc, I tried this branch and it did not worked. When I restart server, It generates errors. Had to disable meta_request gem.

stderr:

/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/numeric/conversions.rb:104:in `to_s': SystemStackError: stack level too deep (Sequel::DatabaseConnectionError)
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:163:in `block in as_json'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:163:in `each'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:163:in `map'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:163:in `as_json'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:163:in `block in as_json'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:163:in `each'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:163:in `map'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:163:in `as_json'
	from /usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/core_ext/object/json.rb:54:in `as_json'

And this is the development.log:

Could not log "sql.sequel" event. NoMethodError: undefined method `name' for #<Sequel::Postgres::Adapter:0x0055befd9e78e0> ["/usr/local/lib/ruby/gems/2.4.0/gems/sequel-rails-0.9.17/lib/sequel_rails/railties/log_subscriber.rb:45:in `block in sql'", "/usr/local/lib/ruby/gems/2.4.0/gems/sequel-rails-0.9.17/lib/sequel_rails/railties/log_subscriber.rb:44:in `map'", "/usr/local/lib/ruby/gems/2.4.0/gems/sequel-rails-0.9.17/lib/sequel_rails/railties/log_subscriber.rb:44:in `sql'", "/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/subscriber.rb:99:in `finish'", "/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/log_subscriber.rb:83:in `finish'", "/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/notifications/fanout.rb:102:in `finish'", "/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/notifications/fanout.rb:46:in `block in finish'", "/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/notifications/fanout.rb:46:in `each'", "/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/notifications/fanout.rb:46:in `finish'", "/usr/local/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/notifications/instrumenter.rb:42:in `finish_with_state'", 

@modosc
Copy link
Collaborator Author

modosc commented Jun 27, 2017

@gencer it works with the example repo you built - can you alter that repo so i can reproduce your issue?

@gencer
Copy link

gencer commented Jun 27, 2017

@modosc, Nope. See, If you leave rails monitoring app enabled in development, this things can happen.

Monitoring tool I use was enabled at development and probing sequel. When I moved it to production only, it just works.

@modosc
Copy link
Collaborator Author

modosc commented Jun 27, 2017

Monitoring tool I use was enabled at development and probing sequel. When I moved it to production only, it just works.

what monitoring tool are you referring to?

@gencer
Copy link

gencer commented Jun 28, 2017

what monitoring tool are you referring to?

Skylight. When I add probe settings and tell that to probe sequel this happens. See here

@modosc modosc merged commit 38e2532 into master Feb 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants