Coder Social home page Coder Social logo

copybase's Introduction

npm node downloads

About

Copybase is a database tool that helps you quickly copy a database. Simply define your databases config in a .copybaserc.yaml, and start copying or backuping them with a simple command line:

copybase copy staging local
copybase backup prod

Note: copybase uses the native tools to build command lines to launch. So you still need to install mysql, psql or mongo.

Getting Started

Installation

# install copybase globally
npm i -g copybase
# with yarn:
yarn global add copybase

# or locally
npm i copybase
# with yarn:
yarn add copybase

You also need to install the official db tools:

Configuration

Copybase uses cosmiconfig, so you just need to create a file .copybaserc.yaml (or .copybaserc.json, .copybaserc.js) with the following sample config:

backup:
  # output folder when you run the backup command
  folder: .backup
# list all databases you want to work with
databases:
  # sample config for localhost
  local:
    database: demo
    protocol: postgresql
    hostname: 127.0.0.1
    port: 54321
    username: demo
    password: password

  # sample config for a remote database, uring uri
  staging:
    uri: postgresql://demo:staging.example.com@localhost:54322/demo

Note: you can pass some extra parameters to the command line underneath. Look at .copybaserc.yaml in the current repository.

Usage

Usage: copybase [options] [command]

Copy quickly a database

Options:
-V, --version output the version number
-h, --help display help for command

Commands:
copy [options]          <fromDatabase> <toDatabase> Copy a database
list:tables [options]   <database> List all tables in database
backup [options]        <database> Backup a database
help [command]          display help for command

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.