📅  最后修改于: 2022-03-11 15:05:02.339000             🧑  作者: Mango
const sql = require('yesql')('/myproject/sql/', {type: 'pg'})
const named = require('yesql').pg
const pg = require('pg').connect...
// read from file
pg.query(sql.updatePokemon({price: 5}), (err, result) => {...})
// use only named parameters
pg.query(named('UPDATE pokemon SET price = :price;')({price: 5}), (err, result) => {...})