@faasjs/provider-postgresql
PostgreSQL 适配
How to use?
- Add npm to package.json:
yarn add @faasjs/provider-postgresql@beta
; - Config connection info in providers folder, support host, user, password and database;
- Use it in flow:
new Flow({
resources: {
postgresql: {}
}
}, async function(){
const results = await this.postgresql.query('SELECT user from id = ?', ['1']);
console.log(results[0].id); // => 1
})