如何使用json-sql与postgresql?

我正在尝试使用json-sql npm模块postgres。 但我甚至无法做到select。

我认为,问题是从json-sql查询包含$ p1而不是$ 1。 我需要调整才能从json-sql获取类似于postgres的查询?

我试图使用{dialect:'postgresql'}configuration选项,但仍然有一个问题。

由于以下代码:

let userCompSql = jsonSql.build({ type: 'select', fields: ['id'], table: 'user_computers', condition: { 'os_name' : params.osName, 'os_minor' : params.osVersionMinor }}) 

我得到一个stringuserCompSql: select_id ”from“user_computers”其中“os_name”= $ p1和“os_minor”= 0;“ 但我希望有$ 1而不是$ p1为我的postgresql数据库。

那太容易了 只要configuration{namedValues:false} …