0.0.5 • Published 7 years ago

gun-mysql v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Gun-MySQL

A MySQL adapter for GunJS.

WARNING: THIS IS NOT READY FOR PRODUCTION USE!! API unstable. Not fully tested.

Feel free to contribute and help get it ready for general use. :)

Installation

Before installing, ensure that you have created a database and given a database user access to read/write from that database, as well as create tables.

yarn add gun-mysql or npm install gun-mysql.

const Gun = require('gun');

// Must be added after Gun but before instantiating Gun
require('gun-mysql');

// Instantiate Gun
const gun = new Gun({
    file: false,
    server: httpServer,

    // The following are defaults. You can supply `true` to use all defaults
    mysql: {
        host: 'localhost',
        port: '3306',
        user: 'root',
        password: '',
        database: 'gun_mysql',
        tablePrefix: 'gun_mysql',
        logger: console // default logger
    }
});

You should start to see the table fill up with data from your Gun database!

TODO

  1. Test suite
  2. Queue transactional batch writes by key
0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago