Registry / database / naomi-mysql

naomi-mysql

JSON →
library2.2.2jsnpmunverified

MySQL connector for Naomi v2+ ORM. Version 2.2.2 is current stable release. Connects Naomi ORM to MySQL databases, providing standard database operations. Release cadence is low as it is a stable component of the Naomi ecosystem. Key differentiator: integrated with Naomi ORM for MySQL, offering a quick bridge between Naomi v2+ and MySQL.

npm install naomi-mysql
INSTALL
IMPORT
SIG · NAOMI-MYSQL
N
naomi-mysql
databasejavascriptv2.2.2
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 MySQLConnector from 'naomi-mysql'
const { MySQLConnector } = require('naomi-mysql')
Default export is a class constructor for MySQL connector
MySQLConnector
import MySQLConnector from 'naomi-mysql'
const MySQLConnector = require('naomi-mysql').MySQLConnector
CommonJS require gets the default export, not named
type definitions
import type { Options } from 'naomi-mysql'
TypeScript types are exported for configuration

Establishes a MySQL connection via Naomi ORM using the MySQL connector, then fetches all users.

import Naomi from 'naomi'; import MySQLConnector from 'naomi-mysql'; const naomi = new Naomi({ connector: new MySQLConnector({ host: process.env.DB_HOST ?? 'localhost', user: process.env.DB_USER ?? 'root', password: process.env.DB_PASS ?? '', database: 'myapp' }) }); async function main() { const users = await naomi.find('users'); console.log(users); } main().catch(console.error);
Debug
Known issues
deprecatednaomi-mysql is deprecated in favor of naomi-mysql2 for mysql2 support
fix
Switch to naomi-mysql2 package
affects: >=1.0.0 <3.0.0
breakingNode.js >=4.0.0 required, does not work on older Node versions
fix
Upgrade Node.js to version 4 or higher
affects: >=2.0.0
gotchaConfiguration options are not validated: missing host or invalid credentials cause runtime errors
fix
Validate configuration before instantiation and use try-catch
affects: >=1.0.0
gotchaConnection pooling is not configured by default; all connections are single
fix
Manually implement connection pooling or use a wrapper library
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'naomi-mysql'
Package not installed or missing from package.json
fix
npm install naomi-mysql --save
TypeError: MySQLConnector is not a constructor
Incorrect import, likely using default export as named
fix
Use: import MySQLConnector from 'naomi-mysql'
Error: ER_ACCESS_DENIED_ERROR: Access denied for user
Invalid database credentials or missing database permissions
fix
Check DB_USER, DB_PASS, and host connection
Error: connect ECONNREFUSED
MySQL server is not running or unreachable
fix
Start MySQL service and verify host/port
Upgrade
Version history
2.2.2latest on npm
Audit
Dependencies
naomirequiredpeer dependency required for ORM integration
Agent activity
5 hits · last 30 days
node
4
Resources
naomi-mysql — npm install naomi-mysql · libregistry