Closed HielkeJ closed 4 days ago
Thanks @HielkeJ!
I'm wondering if we should remove the single quotes from the regex. @mostfunkyduck pointed out that single quotes are for string literals, not identifiers. What do you think @arielvalentin @scbjans
New Relic does not have this implemented and I didn't see others who did, so unfortunately not a lot to compare to.
Thanks for pointing that out, I somehow read past that. After reading those docs, I agree that the single quotes should be removed from the regex, since those aren't for identifiers.
I did a small update in the PR @hannahramadan. If I try in Postgres to to a select SELECT * FROM 'table', it returns a syntax error. I didn't test if it fails in opentelemetry-ruby-contrib as well with a syntax error, but at least in shouldn't run the query.
Given this new information I'm going to rescind my approval and scrutinize this a little more.
I'll leave the final approval to some other folks.
TABLE_NAME is extracted if the table name is quoted. Should fix #1173