2

I'm taking my first steps in SQLite3 in Python using VSCode. My problem is when I use a SQL command there isn't any syntax highlighting.

enter image description here

Is there any way to get the syntax highlighting?

2
  • 1
    Your editor is using Python syntax highligthing, since you're writting Python. But from the Python point of view the SQL command is just a string, not different from "hello world" and the like. You won't get any syntax highligh within that (VSCode has no way to know that the string is actually a SQL command). Not coindicentally, this happens in all languages and editors. Commented Nov 29, 2021 at 12:56
  • This is supported in the pycharm editor by default. Will highlight any SQL strings and if you have a database connected to the editor, it will even give you autocomplete suggestions Commented Nov 24, 2022 at 10:12

2 Answers 2

2

It Seems that the SQL Command is just a String and all Editors Work this way and doesn't recognise code inside a String. Anyways found some VS-CODE Extensions that might be of help,

Python String SQL Highlight String Code

Sign up to request clarification or add additional context in comments.

Comments

2

Update Thank you for your answer, but I've found one way: using Sublime Text. example

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.