MCPcopy Index your code
hub / github.com/sidorares/node-mysql2

github.com/sidorares/node-mysql2 @v3.22.5 sqlite

repository ↗ · DeepWiki ↗ · release v3.22.5 ↗
691 symbols 1,646 edges 194 files 6 documented · 1%
README

MySQL2

NPM Version NPM Downloads Node.js Version GitHub Workflow Status (with event) Codecov License

English | 简体中文 | Português (BR)

MySQL client for Node.js with focus on performance. Supports prepared statements, non-utf8 encodings, binary log protocol, compression, ssl much more.

Table of Contents

History and Why MySQL2

MySQL2 project is a continuation of MySQL-Native. Protocol parser code was rewritten from scratch and api changed to match popular Node MySQL. MySQL2 team is working together with Node MySQL team to factor out shared code and move it under mysqljs organization.

MySQL2 is mostly API compatible with Node MySQL and supports majority of features. MySQL2 also offers these additional features:

Installation

MySQL2 is free from native bindings and can be installed on Linux, Mac OS or Windows without any issues.

npm install --save mysql2

If you are using TypeScript, you will need to install @types/node.

npm install --save-dev @types/node

For TypeScript documentation and examples, see here.

Documentation

Acknowledgements

Contributing

Want to improve something in MySQL2? Please check Contributing.md for detailed instruction on how to get started.

To contribute in MySQL2 Documentation, please visit the Website Contributing Guidelines for detailed instruction on how to get started.

Extension points exported contracts — how you extend this code

PoolNamespace (Interface)
(no doc) [6 implementers]
promise.d.ts
PoolNamespace (Interface)
(no doc) [6 implementers]
typings/mysql/lib/PoolCluster.d.ts
User (Interface)
(no doc)
test/tsc-build/strict-checks/ProcedureCallPacket.test.ts
PreparedStatementInfo (Interface)
(no doc) [3 implementers]
promise.d.ts
ConnectionConfig (Interface)
(no doc) [1 implementers]
typings/mysql/index.d.ts
Pool (Interface)
(no doc)
promise.d.ts
Pool (Interface)
(no doc)
typings/mysql/index.d.ts
PoolCluster (Interface)
(no doc)
promise.d.ts

Core symbols most depended-on inside this repo

push
called by 59
lib/compressed_protocol.js
readInt8
called by 59
lib/packets/packet.js
writeInt8
called by 59
lib/packets/packet.js
on
called by 45
promise.d.ts
query
called by 42
lib/base/pool.js
execute
called by 35
promise.d.ts
readInt32
called by 35
lib/packets/packet.js
slice
called by 30
lib/packets/packet.js

Shape

Method 395
Class 150
Function 115
Interface 31

Languages

TypeScript100%

Modules by API surface

lib/packets/packet.js75 symbols
lib/base/connection.js55 symbols
lib/pool_cluster.js29 symbols
lib/commands/query.js24 symbols
promise.d.ts23 symbols
lib/commands/binlog_dump.js20 symbols
lib/promise/connection.js18 symbols
lib/base/pool.js18 symbols
lib/commands/prepare.js15 symbols
lib/commands/client_handshake.js14 symbols
promise.js12 symbols
typings/mysql/index.d.ts10 symbols

Dependencies from manifests, versioned

@biomejs/biome1.9.4 · 1×
@docusaurus/core3.10.1 · 1×
@docusaurus/module-type-aliases3.9.1 · 1×
@docusaurus/preset-classic3.10.1 · 1×
@docusaurus/tsconfig3.10.1 · 1×
@docusaurus/types3.10.0 · 1×
@easyops-cn/docusaurus-search-local0.55.2 · 1×
@eslint/eslintrc3.3.3 · 1×
@eslint/js9.39.2 · 1×
@eslint/markdown8.0.1 · 1×
@mdx-js/react3.1.1 · 1×

Datastores touched

(mysql)Database · 1 repos

For agents

$ claude mcp add node-mysql2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact