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

dbconvert

v0.2.3

Published

Convert your database to a new database.

Downloads

18

Readme

Note: DB Convert is currently under development and not ready for productional use!

DB Convert

Coverage Status Build Status Code Climate Dependency Status devDependency
Status

DB Convert helps to transfer one database to a different type of database, for example a MySQL database to a MongoDB. DB Convert allows to run a full conversion with relation building or just the single steps. DB Convert also have a rollback functionality. Usable as command line tool or in your code.

Available via NPM

  • npm install -g dbconvert

Quick Example

Bash with DB Convert as global package with config.json in same directory

dbconvert con

In your project

var DbConvert = require('dbconvert');
var config = {
  //your config goes here
};

var dbc = new DbConvert().load(config);
dbc.convert();

Usage

To run DB Convert you need at least to configure the toHost and the fromHost. This can be done in a config.json in the directory you want to run DB Convert or you insert the path to the file in the --config argument. If you want to remap your tables/collections or columns/fields you need a mapping.js with all the mapping information. Same thing for relations. Examples of the files can be found in the example folder.

Convert

dbconvert con [options] || dbconvert convert [options]

convert options

-h, --help                                           output usage information
--sync                                               Run migration in synchrone mode.
--table [table]                                      Run migration for a single table.
--drop                                               Drop collections/tables if they exist on destination host.
--quiet                                              No output except of errors.
--log [level]                                        Define a log level [level].
--logPath [path]                                     Specify a log path (default: cwd).
--fromHost [[protocol://][user:password@]host:port/database]  Connection string for the host to migrate from.
--toHost [[protocol://][user:password@]host:port/database]    Connection string for the host to migrate to.
--config [path]                                      path to your config.json
--mapping [path]                                     path to your mapping.js
--relation [path]                                    path to your relation.js

Migrate

dbconvert mig [options] || dbconvert migrate [options]

migrate options

-h, --help                                           output usage information
--sync                                               Run migration in synchrone mode.
--table [table]                                      Run migration for a single table.
--drop                                               Drop collections/tables if they exist.
--quiet                                              No output except of errors.
--log [level]                                        Define a log level [level].
--logPath [path]                                     Specify a log path (default: cwd).
--fromHost [[protocol://][user:password@]host:port/database]  Connection string for the host to migrate from.
--toHost [[protocol://][user:password@]host:porthost:port/database]                 Connection string for the host to migrate to.
--config [path]                                      path to your config.json

Relations

dbconvert rel [options] || dbconvert relation [options]

relation options

-h, --help                                         output usage information
--sync                                             Run migration in synchrone mode.
--table [table]                                    Run migration for a single table.
--quiet                                            No output except of errors.
--log [level]                                      Define a log level [level].
--logPath [path]                                   Specify a log path (default: cwd).
--toHost [[protocol://][user:password@]host:port/database]  Connection string for the host to migrate to.
--config [path]                                    path to your config.json

Rollback

dbconvert rb [options] || dbconvert rollback [options]

rollback options

-h, --help                                                    output usage information
--table [table]                                               Run migration for a single table.
--quiet                                                       No output except of errors.
--log [level]                                                 Define a log level [level].
--logPath [path]                                              Specify a log path (default: cwd).
--toHost [[protocol://][user:password@]host:port/database]    Connection string for the host to migrate to.
--config [path]                                               path to your config.json

To show the help text

dbconvert help

License

MIT License Copyright © 2016 Dominic Rico-Gomez

forthebadge