context menu, editing connection

This commit is contained in:
Jan Prochazka
2020-01-04 15:09:03 +01:00
parent b6599803b7
commit 4c52e1eb27
12 changed files with 439 additions and 15 deletions

View File

@@ -0,0 +1,10 @@
const { Client } = require('pg');
module.exports = async function connect({ server, port, user, password }) {
const client = new Client({ host: server, port, user, password, database: 'postgres' });
await client.connect();
const res = await client.query('SELECT version()');
const { version } = res.rows[0];
await client.end();
return { version };
};