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

keywords in quotes #69

Open
spluque opened this issue Dec 4, 2017 · 3 comments
Open

keywords in quotes #69

spluque opened this issue Dec 4, 2017 · 3 comments

Comments

@spluque
Copy link

spluque commented Dec 4, 2017

I noticed that keywords get capitalized when in double quotes, e.g. to escape keywords in column names. It would be nice to have an option or mechanism to avoid capitalization of double-quoted keywords for these cases.

I'm using the latest melpa version (20170610.837) on Emacs 25.2.2.

@Trevoke
Copy link
Owner

Trevoke commented Dec 7, 2017

Hi, and thank you for the feature request! Yeah, I think that's a good idea. I'm not sure I can provide you with an ETA for the code though. As always, pull requests welcome (and if you have never done work on emacs-lisp or in code and you want to get started, let me know and I'll do my best to help you get going).

@davidshepherd7
Copy link
Contributor

The cause of this seems to be that by default sql-mode doesn't think double-quotes count as a quoting character in sql.

You tell it that they are quotes by doing: (modify-syntax-entry ?" "\"" sql-mode-syntax-table). Then sqlup seems to work as expected. This might have other consequences that I haven't thought of, but it should be safe.

@alandmoore
Copy link

While @davidshepherd7 's fix does work, it's not quite ideal as it causes quoted identifiers to be highlighted as string literals. Given how easy it is to accidentally use the wrong quotes in SQL (especially coming from languages where it doesn't matter), it would be better if we didn't have to lose that distinction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants