{"id":42565,"library":"crystal-node-mysql","title":"crystal-node-mysql","description":"A MySQL connection library specifically designed for the crystal-node framework (version 1.0.11). This package provides a thin wrapper around mysql2 with connection pooling and basic CRUD operations tailored to crystal-node's ORM-style usage. It is tightly coupled to crystal-node and not intended for general use outside that ecosystem. Development appears slow with no recent updates.","status":"maintenance","version":"1.0.11","language":"javascript","source_language":"en","source_url":"https://github.com/crystalray1984/crystal-node-mysql","tags":["javascript","crystal-node","mysql"],"install":[{"cmd":"npm install crystal-node-mysql","lang":"bash","label":"npm"},{"cmd":"yarn add crystal-node-mysql","lang":"bash","label":"yarn"},{"cmd":"pnpm add crystal-node-mysql","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Underlying MySQL driver used for all database operations.","package":"mysql2","optional":false}],"imports":[{"note":"Package exports a default object with query, getConnection, etc. Requires ESM or dynamic import.","wrong":"const mysql = require('crystal-node-mysql')","symbol":"default","correct":"import mysql from 'crystal-node-mysql'"},{"note":"Named export for single query function.","wrong":null,"symbol":"query","correct":"import { query } from 'crystal-node-mysql'"},{"note":"Named export to acquire a connection from pool.","wrong":null,"symbol":"getConnection","correct":"import { getConnection } from 'crystal-node-mysql'"}],"quickstart":{"code":"import mysql from 'crystal-node-mysql';\nimport { createPool } from 'mysql2/promise';\n\nasync function main() {\n  const pool = createPool({\n    host: process.env.DB_HOST ?? 'localhost',\n    user: process.env.DB_USER ?? 'root',\n    password: process.env.DB_PASSWORD ?? '',\n    database: process.env.DB_NAME ?? 'test',\n    waitForConnections: true,\n    connectionLimit: 10,\n    queueLimit: 0\n  });\n  mysql.init(pool);\n  const rows = await mysql.query('SELECT 1 + 1 AS result');\n  console.log(rows);\n}\n\nmain();","lang":"typescript","description":"Initializes the library with a mysql2 pool and runs a simple query."},"warnings":[{"fix":"Use generic mysql2 if not using crystal-node.","message":"Package is tightly coupled to crystal-node framework; standalone use may require extra setup.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Replace with mysql2 and adjust code.","message":"No active development; last update was years ago. Consider migrating to mysql2 directly.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Update code to use async/await or .then() instead of callbacks.","message":"In version 1.0.0, the API changed from callback-based to promise-based.","severity":"breaking","affected_versions":"<1.0.0"}],"env_vars":null,"search_vec":"'1.0.11':18 'appear':62 'around':25 'basic':31 'connect':7,28 'coupl':47 'crud':32 'crystal':2,14,37,50,70 'crystal-nod':13,36,49,69 'crystal-node-mysql':1 'design':10 'develop':61 'ecosystem':60 'framework':16 'general':56 'intend':54 'javascript':68 'librari':8 'mysql':4,6,72 'mysql2':26 'node':3,15,38,51,71 'oper':33 'orm':41 'orm-styl':40 'outsid':58 'packag':20 'pool':29 'provid':21 'recent':66 'slow':63 'specif':9 'style':42 'tailor':34 'thin':23 'tight':46 'updat':67 'usag':43 'use':57 'version':17 'wrapper':24","created_at":"2026-06-05T16:55:35.504698+00:00","updated_at":"2026-06-05T16:55:35.504698+00:00","problems":[{"fix":"Run `npm install crystal-node-mysql` and ensure correct import path.","cause":"Package not installed or typo in name.","error":"Error: Cannot find module 'crystal-node-mysql'"},{"fix":"Call `mysql.init(pool)` with a valid mysql2 pool first.","cause":"Pool not initialized before querying.","error":"TypeError: mysql.init is not a function"},{"fix":"Check DB_HOST environment variable or connection config.","cause":"Database hostname unresolved.","error":"Error: getaddrinfo ENOTFOUND"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/crystalray1984/crystal-node-mysql#readme","github":"https://github.com/crystalray1984/crystal-node-mysql","docs":null,"changelog":null,"pypi":null,"npm":"crystal-node-mysql","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}