I want to know if there is a way to activate the sql tree-sitter while making queries in the vim-dadbod-ui. Currently I only get a different color for keywords, but it is still much different from what you get when opening an actual .sql file, If someone know something related to this topic please let me know.
I tried reading the documentation but there was nothing related that could help me.

I haven't worked with
vim-dadbod-uibefore, but I've had similar use cases. Treesitter operates by attaching the parser based on file types (as per my understanding). To apply SQL parsing (and highlighting) to these files, you need to inform Treesitter explicitly to do so.Simplest method first
Requires Neovim >= 0.9.0
:echo &filetypewith the buffer open and focused.<vim-dadbod-ui-query-filetype>(If not, this approach won't work, move on to the next one).This is mentioned in the Tree-sitter README.
Neovim should treat it as SQL
If the previous approach did not work, it means you do not have a filetype associated with these files. So, you would have to explicitly assign it a SQL filetype. To do this, we tell Neovim filetype for such files using vim.filetype.add(). Assuming it's a pattern that consistently includes the
-query-field and lacks an extension (basically a.after-query-) and we want it to be treated asSQLby Neovim (and Treesitter):Note: This approach also activates any plugins designed to work with SQL, such as formatters and/or linters, specified in your Neovim configuration.
Only Tree-sitter should treat it as SQL
Requires Neovim >= 0.9.0
If you would rather not prefer this, you have to assign such a files a custom filetype, and tell Treesitter to use
SQLparser to parse these files.The shared pattern should match with the filename in the screenshot, but you might have to adjust it to match your exact needs. Additionally, various other methods exist for specifying how to apply filetypes. One of them might suit your needs better.