MySQL wrapper for ThinkJS framework (v1.4.4, latest). Provides promise-based query/execute methods, connection pooling, transaction support, and logging. Built on mysqljs/mysql. Lightweight alternative to Sequelize/TypeORM for ThinkJS apps. Last updated in 2020; stable but low maintenance.
npm install think-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating an instance, executing DDL/INSERT, and querying rows with parameterized queries.
Explicitly set 'multipleStatements: false' if not needed, or ensure all statements are parameterized.
Always use async/await or .catch() on promises.
Increase 'connectionLimit' to 10 or more based on workload.
Run 'npm install think-mysql' and ensure import uses default import.
Use 'import mysql from 'think-mysql'' (ESM) or 'const mysql = require('think-mysql')' (CJS).Check DB_HOST, DB_USER, DB_PASS environment variables or config object.