Is your feature request related to a problem? Please describe.
The problem is that I can't require() a .sql text file in a nodejs project. So, my sql files have to be attached to my db wrapper dynamically at runtime via fs.readFile()
And since the sql text is loaded at runtime, I lose control+click abilities when debugging in vscode. For example, If i inspect the definition of my method called db.getUsers(), it won't go directly to the SQL source.
Describe the solution you'd like
I like to have codelens intellisense working in js files, more specifically working in a template literal.
Maybe if there was some custom identifiers that I could put into my js string to identify a block of text as SQL.
Then when i need to retrieve it: const { sql } = require("./users.sql.js");
I use the /* sql */ before the backticks currently because it enables basic syntax highlighting by using this Comment tagged templates extension. Maybe that extension has clues into how to enable it in this project.
My current result gives me syntax highlighting but it does not give me all the other cool features that comes with sqltools
We use PGTyped with the sql tag and would love to see this kind of feature as well. In IntelliJ it works perfectly so that might be a good inspiration to look at?
Is your feature request related to a problem? Please describe.
The problem is that I can't require() a .sql text file in a nodejs project. So, my sql files have to be attached to my db wrapper dynamically at runtime via fs.readFile()
And since the sql text is loaded at runtime, I lose control+click abilities when debugging in vscode. For example, If i inspect the definition of my method called db.getUsers(), it won't go directly to the SQL source.
Describe the solution you'd like
I like to have codelens intellisense working in js files, more specifically working in a template literal.
Maybe if there was some custom identifiers that I could put into my js string to identify a block of text as SQL.
For example maybe something like:
Then allow codelens autocomplete in the SQL Block
Describe alternatives you've considered
RIght now, I create my sql file wrapped in JS:
Then when i need to retrieve it:
const { sql } = require("./users.sql.js");
I use the
/* sql */
before the backticks currently because it enables basic syntax highlighting by using this Comment tagged templates extension. Maybe that extension has clues into how to enable it in this project.My current result gives me syntax highlighting but it does not give me all the other cool features that comes with sqltools