Highsql is a TypeScript module that provides a high-level MySQL database utility built on top of mysql2/promise. Version 1.3.3 offers a promise-based interface with connection pooling, prepared statements, and convenience methods for common operations (SELECT, INSERT, UPDATE, DELETE) and transactions. Unlike raw mysql2 usage, highsql simplifies query construction and error handling with custom error classes. The library targets TypeScript developers who need a readable, secure wrapper without an ORM. Active development is moderate; the package has low weekly downloads and no recent releases, suggesting a maintenance phase. Key differentiators: built-in transaction scope, getByID shorthand, and underlying pool access.
npm install highsqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a connection, basic CRUD operations, and a transaction with highsql.
Always validate config object completeness before instantiation.
Use conn.close() instead of manually closing the pool.
Ensure your callback is async or returns a promise: async (conn) => { ... }Use rows.length === 0 to detect empty result.
Instead, create a plain object: const config: ConnectionConfig = { host: '...', user: '...', password: '...', database: '...' }Ensure you have run `npm install highsql mysql2` and added `import { Connection } from 'highsql'`.Run `npm install highsql` and check your import path: `import { Connection } from 'highsql'`