Registry / database / leo-connector-mysql

leo-connector-mysql

JSON →
library3.0.2jsnpmunverified

A MySQL database connector designed specifically for the Leo Platform. Version 3.0.2 is current. It provides a streamlined way to connect MySQL databases to Leo Platform workflows, handling connection pooling and query execution. Unlike generic MySQL clients, this package integrates seamlessly with Leo's data pipeline abstractions and configuration management. Releases follow Leo connectors' cadence. Supports modern MySQL features.

npm install leo-connector-mysql
INSTALL
IMPORT
SIG · LEO-CONNECTOR-MYSQ
L
leo-connector-mysql
databasejavascriptv3.0.2
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 LeoMySQL from 'leo-connector-mysql'
const LeoMySQL = require('leo-connector-mysql')
ESM default import; CJS require may fail if package is ESM-only.
ConnectionConfig
import { ConnectionConfig } from 'leo-connector-mysql'
import ConnectionConfig from 'leo-connector-mysql'
Named export for TypeScript type definitions.
runQuery
import { runQuery } from 'leo-connector-mysql'
const { runQuery } = require('leo-connector-mysql')
Named function export; CJS destructuring may fail if module is ESM.

Shows creating a MySQL client with credentials from env, running a query, and closing connection.

import LeoMySQL from 'leo-connector-mysql'; const client = new LeoMySQL({ host: 'localhost', user: 'root', password: process.env.MYSQL_PASSWORD ?? '', database: 'test_db' }); async function main() { try { const result = await client.query('SELECT 1 AS solution'); console.log(result); } catch (err) { console.error(err); } finally { await client.close(); } } main();
Debug
Known issues
breakingVersion 3.0 switched from callback-based to Promise-based API. All callbacks will not work.
fix
Replace callback usage with async/await or .then().
affects: >=3.0.0
breakingESM-only since v3.0.0. CommonJS require() will throw an error.
fix
Use import syntax instead of require().
affects: >=3.0.0
breakingDefault export changed from constructor to object in v3.0.0.
fix
Use 'import LeoMySQL from ...' and construct with 'new LeoMySQL(...)' as per docs.
affects: >=3.0.0
deprecatedMethod 'connect()' is deprecated in v3.0.0. Use the client constructor options instead.
fix
Remove explicit connect() calls; pass connection config to constructor.
affects: >=3.0.0
gotchaConnection pool is not lazy; constructor immediately attempts connection. If credentials are invalid, it throws synchronously.
fix
Wrap constructor in try/catch or validate credentials before instantiation.
affects: >=3.0.0
Errors
Common errors & fixes
Error: Cannot find module 'leo-connector-mysql'
Package not installed or not in node_modules.
fix
Run 'npm install leo-connector-mysql' or 'yarn add leo-connector-mysql'.
TypeError: leo_connector_mysql_1.default is not a constructor
Incorrect import style when using TypeScript with allowSyntheticDefaultImports settings.
fix
Use 'import * as LeoMySQL from 'leo-connector-mysql'' or reconfigure TypeScript.
Error: listen EADDRINUSE :::3306
Port 3306 is already in use by another MySQL instance.
fix
Stop other MySQL processes or specify a different port in connection config.
Upgrade
Version history
3.0.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
leo-connector-mysql — npm install leo-connector-mysql · libregistry