Have ideas to improve npm?Join in the discussion! »

    mysql2json

    1.0.0 • Public • Published
    Promises/A+ logo

    mysql2json

    This module loads mysql meta data and returns it as json.

    Build Status

    Usage

    CLI

    1. create a config file:
    {
        "charset": "utf8",
        "database": "heinzel",
        "host": "127.0.0.1",
        "user": "user",
        "password": "password"
    }
    1. use the cli
    node bin\cli.js -c configFile -o outputFile
    

    use help (-h / -help) for more information 3. select desired table

    Node module


    var mysql2json = require('mysql2json');
     
    //1. Setup connection
    mysql2json.connect({
        charset: 'utf8',
        database: 'test',
        host: '127.0.0.1',
        user: 'user',
        password: 'password'
    });
     
    //2. Get tables
    mysql2json.getTables()
        .then(onTablesRead)
        .fail(onError);
     
    //3. Get columns
    mysql2json.getColumns('tableName')
        .then(onColumnsRead)
        .fail(onError);
     
    //4. Get relations
    mysql2json.getRelations('tableName')
        .then(onRelationsRead)
        .fail(onError);

    Keywords

    none

    Install

    npm i mysql2json

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • avatar