Registry / database / ts-db-helper-mysql-connector

ts-db-helper-mysql-connector

JSON →
library0.0.20jsnpmunverified

MySQL database connector for the ts-db-helper ORM ecosystem, version 0.0.20. This package provides a thin wrapper around the mysql2 driver to integrate with ts-db-helper's schema-based query builder. It is a low-level connector in the ts-db-helper family, intended to be used alongside the core ORM library. The library ships TypeScript type definitions and supports connection pooling and prepared statements. Release cadence appears irregular as it is still in early development (pre-1.0). Compared to standalone ORMs like Sequelize or TypeORM, this connector is tightly coupled to ts-db-helper and not recommended for general-purpose use.

npm install ts-db-helper-mysql-connector
INSTALL
IMPORT
SIG · TS-DB-HELPER-MYSQL
T
ts-db-helper-mysql-connector
databasejavascriptv0.0.20
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 TsDbHelperMySQLConnector from 'ts-db-helper-mysql-connector'
const TsDbHelperMySQLConnector = require('ts-db-helper-mysql-connector')
Package uses default export; named exports may not exist. CommonJS require may work but TypeScript expects ES module syntax.
MySQLConnector
import { MySQLConnector } from 'ts-db-helper-mysql-connector'
import MySQLConnector from 'ts-db-helper-mysql-connector'
Named export 'MySQLConnector' is the class; default export may be undefined.
ConnectionConfig
import { ConnectionConfig } from 'ts-db-helper-mysql-connector'
import { Config } from 'ts-db-helper-mysql-connector'
Type/interface for connection configuration, exported as named export 'ConnectionConfig'.

Creates a MySQL connector, obtains a connection from the pool, executes a simple query, and releases the connection.

import { MySQLConnector } from 'ts-db-helper-mysql-connector'; const connector = new MySQLConnector({ host: process.env.DB_HOST ?? 'localhost', user: process.env.DB_USER ?? 'root', password: process.env.DB_PASSWORD ?? '', database: process.env.DB_NAME ?? 'test' }); async function run() { const connection = await connector.getConnection(); const [rows] = await connection.query('SELECT 1 + 1 AS solution'); console.log(rows); connection.release(); } run().catch(console.error);
Debug
Known issues
gotchaPackage version 0.0.20 is pre-release; API may change without notice.
fix
Lock dependency to exact version and test upgrades carefully.
affects: >=0.0.0 <1.0.0
deprecatedThe 'getConnection' method may be deprecated in favor of 'pool.getConnection' directly.
fix
Use 'connector.pool.getConnection()' if direct pool access is needed.
affects: >=0.0.0
gotchaDefault export behavior is ambiguous; importing the default may result in undefined.
fix
Use named import '{ MySQLConnector }' instead of default.
affects: >=0.0.1
breakingConfiguration object properties changed between versions (no explicit changelog).
fix
Check the source or node_modules for the exact shape; use TypeScript types if available.
affects: >=0.0.10
Errors
Common errors & fixes
Cannot find module 'mysql2'
Missing mysql2 dependency; this package does not install it automatically.
fix
Run: npm install mysql2
Cannot read properties of undefined (reading 'query')
Connector not properly initialized or getConnection returned undefined.
fix
Ensure MySQLConnector is constructed with valid config and the pool is created.
default is not a constructor
Using default import when package exports a default that is not a constructor.
fix
Use named import: import { MySQLConnector } from 'ts-db-helper-mysql-connector'
TypeError: connector.getConnection is not a function
Using an older version of the connector where getConnection does not exist.
fix
Update package or use pool.getConnection() directly.
Upgrade
Version history
0.0.20latest on npm
Audit
Dependencies
mysql2requiredUnderlying MySQL driver for connection and queries
ts-db-helperrequiredPeer dependency for ORM integration; not listed as a dependency but required
Agent activity
19 hits · last 30 days
node
14
OpenAI (training)
2
Meta
1
Amazon
1
Resources
ts-db-helper-mysql-connector — npm install ts-db-helper-mysql-connector · libregistry