A TypeScript-friendly MySQL query builder and connection manager (v2.2.2) providing a chained API for INSERT, DELETE, UPDATE, SELECT operations with built-in connection pooling, once-off connections, keep-alive connections, and debug/reconnect configuration. Ships TypeScript definitions. Peer dependencies include mysql (^2.18.1) and ts-toolbelt (^9.6.0). Differentiates from knex by being simpler, lightweight, and targeted at quick integration with a minimal API surface. Release cadence appears irregular.
npm install dlovely-mysqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a pool connection, perform an INSERT and a SELECT with WHERE, using TypeScript generics.
Run npm install mysql ts-toolbelt
Use MySQLPool instead.
Use MySQLPool(options) instead of new MySQLPool(options).
Use await mysql('table').insert({col: 'val'}).get()Use .get<{id: number; name: string}>() which returns an array.Pass options as separate argument: MySQLPool(dbConfig, { debugger: true })Use MySQLOnce with maxReconnectTime if reconnection is needed.
Run 'npm install dlovely-mysql mysql ts-toolbelt' and ensure tsconfig.json includes 'moduleResolution': 'node'.
Use mysql('tablename').insert() instead of mysql.insert()Use MySQLPool(config, { debugger: true }) not MySQLPool(config, true)Do not use generics on insert/delete/update; they return OkPacket.
Use 'import { SQL } from 'dlovely-mysql';' and not 'import type { SQL } ...'