Registry / database / dblink-mysql

dblink-mysql

JSON →
library1.3.3jsnpmunverified

MySQL handler for the Dblink database abstraction layer. Current stable version is 1.3.3. Provides a standardized interface for MySQL connections and queries within the Dblink ecosystem. Ships TypeScript types. Limited documentation suggests minimal usage outside of Dblink's framework. Release cadence is unknown.

npm install dblink-mysql
INSTALL
IMPORT
SIG · DBLINK-MYSQL
D
dblink-mysql
databasejavascriptv1.3.3
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.

default
import DblinkMySQL from 'dblink-mysql'
const DblinkMySQL = require('dblink-mysql')
ESM-only package, CommonJS require will fail.
MysqlHandler
import { MysqlHandler } from 'dblink-mysql'
import { MySQLHandler } from 'dblink-mysql'
Case-sensitive export name.
type MysqlConfig
import type { MysqlConfig } from 'dblink-mysql'
Use type import for TypeScript to avoid runtime inclusion.

Initializes a Dblink instance, adds the MySQL handler, connects with config from environment, runs a query, and closes the connection.

import DblinkMySQL from 'dblink-mysql'; import Dblink from 'dblink'; const db = new Dblink(); db.addHandler('mysql', DblinkMySQL); const config = { host: 'localhost', user: 'root', password: process.env.DB_PASSWORD ?? '', database: 'test' }; async function query() { const connection = await db.connect('mysql', config); const results = await connection.query('SELECT 1 + 1 AS solution'); console.log(results); await connection.close(); } query();
Debug
Known issues
gotchaThe MysqlHandler class is only usable when registered with Dblink; direct instantiation will fail.
fix
Always use Dblink.addHandler() to register the handler.
affects: >=1.0
deprecatedVersion 1.3.3 is currently the latest; check for newer versions as the package may have breaking changes.
fix
Upgrade to latest version if available.
affects: <=1.3.3
gotchaThe mysql2 driver is a peer dependency; missing it will cause runtime errors.
fix
Install mysql2: npm install mysql2
affects: >=1.0
Errors
Common errors & fixes
Cannot find module 'mysql2'
mysql2 is not installed as a dependency.
fix
Run: npm install mysql2
TypeError: db.addHandler is not a function
Missing Dblink import or incorrect usage.
fix
Ensure Dblink is imported correctly: import Dblink from 'dblink'
Error: No handler registered for 'mysql'
Handler not added before connect.
fix
Call db.addHandler('mysql', DblinkMySQL) before db.connect()
Upgrade
Version history
1.3.3latest on npm
Audit
Dependencies
dblinkrequiredcore library required for integration
mysql2requiredMySQL driver used internally
Agent activity
6 hits · last 30 days
node
6
Resources
dblink-mysql — npm install dblink-mysql · libregistry