How to deal properly with sql code in js file ?


when I edit a js file on pycharm, sql are strings such as 'INSERT INTO links (link_id, link_title) VALUES ($1, $2)' . Because of this  there is no auto-complete or syntax check. Also it's annoying when needing to split the statement over multiple line.

Is there any trick to have better sql statement in js file ?

Comment actions Permalink

PyCharm has language injections. This lets you open a .js file and, in the middle of it, change to another language inside a string.

Comment actions Permalink

thanks, that's what I needed !


Please sign in to leave a comment.