Can Goland autocomplete SQL statements using other SQL packages?

问题: Goland is great at auto-completing SQL statements if I use the sql.DB package functions. For example, Goland will provide SQL autocompletion (including DDL data) in this...

问题:

Goland is great at auto-completing SQL statements if I use the sql.DB package functions.

For example, Goland will provide SQL autocompletion (including DDL data) in this setting:

result, err := someDB.Exec(`INSERT INTO <cursor here>`)

Can I configure Goland to show me SQL autocompletion in other contexts? For instance, I'm using github.com/jmoiron/sqlx and it has functions of the form:

err := someDB.Get(&user, `SELECT * FROM users WHERE email="%s"`, email)

In this second example, autocompletion wasn't triggered.

I can't find where/if this is configured in the Goland settings. Can I tell Goland which function parameters should be eligible for SQL autocompletion?


回答1:

You can use Alt + Enter inside the query and then use Inject Language and start typing the SQL dialect that you want to insert.

  • 发表于 2019-02-13 23:41
  • 阅读 ( 190 )
  • 分类:网络文章

条评论

请先 登录 后评论
不写代码的码农
小编

篇文章

作家榜 »

  1. 小编 文章
返回顶部
部分文章转自于网络,若有侵权请联系我们删除