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