Datagrip language injection Follow
Answered
HI I like Jet-brains tools ever since I started using them many year ago and one features I like is language injection now I using Datagrip to work on an Oracle Apex application and a lot of the sql I need to write depends on a condition so I need to use oracle q'~ which is a string value to sql but it contains sql code.
So each day when I open Datagrip and I start to edit my code I have to use the mouse to rightclick the qualified string and use the context menu to inject oracle sql.
So my question is can I setup datagrip to always inject sql when it finds q'~ SOME CODE ~; I tried looking at the injection setting in datagrips settings but was not able to work out what I need to do.
Please sign in to leave a comment.
@jason kristian
Have you tried to add new injection in `Editor -> Language Injections`?

thank I know the setting page what my question was is how it works, I tried to copy one of the injection or sql type but I could not do it.
Example, So I want the start of my inject to be q'~ and the end to be ~'; and anything in between should be sql. But I could not find any docs on the regex that the setting pages uses.
There are some help topics:
Additionally, I created a ticket https://youtrack.jetbrains.com/issue/DBE-8330 based on your description.
Ive still not been able to do this. It looks like you need be an expert in PSI . I can not see a way to add this Ive looked that the injections that are there by default and from that I still have not been able to work out what to do. This is a common practise when working with oracle or oracle apex to have a function return a quoted string which is a query, I use this alot and I hate having to inject oracle sql into the quoted text via context menu each day as soon as I close Intelij or open and close projects all manually added injection get cleared.
The current method to add a injection seams very complicated that I could not work it out, I don't work on the open source Intelij project so having to know its internals to add a language injection.
Can someone please help I'm sure if you are a team member you would be able to do this real quick but there is no docs for every one else , the help files only tell you where to find the menus to create injection not how to create them.