What triggers SQL language injection


When I write SQL queries in my Go code i sometimes get automatic language injection and sometimes not.

I am aware of the magic comment // language=...

How do I configure this so that it works in new cases ?



Official comment

Hi Thomas,


Can you please describe the cases when the automatic highlighting doesn't work?

We support the standard database/sql, jmoiron/sqlx and markbates/pop packages for now.

As for how to make it work in cases we don't have this automatically done, then use the `// language=` comments


It doesn't work when I use https://godoc.org/github.com/jmoiron/sqlx#Select instead of https://godoc.org/github.com/jmoiron/sqlx#DB.Select

Moreover, I would like to develop some sort of dynamic SQL composition language that lives in SQL comments, so I might have my own functions to query, sometime.


Please sign in to leave a comment.