How to deal properly with sql code in js file ?

Hi,

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 ?

2 comments

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

1

thanks, that's what I needed !

0

Please sign in to leave a comment.