Registry / database / mysql-kiss-orm

mysql-kiss-orm

JSON →
library0.4.5jsnpmunverified

A minimal, promise-based ORM wrapper for node-mysql2 (v0.4.5, last updated 2020). Provides a simple async/await API for CRUD operations (insert, update, delete, find, count) and raw queries. Requires Node >=8.12 and mysql2 as peer dependency. Smaller than Sequelize or TypeORM, but lacks schema migrations, relationships, and TypeScript types. The package is in maintenance mode with limited community support.

npm install mysql-kiss-orm
INSTALL
IMPORT
SIG · MYSQL-KISS-ORM
M
mysql-kiss-orm
databasejavascriptv0.4.5
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.

MysqlConnector
const { MysqlConnector } = require('mysql-kiss-orm')
import { MysqlConnector } from 'mysql-kiss-orm'
The package is CJS-only; no ES module exports. Named import via destructuring.
default
const kissOrm = require('mysql-kiss-orm')
import kissOrm from 'mysql-kiss-orm'
No default export; require returns an object with MysqlConnector property.
MysqlConnector
const MysqlConnector = require('mysql-kiss-orm').MysqlConnector
const { MysqlConnector } = require('mysql-kiss-orm')
Both work, but destructuring is idiomatic CommonJS.

Demonstrates connecting, inserting one record, querying with limit/sort, and disconnecting.

const { MysqlConnector } = require('mysql-kiss-orm'); const mysql = new MysqlConnector({ host: process.env.MYSQL_HOST || 'localhost', user: process.env.MYSQL_USER || 'root', password: process.env.MYSQL_PASSWORD || '', database: process.env.MYSQL_DATABASE || '' }); async function example() { await mysql.connect(); const insertResult = await mysql.insertOne('users', { name: 'Jane Doe', email: 'jane@example.com' }); console.log('Inserted ID:', insertResult.insertId); const users = await mysql.findMany('users', {}, { limit: 5, sort: { name: 'ASC' } }); console.log('Users:', users); await mysql.disconnect(); } example().catch(console.error);
Debug
Known issues
deprecatedPackage has not been updated since Jan 2020 and is considered legacy. It lacks modern features like connection pooling configuration through the constructor.
fix
Consider migrating to TypeORM, Sequelize, or Knex for active maintenance and full TypeScript support.
affects: >=0.0.0
gotchaThe package uses callback-style CJS exports, not ESM. Trying to import with ES module syntax will fail at runtime.
fix
Use require() in Node.js or enable CJS interop in bundlers.
affects: >=0.0.0
gotchaMysqlConnector requires a running MySQL instance; it does not manage connections internally or reconnect automatically.
fix
Manually call connect() before operations and handle disconnection errors.
affects: >=0.0.0
gotchaNo TypeScript definitions included; using with TypeScript requires custom .d.ts or typings package.
fix
Write a declaration file or switch to a typed ORM.
affects: >=0.0.0
Errors
Common errors & fixes
TypeError: Cannot destructure property 'MysqlConnector' of 'require(...)' as it is undefined.
Package may not be installed, or typo in package name (e.g., 'mysql-kiss' instead of 'mysql-kiss-orm').
fix
Run `npm install mysql-kiss-orm` and ensure correct package name in require.
Error: connect ECONNREFUSED 127.0.0.1:3306
MySQL server is not running or host/port incorrect.
fix
Start MySQL service and check connection settings (host, port, user, password).
TypeError: mysql.connect is not a function
Forgetting to instantiate MysqlConnector (e.g., using require as a constructor).
fix
Use `new MysqlConnector(config)` and then call `await mysql.connect()`.
Cannot read property 'insertId' of undefined
insertOne() returned undefined because the query failed but error was swallowed.
fix
Wrap in try/catch and check mysql2 connection state.
Upgrade
Version history
0.4.5latest on npm
Audit
Dependencies
mysql2requiredPeer dependency - the ORM wraps mysql2's connection/pool
Agent activity
2 hits · last 30 days
node
2
Resources
mysql-kiss-orm — npm install mysql-kiss-orm · libregistry