SQL Tick marks not highlighting as a string
See original GitHub issueInformation
- Language: SQL, MySQL
- Plugins: none
Description
When using `
marks to surround a keyword, the word should be formatted as a string.
Adding a tick to this fixes the issue:
Prism.languages.sql = {
'string': {
pattern: /(^|[^@\\])("|'|`)(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/,
greedy: true,
lookbehind: true
},
}
The code being highlighted incorrectly.
select
`t`.`col1`, `t`.`col2`, `t`.`col3`, `t`.`col4`
from
`test_table` as `t`
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Tick marks in Sql Statements - MSDN - Microsoft
It's stored and processed as a single tick. I'm updating a table with about 12,000 records and I'm doing it with variables.
Read more >When to use single quotes, double quotes, and backticks in ...
Backticks are to be used for table and column identifiers, but are only necessary when the identifier is a MySQL reserved keyword, ...
Read more >PL/SQL statement returning a query — oracle-tech
My problem is the tick marks in the query. I can't seem to get them right because the entire SQL statement has to...
Read more >SET QUOTED_IDENTIFIER settings in SQL Server
This article gives an overview of the QUOTED_IDENTIFIER set option and its behaviour in SQL Server queries with single and double-quotes.
Read more >5 shortcuts in SQL Prompt you didn't know about
END block, or a TRY…CATCH block. These snippets utilise the $SELECTEDTEXT$ placeholder, so highlight your block of code, hit Ctrl and type BE...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s the way to go. You can always change and extend Prism’s themes if they aren’t to your liking 😃
It’s an identifier, so I am somewhat against highlighting it differently from other identifiers. E.g.
Foo
and`Foo`
are two different ways to refer to the same column/table/user. The only difference is that quoted identifiers support special characters, non-ASCII characters, and keywords. E.g.`Foo*`
,`😊`
,`SELECT`
.(There are also a few other languages that have quoted identifiers like this.)