-
Notifications
You must be signed in to change notification settings - Fork 375
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
Sequel Support #171
Sequel Support #171
Conversation
lib/ddtrace/contrib/rails/utils.rb
Outdated
@@ -33,6 +33,8 @@ def self.normalize_vendor(vendor) | |||
'sqlite' | |||
when 'postgresql' | |||
'postgres' | |||
when 'mysql2' | |||
'mysql' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't sure if you would want to differentiate between mysql and mysql2 adapters. If you do, can probably remove this line, otherwise this should group them together.
lib/ddtrace/contrib/sequel/utils.rb
Outdated
end | ||
|
||
def sanitize_sql(sql) | ||
regexp = Regexp.new('(\'[\s\S][^\']*\'|\d*\.\d+|\d+|NULL)', Regexp::IGNORECASE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This regexp should be updated and probably extract out into the class:
REGEXP ||= Regexp.new(
Regexp.union([
/'(?:[^']|'')*?(?:\\'.*|'(?!'))/,
/"(?:[^"]|"")*?(?:\\".*|"(?!"))/,
/\b-?(?:[0-9]+\.)?[0-9]+([eE][+-]?[0-9]+)?\b/,
/\b(?:true|false|null)\b/i,
/0x[0-9a-fA-F]+/,
/(?:#|--).*?(?=\r|\n|$)/i,
/\/\*(?:[^\/]|\/[^*])*?(?:\*\/|\/\*.*)/
])
)
Replace this following line to sql.to_s.gsub(REGEXP, '?')
. This should help speed it up some as well as remove extraneous ?
.
Added a few comments. Otherwise looks good! |
Hello! Is there something missing/blocked in this PR? I was going to start using this gem but just now realized the lack of support for Sequel |
Hello @thiago-sydow ! thanks for reaching us! At the moment we're planning to ship a new release with a lot of changes. Unfortunately Sequel support will not be added in this release but in the next one. I can ping you again once the review (and the refactoring with the new config system) is in our weekly cycle. Sorry for the delay! |
Hi @palazzem thank you for replying! I understand, and I would love to get notified when Sequel is worked/merged. I checked the new config system to be released and seem far better then the current one, nice job! |
@thiago-sydow thank you very much! Will ping everyone in this thread once we move this PR review from the backlog to the current cycle of work. |
0c2b372
to
15495b5
Compare
53d11af
to
5320f62
Compare
Updated this pull request to
Still need to:
|
7d0b52c
to
fd425e5
Compare
In addition to the above, I also:
|
cb99057
to
c13b8d8
Compare
Hey @thiago-sydow ! we've finished the rebase and all the work around Sequel! Actually the 0.12 is in release candidate but Sequel will be released in the 0.13 (usually we do a minor release every 2-3 weeks). Before that time, we'll ship probably a beta release so all these new integrations can be tested beforehand. Sounds good? |
Hi @palazzem thank you for notifying me, yes that sounds great! |
Also, @palin just letting you know this one is merged! |
I'm having trouble getting this to work. I've tried a few different versions of the gems. I'm trying to match what I've installed locally using the appraisals gem. I get get the ddtrace specs to pass but I can't get the example to run. Example gist: https://gist.github.com/twe4ked/590db5a686104770a53a78b657eacc3d Thanks. Edit: The |
@twe4ked Hmmm, if initialize isn't being called, then maybe it isn't patching. I'll take a look at this, too. Thanks for the Gist. |
No worries. It seems to prepend the |
Cool, let me know if you find anything else. |
Oh I think I know why: your This is because it patches I suppose we could probably add some kind of default pin to the @twe4ked I'll open a bug fix PR for this. Thanks for reporting! |
That's it! Thanks for your help. |
Amazing! Thanks! |
Any update on getting a beta release out soon? I'm guessing it might be a while since 0.12.0 is still in RC phase. Cheers. |
Hello @twe4ked! yes we're going to ship the 0.12.0 this week, so that the first 0.13.beta1 can be out next one. Thanks for your patience! |
Following the work initiated by #163 this PR:
execute_ddl
,execute_dui
andexecute_insert
(without that last one, we'd get no clue on INSERT calls for instance)