{"id":43263,"library":"mysql-core","title":"mysql-core","description":"MySQL client library for Node.js and TypeScript (v0.1.16). Lightweight, type-safe wrapper around mysql2 with minimal overhead. Releases are infrequent and pre-1.0. Differentiates from mysql2 by providing first-class TypeScript types and a cleaner API, but is immature and may have breaking changes.","status":"active","version":"0.1.16","language":"javascript","source_language":"en","source_url":"git@github.com/core-ts/mysql","tags":["javascript","MySQL","typescript"],"install":[{"cmd":"npm install mysql-core","lang":"bash","label":"npm"},{"cmd":"yarn add mysql-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add mysql-core","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"core dependency for MySQL protocol handling","package":"mysql2","optional":false}],"imports":[{"note":"CommonJS require is deprecated since v0.1.10","symbol":"default","correct":"import mysql from 'mysql-core'"},{"note":"Named export, not default from subpath.","wrong":"import Connection from 'mysql-core/connection'","symbol":"Connection","correct":"import { Connection } from 'mysql-core'"},{"wrong":"import { Pool } from 'mysql-core/pool'","symbol":"Pool","correct":"import { Pool } from 'mysql-core'"}],"quickstart":{"code":"import mysql from 'mysql-core';\n\nconst connection = mysql.createConnection({\n  host: 'localhost',\n  user: 'root',\n  password: process.env.DB_PASSWORD ?? '',\n  database: 'test'\n});\n\nconnection.query('SELECT 1 + 1 AS solution', (err, results) => {\n  if (err) throw err;\n  console.log(results[0].solution);\n});\n\nconnection.end();","lang":"typescript","description":"Creates a MySQL connection, runs a simple query, and logs the result."},"warnings":[{"fix":"Pin to exact version in package.json.","message":"Pre-1.0 releases may have breaking changes without major version bump.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Run 'npm install mysql2' in your project.","message":"Requires mysql2 as a peer dependency; must be installed separately.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use 'import mysql from 'mysql-core'' instead of 'const mysql = require('mysql-core')'.","message":"CommonJS require() is deprecated since v0.1.10, use ESM imports.","severity":"deprecated","affected_versions":">=0.1.10"},{"fix":"Check the type definitions for completeness.","message":"Types are included but may not cover all mysql2 features (e.g., prepare statements).","severity":"gotcha","affected_versions":"<0.2.0"}],"env_vars":null,"search_vec":"'-1.0':27 'api':41 'around':17 'break':48 'chang':49 'class':35 'cleaner':40 'client':5 'core':3 'differenti':28 'first':34 'first-class':33 'immatur':44 'infrequ':24 'javascript':50 'librari':6 'lightweight':12 'may':46 'minim':20 'mysql':2,4,51 'mysql-cor':1 'mysql2':18,30 'node.js':8 'overhead':21 'pre':26 'provid':32 'releas':22 'safe':15 'type':14,37 'type-saf':13 'typescript':10,36,52 'v0.1.16':11 'wrapper':16","created_at":"2026-06-05T16:58:57.675980+00:00","updated_at":"2026-06-05T16:58:57.675980+00:00","problems":[{"fix":"npm install mysql2","cause":"mysql2 not installed as peer dependency","error":"Cannot find module 'mysql2'"},{"fix":"Use import mysql from 'mysql-core' or const mysql = require('mysql-core').default","cause":"Using default import as CommonJS require","error":"TypeError: mysql.createConnection is not a function"},{"fix":"Use mysql.createConnection(...)","cause":"Trying to new mysql() instead of using createConnection","error":"This expression is not constructable. Type 'typeof import(\"mysql-core\")' has no construct signatures."}],"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":"git@github.com/core-ts/mysql","github":"git@github.com/core-ts/mysql","docs":null,"changelog":null,"pypi":null,"npm":"mysql-core","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}}