npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

migratory

v0.0.15-a

Published

A tool to migrate raw SQL files in a transactional manner

Downloads

25

Readme

Migratory

Imports SQL files into specified DB within a transaction.

For those of you that prefer to use SQL rather than ORMs, or you just have some DB dumps kicking around that you'd rather safely import via a transaction.

Can be used to populate structure, data or both.

Compatible with database dumps.

Supported RDBMS

  • Postgresql
  • MySQL

SQLite coming soon...

Usage:

Installation:

Preferred method of installation is globally via npm:

npm install -g migratory

Any projects in which you'd like to use Migratory, first run:

migratory init

This will create a base settings file (migratory.json) that looks something like this:


{
    "Destination Label": {
        "host": "",
        "database": "",
        "type": "",
        "schema": "",
     }
}

Destination Label: A User-Friendly label that you'll recognize as a server. Maybe "Dev", "QA", or "Production"

host: Server on which to deploy

database: Database on which your SQL commands will be executed

type: The Type of DB to connect to. Currently only supporting pgsql

schema: Optional. Search path to be set.

Credentials will be input at the time of migrations for security reasons.

You can add as many servers as you like into this json object; local or remote.

Once you're done, you're ready to use Migratory!

Running Migrations

Once you're all set up with your migratory.json file, you can run your deployments. You'll need to run these deployments from the directory that contains your migratory.js file.

migratory sqlFile1 sqlFile2

You will then be prompted to choose the database you wish to import the specified files into.

Once chosen, Migratory will import sqlFile1 and sqlFile2 into specified DB sequentially within a transaction.

There's no limit to the amount of files you can import in one command. If any errors are encountered, all changes will be rolled back.

Login Credentials

These will be asked upon migration for security purposes

Foreseeable updates:

  • Importing of all migrations in directory
  • Different import actions (up/down -- this will require directory structure, additional files)
  • Grunt / Gulp integration
  • SSL

Pull requests welcome.

version 0.0.14a