Registry / database / gun-mysql

gun-mysql

JSON →
library0.0.5jsnpmunverified

A MySQL adapter for GunJS (Gun v0.x). Current version 0.0.5, pre-alpha status with unstable API and no test suite. Enables GunJS to persist data in MySQL by automatically creating and managing tables. Key differentiator: allows use of MySQL as a backend for GunJS instead of the default JSON file or LevelDB. Not recommended for production as the project is experimental and unmaintained (no recent updates). Release cadence: sporadic, no activity since 2017.

npm install gun-mysql
INSTALL
IMPORT
SIG · GUN-MYSQL
G
gun-mysql
databasejavascriptv0.0.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gun-mysql
require('gun-mysql')
import 'gun-mysql'
This is a side-effect module that must be required after gun and before new Gun(). ESM import may not work in some setups.
Gun
const Gun = require('gun')
import Gun from 'gun'
GunJS v0.x is CommonJS-only; ESM import may cause issues. Use require().
gun instance
const gun = new Gun({ mysql: { ... } })
const gun = new Gun({ mysql: true })
Passing true uses defaults; to customize supply an object with configuration.

Shows installation and basic setup of gun-mysql adapter with custom MySQL config.

// Install: npm install gun gun-mysql mysql const Gun = require('gun'); require('gun-mysql'); const http = require('http'); const server = http.createServer(); const gun = new Gun({ file: false, server: server, mysql: { host: 'localhost', port: '3306', user: 'root', password: '', database: 'gun_mysql', tablePrefix: 'gun_mysql', logger: console } }); // Use normally gun.get('test').put({ hello: 'world' }); server.listen(3000);
Debug
Known issues
breakingAPI unstable, not ready for production. Table creation and schema may change without notice.
fix
Do not use in production. Contribute to stabilize or use alternative adapters like gun-level.
affects: <=0.0.5
deprecatedPackage is unmaintained since 2017. No fixes or updates.
fix
Consider migrating to gun-level or gun-mongo adapter.
affects: all
gotchaRequires mysql npm package version 2.x; newer versions may cause conflicts.
fix
Install mysql@2 explicitly: npm install mysql@2
affects: >=0.0.5
gotchaMust require gun-mysql after require('gun') but before new Gun(). Order matters.
fix
Ensure require order: Gun, then gun-mysql, then new Gun()
affects: all
breakingNo test suite; data integrity not guaranteed. May lose data on crashes.
fix
Use with caution or implement custom backup.
affects: <=0.0.5
Errors
Common errors & fixes
Error: Cannot find module 'mysql'
Missing mysql dependency; gun-mysql does not list it as a direct dependency.
fix
Run: npm install mysql
Error: listen EADDRINUSE :::3000
Another process already using port 3000.
fix
Change server port: server.listen(3001) or kill the process using port 3000.
TypeError: Gun is not a constructor
Gun required after new Gun() call or import issue.
fix
Ensure const Gun = require('gun') is before new Gun(...).
Upgrade
Version history
0.0.5latest on npm
Audit
Dependencies
gunrequiredPeer dependency; adapter extends GunJS and must be loaded after Gun module
mysqlrequiredRequired for MySQL connectivity; npm mysql package is used internally
Agent activity
8 hits · last 30 days
node
8
Resources
gun-mysql — npm install gun-mysql · libregistry