pg-admin-js
JS SDK for managing your PostgreSQL Database.
Install
$ npm install ...
Usage
var pgAdmin = require('pg-admin-js')
var connection = {
user: 'postgres',
password: '123',
host: 'localhost',
port: 5432,
database: 'thedb',
}
pgAdmin.toJSON(connection, 'public')
.then(({ tables, views, constraints, sequences, counts }) => {
// handle json object
console.log('tables', tables)
console.log('views', views)
console.log('constraints', constraints)
console.log('sequences', sequences)
console.log('counts', counts)
})
.catch(function(error) {
// handle error
})
License
MIT