Skip to content

m4nu56/pg-schema-restorer

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 

Postgres Schema Restorer

Node.js Package

CLI Tool to simplify restoring schema into local database.

It will look for backup files in your ~/Documents and ~/Downloads directory and let you select which one to restore.

It will then drop the existing schemas and restore the backup

Stores the database credentials into a local json to simplify the use of the tool.

./assets/demo.gif

Inspiration

Fully inspired (to not say copy/pasted) from this post by Lukas White and James Hibbard: Build a JavaScript Command Line Interface (CLI) with Node.js

It's a common task in my current position to have to download and restore client schema on my local postgres to debug it so reading their post inspired me to build this small tool.

How to install

npm i -g: this will install the pg-schema-restorer globally.

Alternatively you can simply install it locally with npm i and run it inside the directory.

How to use

If installed globally just run in the command prompt:

> pg-schema-restorer

Or else > npm start

Help needed

Haven't tested it on MacOS or Windows.