postgres_backup

1.0.1 • Public • Published

pg_backup

This will backup the postgres function or store procedure or table create script to separate file for each table and function for all the schema or particular schema.

Installation

Using npm:

npm install postgres_backup

Using yarn:

yarn add postgres_backup

Notes

This project will create backup directory at the root of your project folder.

Example

Initialize the pg_backup

const pg_backup = require('postgres_backup');
const pgConfig = {
  databaseName: 'require',
  userName: 'require',
  host: 'require',
  password: 'require',
  schema_name: 'optional',
  port: 'optional',
};
const pgClient = new pg_backup(pgConfig);

NOTE: You can pass the directory name as second argument for the the pg_backup(pgConfig,dirname)

Get the store-procedure or functions:

pgClient.getStoreProcedure();

Get the table structure:

pgClient.getTableStructure();

License

MIT

Package Sidebar

Install

npm i postgres_backup

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

10.3 kB

Total Files

4

Last publish

Collaborators

  • sakthivel9963