I wanted to know if anyone is using Visual Studio Code to write SQL queries for Ignition projects. Specifically, I am looking for a way to:
Write SQL queries directly in Visual Studio Code.
Automatically create a named query within the Ignition project upon saving.
Easily modify existing named queries through the same setup.
I tried adding the Ignition project folder as a workspace in Visual Studio Code, but I encountered an issue when attempting to save the query file. It gives me an error saying "Insufficient Permission, retry as Administrator."
Has anyone else tried this workflow? If so, how did you overcome this issue? Any tips or tools you recommend for better integration between Visual Studio Code and Ignition for handling named queries?
I would also like to use the same approach for python scripts later.
I don't think this is an idea worth pursuing. Ignition's named queries have their own parameter syntax which is unlikely to work in Visual Studio. In addition,
Your best bet would be to develop your SQL in whatever environment you want and then paste it into Ignition's Named Query editor, fix the parameters and test it there.
Regarding your error message, the user that VSC is running under doesn't appear to have rights to the Ignition folder. That's a Windows permissions issue.
@kgamble's Flint extension supports easier editing for project library scripts and Perspective scripts. You could probably ask him/file a PR against the repo adding support for editing named queries in their modern saved representation, since it's just a .sql file and some metadata in the resource.json.