If you are using Neovim with Treesitter, you can use query injections to highlight SQL in Rust strings.
To do so, create a queries folder in your Neovim runtime path:
mkdir -p ~/.config/nvim/after/queries/rust
cd ~/.config/nvim/after/queries/rust
Then create a file called injections.scm
in that folder and paste this content there:
|
|
Restart your Neovim. After opening Rust files with SQL strings, they will have syntax highlighting.
You can see how it looks like in the screenshot below: