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');
require('gun-mysql');
const gun = new Gun({
file: false,
server: httpServer,
mysql: {
host: 'localhost',
port: '3306',
user: 'root',
password: '',
database: 'gun_mysql',
tablePrefix: 'gun_mysql',
logger: console
}
});
You should start to see the table fill up with data from your Gun database!
TODO
- Test suite
- Queue transactional batch writes by key