Registry / database / firenze-adapter-mysql

firenze-adapter-mysql

JSON →
library0.4.0jsnpmunverified

MySQL adapter for the firenze.js ORM (v0.4.0), released in 2016. Provides a bridge between firenze's query builder and MySQL using a pool-based connection management. Last updated on npm in 2016, no active maintenance. Differentiates as a thin adapter for firenze's fluent API, but the firenze ORM itself is in maintenance mode. Requires firenze peer dependency.

npm install firenze-adapter-mysql
INSTALL
IMPORT
SIG · FIRENZE-ADAPTER-MY
F
firenze-adapter-mysql
databasejavascriptv0.4.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
const MysqlAdapter = require('firenze-adapter-mysql');
import MysqlAdapter from 'firenze-adapter-mysql';
Package uses CommonJS, not ESM. Default export is the adapter class.
MysqlAdapter
const { default: MysqlAdapter } = require('firenze-adapter-mysql');
const { MysqlAdapter } = require('firenze-adapter-mysql');
Named export does not exist; must use default import.
Database
const Database = require('firenze').Database;
import { Database } from 'firenze';
fireze is also CJS; common to use destructuring from require.

Creates a MySQL database connection using firenze's Database class with the mysql adapter, configured via environment variables.

const f = require('firenze'); const Database = f.Database; const MysqlAdapter = require('firenze-adapter-mysql'); const db = new Database({ adapter: MysqlAdapter, host: process.env.DB_HOST || '127.0.0.1', port: process.env.DB_PORT || 3306, database: process.env.DB_NAME || 'my_database', user: process.env.DB_USER || 'root', password: process.env.DB_PASSWORD || '', pool: { min: 0, max: 1 } }); // Example query db.model('User').find().then(users => { console.log(users); }).catch(err => { console.error(err); });
Debug
Known issues
deprecatedfirenze-adapter-mysql is no longer actively maintained; last release in 2016.
fix
Consider migrating to a modern ORM like Sequelize or Prisma.
affects: >=0.0.0
gotchaPackage uses mysql npm package (v2) under the hood, which has known security issues and lacks prepared statement support.
fix
Use 'password' option for authentication; avoid raw string interpolation in queries.
affects: >=0.0.0
breakingConstructor expects 'adapter' property set to the adapter class (not instance), different from some other database libraries.
fix
Pass MysqlAdapter directly, not new MysqlAdapter(...).
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'firenze-adapter-mysql'
Package not installed correctly, or missing peer dependency 'firenze'.
fix
Run: npm install --save firenze firenze-adapter-mysql
TypeError: Class constructor MysqlAdapter cannot be invoked without 'new'
Attempted to use adapter as function instead of class passed to Database constructor.
fix
Use: new Database({ adapter: MysqlAdapter, ... })
Error: ER_ACCESS_DENIED_ERROR: Access denied for user 'root'@'localhost'
Invalid credentials or host not allowed.
fix
Verify DB_HOST, DB_USER, DB_PASSWORD environment variables or configuration.
Upgrade
Version history
0.4.0latest on npm
Audit
Dependencies
firenzerequiredPeer dependency; required for ORM interface and query building.
Agent activity
8 hits · last 30 days
node
8
Resources
firenze-adapter-mysql — npm install firenze-adapter-mysql · libregistry