Registry / database / simple-orm-mysql-adapter

simple-orm-mysql-adapter

JSON →
library0.6.0jsnpmunverified

A MySQL/MariaDB adapter for the Simple ORM framework, providing database connectivity for Node.js applications. As of version 0.6.0, it supports transactions and joins. The adapter is designed to be used with the Simple ORM core, which handles test suites. It is a lightweight, unopinionated library that expects a pre-created MySQL connection object. Release cadence is irregular, and the package appears to be in early development or maintenance mode.

npm install simple-orm-mysql-adapter
INSTALL
IMPORT
SIG · SIMPLE-ORM-MYSQL-A
S
simple-orm-mysql-adapter
databasejavascriptv0.6.0
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 (create function)
✓ const mysqlAdapter = require('simple-orm-mysql-adapter').create();
✗ const mysqlAdapter = require('simple-orm-mysql-adapter');
Requires calling .create() to instantiate the adapter.
create
✓ import { create } from 'simple-orm-mysql-adapter';
✗ import mysqlAdapter from 'simple-orm-mysql-adapter';
ESM import for the create function, available since v0.6.0.
SimpleORMAdapter
✓ import SimpleORMAdapter from 'simple-orm-mysql-adapter';
✗ import { SimpleORMAdapter } from 'simple-orm-mysql-adapter';
Default import gives the class directly; named export not available.

Creates a MySQL connection and passes it to the adapter; shows CommonJS usage.

const mysql = require('mysql'); const configuration = { host: 'localhost', user: 'root', password: process.env.MYSQL_PASSWORD ?? '', port: 3306, database: 'test' }; const connection = mysql.createConnection(configuration); const mysqlAdapter = require('simple-orm-mysql-adapter').create(); mysqlAdapter.setConnection({ connection }); // Now use mysqlAdapter with Simple ORM core
Debug
Known issues
breakingVersion 0.5.0 changed the API from `new Adapter(connection)` to `.create()` and `.setConnection()`. Old code will break.
fix
Upgrade to >=0.5.0 and use `.create()` instead of `new Adapter()`, then call `.setConnection()`.
affects: <0.5.0
gotchaThe adapter does not manage the MySQL connection lifecycle; you must handle connection errors and reconnection yourself.
fix
Implement connection error handling and reconnect logic in your application.
affects: all
deprecatedThis package is no longer actively maintained. The Simple ORM core has moved to support other databases.
fix
Consider migrating to a more actively maintained ORM like Sequelize or TypeORM.
affects: >=0.6.0
Errors
Common errors & fixes
TypeError: mysqlAdapter.setConnection is not a function
Using the adapter directly without calling .create() first.
fix
Use `require('simple-orm-mysql-adapter').create()` instead of `require('simple-orm-mysql-adapter')`.
Error: Cannot find module 'simple-orm-mysql-adapter'
The package is not installed or the module path is incorrect.
fix
Run `npm install simple-orm-mysql-adapter` and ensure you are using the correct package name.
Upgrade
Version history
0.6.0latest on npm
Audit
Dependencies
mysqloptionalRequired for MySQL database connections
Agent activity
9 hits · last 30 days
node
8
Resources
simple-orm-mysql-adapter — npm install simple-orm-mysql-adapter · libregistry