'use strict';


const { finalize } = require('rxjs/operators');
const { Pool } = require('pg');
//const RxSQL = require('@rough/rx-pg');
const RxSql = require('../index.js');

const pool = new Pool({
  host: 'localhost',
  user: 'agens',
  password: 'agens',
  database: 'agens',
  max: 50,
  idleTimeoutMillis: 30000,
  connectionTimeoutMillis: 2000
});

const rxsql = new RxSql(pool);

rxsql
  .query('match (r:person) return r.id, r.email')
  .pipe(finalize(_ => pool.end()))
  .subscribe(result => console.log(result));
