Code Monkey home page Code Monkey logo

snap's Introduction

#Snap Version control for database schemas.


Overview

Snap is a proof of concept tool to start exploring version control for database schemas. Usually when maintaining and updating database schemas over multiple environments things start to get confusing very quickly. Snap is a tool inspired by git allowing you to manage and interrogate snap managed databases.

โš ๏ธ This tool is still very much in alpha stage. Please don't use it for business critical databases as data loss may occur.

Installation

Make sure you have Go installed and correctly configured then issue the following command:

go install github.com/nomad-software/snap

Configuration

A configuration file must exist in your home directory to configure the database server connection. The config file should be called .snap and look like this:

{
    "identity": "Gary Willoughby <[email protected]>",
    "database": {
        "user": "foo",
        "password": "bar",
        "protocol": "tcp",
        "host": "localhost",
        "port": "3306"
    }
}

The database protocol, host and port fields are optional and default to the values shown above.

Usage

Snap is invoked on the command line by using the program name followed by a command and any required arguments. Some commands have optional arguments too.

snap command <arguments...> [optional]

The following is an overview of each command. To read the entire command documentation see snap's built-in help.

Command Description
commit Commit changes to a schema.
copy Copy a database from a specified revision.
diff Show differences between schema revisions.
dump Dump the entire schema at a specified revision.
help View the help.
init Initialise a database for use with snap.
list List all managed databases.
log Show a log of changes to a database schema.
show Show the changes made at a specified schema revision.
update Update a database schema to any previously commit change.
clear lear specified database's all revision.
version Show version information.

Built-in help

Full help is available from within the program, viewable after issuing the command:

snap help

Further command specific help is available by specifing the command too, like this:

snap help init

Supported environments

  • Currently only MySql databases are supported.
  • Because of reliance on the external diff tool, only Posix environments are currently supported.

snap's People

Contributors

arstercz avatar

Watchers

 avatar

Forkers

fastluo rinetd

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.