
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
pg-view-grabber
Advanced tools
Grab view information from a Postgres database.
Install the module with:
npm install pg-view-grabber --save
You’ll need to pass in Postgres connection info that will be passed to pg’s Client constructor. This can either be a connection string (Ex: postgres://username:password@localhost/database) or an object:
var myConfig = {
database: 'postgres',
host: 'localhost',
password: '',
port: 5432,
user: 'root',
};
Then, pass it in like so:
var pgViewGrabber = require('pg-view-grabber');
pgViewGrabber.config(myConfig);
You’re ready to get started!
These methods hang off the main pg-view-grabber module:
pgViewGrabber.config(clientConfig)clientConfig (object or string): database configuration passed to pg’s ClientundefinedpgViewGrabber.fromTable(tableName)tableName (string): name of table for which to find dependent viewsPromise that resolves to an array of ‘view data’ objects with the following keys:
viewData.definition: the view's SQL definitionviewData.permissions: the view's owner and permissions SQLviewData.schema: the view's schema nameviewData.viewName: the view name itselfpgViewGrabber.fromView(viewName)viewName (string): name of view for which to find dependent viewsPromise that resolves to an array of 'view data' objectsAll Liquibase methods have the same argument object:
options (object):
options.name (string): Name of table or viewoptions.author (optional string): “author” for the migration fileoptions.formatFilename (optional function): a function responsible for formatting each migration file's filename. It’s passed a filenameOptions object with the following keys:
filenameOptions.authorfilenameOptions.idfilenameOptions.schemafilenameOptions.viewNameoptions.id (optional string or number): changeset “id” for the migration filepgViewGrabber.getTableMigration(options)Promise that resolves to an array of Liquibase migration templatespgViewGrabber.getViewMigration(options)Promise that resolves to an array of Liquibase migration templatespgViewGrabber.saveTableMigration(options)Promise that resolves to an array of empty values when all migration files are writtenpgViewGrabber.saveViewMigration(options)Promise that resolves to an array of empty values when all migration files are writtenTesting assumes you’re on the MRN VPN and you have a valid database map in /coins/coins_auth/conn/dbmap.json. Run tests with npm test. Run linting with npm run lint.
FAQs
Grab view information from a Postgres database.
We found that pg-view-grabber demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.