UNPKG

rdb-demo

Version:
16 lines (14 loc) 412 B
let rdb = require('rdb'); let resetDemo = require('./db/resetDemo'); let poolOptions = {size: 20}; let db = rdb('postgres://rdb:rdb@localhost/rdbdemo', poolOptions); module.exports = async function() { try { await resetDemo(); await db.transaction(async () => { //transaction will commit after this function }); } catch (e) { console.log(e.stack); } }();