-
Notifications
You must be signed in to change notification settings - Fork 678
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
sqlite: Escape '%' and '_' in search queries. #4487
Conversation
I picked '@' arbitrarily, it doesn't matter much. I just don't like '\' because it needs to be escaped itself in the JS code, which is annoying.
Why do you think these characters ought to be escaped? |
@itsjohncs there's some discussion in #4481, here's my comment:
I think we might want to escape them with \, which is at least consistent with javascript |
What an obvious thing to miss, of course there's more explanation in the linked issue 😅. Thank you @MaxLeiter. Sorry @progval for not looking at that issue.
Since it's an implementation detail that isn't exposed to the user, I'm pretty indifferent to the actual escape character that's used. The forward slash would certainly be a bit more normal though so might cause a bit less confusion for folks reading the code 🤷♀️. |
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.
Looks good to me, thanks Val.
I don't care what the escape is, @ is fine and the variable naming doesn't leave much room for interpretation so 🤷
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.
Sorry for the delay. We're waiting to merge any more PRs until we make a release so this'll be sitting until then, but we'll merge this afterwards.
I did some quick testing just now to verify that %
and _
are treated literally in search queries. LGTM.
LGTM 🎉 thanks for your patience @progval! |
I picked '@' arbitrarily, it doesn't matter much.
I just don't like '' because it needs to be escaped itself in the JS code,
which is annoying.
Closes GH-4481