{"id":18262,"library":"database-jones","title":"Database Jones","description":"A Node.js database mapping framework (version 1.2.8) that provides a session-based API for CRUD operations, transactions, and query building. It offers flexible object-relational mapping with support for MySQL and MySQL Cluster (NDB), using Promises/A+ and connection pooling. The project appears to be in early development (sparse releases, incomplete docs) and is distinguished by its session abstraction and adherence to standard JavaScript objects. Notable version: 1.2.8 released 2014-10-06. Competing with Sequelize and Bookshelf, but less mature.","status":"maintenance","version":"1.2.8","language":"javascript","source_language":"en","source_url":"https://github.com/mysql/mysql-js","tags":["javascript","mysql","orm","ndb","mapping"],"install":[{"cmd":"npm install database-jones","lang":"bash","label":"npm"},{"cmd":"yarn add database-jones","lang":"bash","label":"yarn"},{"cmd":"pnpm add database-jones","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for MySQL adapter (node-mysql)","package":"mysql","optional":true}],"imports":[{"note":"Package uses CommonJS. No ESM exports available.","wrong":"import jones from 'database-jones';","symbol":"default","correct":"const jones = require('database-jones');"},{"note":"CommonJS destructure. ESM not supported.","wrong":"import { ConnectionProperties } from 'database-jones';","symbol":"ConnectionProperties","correct":"const { ConnectionProperties } = require('database-jones');"},{"note":"Both work but destructuring is preferred.","wrong":"const openSession = require('database-jones').openSession;","symbol":"openSession","correct":"const { openSession } = require('database-jones');"}],"quickstart":{"code":"const jones = require('database-jones');\nconst props = new jones.ConnectionProperties('mysql');\nprops.host = 'localhost';\nprops.port = 3306;\nprops.user = 'root';\nprops.password = process.env.DB_PASSWORD ?? '';\nprops.database = 'test';\n\njones.openSession(props).then(session => {\n  const user = { id: 1, name: 'Database Jones'};\n  return session.persist('user', user);\n}).then(() => {\n  console.log('Persisted successfully');\n  jones.closeAllOpenSessionFactories();\n}).catch(err => {\n  console.error('Error:', err);\n  jones.closeAllOpenSessionFactories();\n});","lang":"javascript","description":"Opens a session, stores a simple object into a MySQL table, then closes all session factories."},"warnings":[{"fix":"Consider using a modern ORM like Sequelize or Prisma.","message":"Package has not been updated since 2014 and uses old patterns (callbacks, no TypeScript).","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Always call jones.closeAllOpenSessionFactories() after all sessions complete.","message":"Session factories must be closed explicitly with closeAllOpenSessionFactories() to avoid hanging connections.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Run: npm install mysql","message":"The mysql adapter requires the 'mysql' npm package as a peer dependency; not automatically installed.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install mysql","cause":"The mysql adapter is not installed.","error":"Error: Cannot find module 'mysql'"},{"fix":"Ensure you create a valid ConnectionProperties and pass it to openSession.","cause":"Called openSession without providing ConnectionProperties or with invalid adapter name.","error":"TypeError: Cannot read property 'then' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}