diff --git a/website/docs/contributing/website.mdx b/website/docs/contributing/website.mdx index 2d82b166da..e9e10f764a 100644 --- a/website/docs/contributing/website.mdx +++ b/website/docs/contributing/website.mdx @@ -11,7 +11,7 @@ import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed'; This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator. ---- +
## Environment @@ -19,7 +19,7 @@ You will need these tools installed on your system: - [Node.js (18.x or higher)](https://nodejs.org/) ---- +
## Development @@ -58,7 +58,7 @@ Note that the website has its own _package.json_. Please, do not install dependencies for the website in **node-mysql2** root. ::: ---- +
## Extras Components @@ -100,7 +100,7 @@ You can also utilize React components in the `changes` option. /> ---- +
### Stability @@ -126,7 +126,7 @@ Available levels: `0`, `1`, `1.1`, `1.2`, `2` and `3`. ---- +
### FAQ @@ -157,7 +157,7 @@ import { FAQ } from '@site/src/components/FAQ'; ---- +
### ExternalCodeEmbed @@ -193,7 +193,7 @@ import { ExternalCodeEmbed } from '@site/src/components/ExternalCodeEmbed'; /> ---- +
## Running Tests diff --git a/website/docs/documentation/00-index.mdx b/website/docs/documentation/00-index.mdx index 645eaaed39..a2d3f2c2f5 100644 --- a/website/docs/documentation/00-index.mdx +++ b/website/docs/documentation/00-index.mdx @@ -29,13 +29,13 @@ Not only **MySQL2** offers better performance over [Node MySQL][node-mysql], we - MySQL Compression - Binary Log Protocol Client ---- +
## Examples Please check these [examples](/docs/examples) for **MySQL2**. ---- +
## Known incompatibilities with [Node MySQL][node-mysql] @@ -54,7 +54,7 @@ Please check these [examples](/docs/examples) for **MySQL2**. This option could lose precision on the number as Javascript Number is a Float! ::: ---- +
## Other Resources @@ -64,7 +64,7 @@ This option could lose precision on the number as Javascript Number is a Float! - [node-libmysqlclient](https://github.com/Sannis/node-mysql-libmysqlclient) - Bindings to libmysqlclient - [go-mysql](https://github.com/siddontang/go-mysql) - MySQL Go client (prepared statements, binlog protocol, server) ---- +
## Benchmarks diff --git a/website/docs/documentation/mysql-server.mdx b/website/docs/documentation/mysql-server.mdx index b0faeae9c8..8a4d899e72 100644 --- a/website/docs/documentation/mysql-server.mdx +++ b/website/docs/documentation/mysql-server.mdx @@ -10,7 +10,7 @@ - **connect** - new incoming connection. ---- +
## Connection diff --git a/website/docs/documentation/typescript-examples.mdx b/website/docs/documentation/typescript-examples.mdx index 8bd71c82c7..b7fb27fa20 100644 --- a/website/docs/documentation/typescript-examples.mdx +++ b/website/docs/documentation/typescript-examples.mdx @@ -16,7 +16,7 @@ npm install --save-dev @types/node Requires **TypeScript** `>=4.5.2`. ::: ---- +
## Usage @@ -90,7 +90,7 @@ The `rows` output will be these possible types: In this example, you need to manually check the output types ---- +
## Type Specification @@ -156,7 +156,7 @@ conn.query('SHOW TABLES FROM `test`;', (_err, rows) => { }); ``` ---- +
### RowDataPacket[][] @@ -186,7 +186,7 @@ conn.query(sql, (_err, rows) => { }); ``` ---- +
### ResultSetHeader @@ -244,7 +244,7 @@ conn.query(sql, (_err, result) => { }); ``` ---- +
### ResultSetHeader[] @@ -306,7 +306,7 @@ conn.query(sql, (_err, results) => { }); ``` ---- +
### ProcedureCallPacket @@ -379,7 +379,7 @@ By using `SELECT` and `SHOW` queries in a **Procedure Call**, it groups the resu For `ProcedureCallPacket`, please see the following examples. ---- +
### OkPacket @@ -395,7 +395,7 @@ For `ProcedureCallPacket`, please see the following examples. } /> ---- +
## Examples diff --git a/website/docs/examples/connections/create-connection.mdx b/website/docs/examples/connections/create-connection.mdx index 88be8a6876..c2b8f365fc 100644 --- a/website/docs/examples/connections/create-connection.mdx +++ b/website/docs/examples/connections/create-connection.mdx @@ -53,7 +53,7 @@ connection.addListener('error', (err) => { ---- +
## createConnection(config) @@ -102,7 +102,7 @@ connection.addListener('error', (err) => { ---- +
## createConnection(config) — SHA1 @@ -148,7 +148,7 @@ connection.addListener('error', (err) => { ---- +
## createConnection(config) — SSL @@ -208,7 +208,7 @@ connection.addListener('error', (err) => { ---- +
## createConnection(config) — RDS SSL @@ -297,7 +297,7 @@ connectionquery('SHOW `status` LIKE "Ssl_cipher"', function (err, res) { - [#2119 — fix: make startTls code compatible with Bun](https://github.com/sidorares/node-mysql2/pull/2119) - [#2131 — Update Amazon RDS SSL CA cert](https://github.com/sidorares/node-mysql2/pull/2131) ---- +
## createConnection(config) — Socks @@ -379,7 +379,7 @@ connection.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { ::: ---- +
## Glossary diff --git a/website/docs/examples/connections/create-pool.mdx b/website/docs/examples/connections/create-pool.mdx index cf71a0ccbe..a1a84862fb 100644 --- a/website/docs/examples/connections/create-pool.mdx +++ b/website/docs/examples/connections/create-pool.mdx @@ -70,7 +70,7 @@ Don't forget to release the connection when finished by using: ::: ---- +
## createPool(config) @@ -140,7 +140,7 @@ Don't forget to release the connection when finished by using: ::: ---- +
## createPool(config) — SHA1 @@ -207,7 +207,7 @@ Don't forget to release the connection when finished by using: ::: ---- +
## createPool(config) — SSL @@ -288,7 +288,7 @@ Don't forget to release the connection when finished by using: ::: ---- +
## createPool(config) — RDS SSL @@ -398,7 +398,7 @@ Don't forget to release the connection when finished by using: - [#2119 — fix: make startTls code compatible with Bun](https://github.com/sidorares/node-mysql2/pull/2119) - [#2131 — Update Amazon RDS SSL CA cert](https://github.com/sidorares/node-mysql2/pull/2131) ---- +
## createPool(config) — Socks @@ -472,22 +472,24 @@ pool.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { ::: ---- +
## Glossary ### PoolOptions -> **PoolOptions** extends all options from **ConnectionOptions**: -> -> -> language='ts' -> url='https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts' -> extractMethod='ConnectionOptions' -> methodType='interface' -> /> -> +
+ **PoolOptions** extends all options from **ConnectionOptions**: + + + + +
## add(group, config) @@ -152,7 +152,7 @@ Don't forget to release the connection when finished by using: ::: ---- +
## add(group, config) — SHA1 @@ -225,7 +225,7 @@ Don't forget to release the connection when finished by using: ::: ---- +
## add(group, config) — SSL @@ -312,7 +312,7 @@ Don't forget to release the connection when finished by using: ::: ---- +
## add(group, config) — RDS SSL @@ -428,7 +428,7 @@ Don't forget to release the connection when finished by using: - [#2119 — fix: make startTls code compatible with Bun](https://github.com/sidorares/node-mysql2/pull/2119) - [#2131 — Update Amazon RDS SSL CA cert](https://github.com/sidorares/node-mysql2/pull/2131) ---- +
## add(group, config) — Socks @@ -512,22 +512,24 @@ poolNamespace.execute('SELECT SLEEP(1) AS `qqq`', (err, rows, fields) => { ::: ---- +
## Glossary ### PoolOptions -> **PoolOptions** extends all options from **ConnectionOptions**: -> -> -> language='ts' -> url='https://raw.githubusercontent.com/sidorares/node-mysql2/master/typings/mysql/lib/Connection.d.ts' -> extractMethod='ConnectionOptions' -> methodType='interface' -> /> -> +
+ **PoolOptions** extends all options from **ConnectionOptions**: + + + + +
{ The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## execute(options) @@ -124,7 +124,7 @@ connection.execute( The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## execute(options, values) @@ -190,7 +190,7 @@ connection.execute( The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## Glossary diff --git a/website/docs/examples/queries/prepared-statements/index.mdx b/website/docs/examples/queries/prepared-statements/index.mdx index 4b3ad84928..4b73919316 100644 --- a/website/docs/examples/queries/prepared-statements/index.mdx +++ b/website/docs/examples/queries/prepared-statements/index.mdx @@ -9,7 +9,7 @@ See detailed documentaion in [Prepared Statements](/docs/documentation/prepared- If you execute same statement again, it will be picked form a **LRU cache** which will save query preparation time and give better performance. ::: ---- +
Usage examples: diff --git a/website/docs/examples/queries/prepared-statements/insert.mdx b/website/docs/examples/queries/prepared-statements/insert.mdx index ca766ae560..81a10dcd0a 100644 --- a/website/docs/examples/queries/prepared-statements/insert.mdx +++ b/website/docs/examples/queries/prepared-statements/insert.mdx @@ -60,7 +60,7 @@ connection.execute(sql, values, (err, result, fields) => { The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## execute(options) @@ -124,7 +124,7 @@ connection.execute( The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## execute(options, values) @@ -190,7 +190,7 @@ connection.execute( The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## Glossary diff --git a/website/docs/examples/queries/prepared-statements/select.mdx b/website/docs/examples/queries/prepared-statements/select.mdx index 3bc0f6aa36..20c3c0c02a 100644 --- a/website/docs/examples/queries/prepared-statements/select.mdx +++ b/website/docs/examples/queries/prepared-statements/select.mdx @@ -60,7 +60,7 @@ connection.execute(sql, values, (err, rows, fields) => { The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## execute(options) @@ -124,7 +124,7 @@ connection.execute( The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## execute(options, values) @@ -190,7 +190,7 @@ connection.execute( The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## Glossary diff --git a/website/docs/examples/queries/prepared-statements/update.mdx b/website/docs/examples/queries/prepared-statements/update.mdx index fbef730b57..fd8420772f 100644 --- a/website/docs/examples/queries/prepared-statements/update.mdx +++ b/website/docs/examples/queries/prepared-statements/update.mdx @@ -60,7 +60,7 @@ connection.execute(sql, values, (err, result, fields) => { The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## execute(options) @@ -124,7 +124,7 @@ connection.execute( The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## execute(options, values) @@ -190,7 +190,7 @@ connection.execute( The connection used for the query (`execute`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## Glossary diff --git a/website/docs/examples/queries/simple-queries/delete.mdx b/website/docs/examples/queries/simple-queries/delete.mdx index df7db243f2..ba82b99221 100644 --- a/website/docs/examples/queries/simple-queries/delete.mdx +++ b/website/docs/examples/queries/simple-queries/delete.mdx @@ -60,7 +60,7 @@ connection.query(sql, (err, result, fields) => { The connection used for the query (`.query()`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## query(options) @@ -120,7 +120,7 @@ connection.query( The connection used for the query (`.query()`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## Glossary diff --git a/website/docs/examples/queries/simple-queries/index.mdx b/website/docs/examples/queries/simple-queries/index.mdx index 32ce005b43..a3369f94d4 100644 --- a/website/docs/examples/queries/simple-queries/index.mdx +++ b/website/docs/examples/queries/simple-queries/index.mdx @@ -4,7 +4,7 @@ For **Prepared Statements** or **Placeholders** / **Parameters** examples, please see [here](/docs/examples/queries/prepared-statements). ::: ---- +
Usage examples: diff --git a/website/docs/examples/queries/simple-queries/select.mdx b/website/docs/examples/queries/simple-queries/select.mdx index 6da88b6007..369262b21f 100644 --- a/website/docs/examples/queries/simple-queries/select.mdx +++ b/website/docs/examples/queries/simple-queries/select.mdx @@ -60,7 +60,7 @@ connection.query(sql, (err, rows, fields) => { The connection used for the query (`.query()`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## query(options) @@ -120,7 +120,7 @@ connection.query( The connection used for the query (`.query()`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## query(options) — Row as Array @@ -182,7 +182,7 @@ connection.query( The connection used for the query (`.query()`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## Glossary diff --git a/website/docs/examples/queries/simple-queries/update.mdx b/website/docs/examples/queries/simple-queries/update.mdx index 63ff8bc1e3..4dcdbcbe66 100644 --- a/website/docs/examples/queries/simple-queries/update.mdx +++ b/website/docs/examples/queries/simple-queries/update.mdx @@ -60,7 +60,7 @@ connection.query(sql, (err, result, fields) => { The connection used for the query (`.query()`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## query(options) @@ -120,7 +120,7 @@ connection.query( The connection used for the query (`.query()`) can be obtained through the `createConnection`, `createPool` or `createPoolCluster` methods. ::: ---- +
## Glossary diff --git a/website/docs/faq/how-to-handle-errors.mdx b/website/docs/faq/how-to-handle-errors.mdx index 01645754a0..63a773a882 100644 --- a/website/docs/faq/how-to-handle-errors.mdx +++ b/website/docs/faq/how-to-handle-errors.mdx @@ -273,7 +273,7 @@ try {
---- +
## Related Links diff --git a/website/docs/index.mdx b/website/docs/index.mdx index 67fa090300..8a69545836 100644 --- a/website/docs/index.mdx +++ b/website/docs/index.mdx @@ -56,7 +56,7 @@ npm install --save-dev @types/node ---- +
### First Query @@ -137,7 +137,7 @@ connection.query( ---- +
### Using Prepared Statements @@ -207,7 +207,7 @@ connection.execute( If you execute same statement again, it will be picked from a LRU cache which will save query preparation time and give better performance. ::: ---- +
### Using Connection Pools @@ -266,7 +266,7 @@ const pool = mysql.createPool({ The pool does not create all connections upfront but creates them on demand until the connection limit is reached. ::: ---- +
You can use the pool in the same way as connections (using `pool.query()` and `pool.execute()`): @@ -335,7 +335,7 @@ pool.getConnection(function (err, conn) { conn.release(); ``` ---- +
### Using Promise Wrapper @@ -427,7 +427,7 @@ conn .then(() => conn.end()); ``` ---- +
### Array Results @@ -504,7 +504,7 @@ conn.query( ---- +
:::tip Getting Help Need help? Ask your question on [Stack Overflow](https://stackoverflow.com/questions/tagged/mysql2) or [GitHub](https://github.com/sidorares/node-mysql2/discussions). diff --git a/website/docs/stability-badges.mdx b/website/docs/stability-badges.mdx index 726c840fcf..bb822ea562 100644 --- a/website/docs/stability-badges.mdx +++ b/website/docs/stability-badges.mdx @@ -11,7 +11,7 @@ The stability indices are as follows: message='The feature might generate warnings and does not assure backward compatibility.' /> ---- +
**Experimental**: These features are not bound by semantic versioning. They may undergo non-backward compatible changes or be removed in future releases. Their use in production is discouraged. @@ -34,14 +34,14 @@ Experimental features are classified into stages: message='Experimental features are close to reaching stability. Major changes are not expected, but they could still occur based on user feedback. Testing and feedback are important to ascertain the readiness of these features for stable classification.' /> ---- +
---- +
---- +
### Primeira Consulta (_Query_) @@ -127,7 +127,7 @@ connection.query( ---- +
### Usando Instruções Preparadas (_Prepared Statements_) @@ -197,7 +197,7 @@ connection.execute( Se você executar a mesma declaração novamente, ela será selecionada a partir do LRU Cache, o que economizará tempo de preparação da consulta e proporcionará melhor desempenho. ::: ---- +
### Usando Conjunto de Conexões (_pools_) {#using-connection-pools} @@ -256,7 +256,7 @@ const pool = mysql.createPool({ O _pool_ não estabelece todas as conexões previamente, mas as cria sob demanda até que o limite de conexões seja atingido. ::: ---- +
Você pode usar o _pool_ da mesma maneira como em uma conexão (usando `pool.query()` e `pool.execute()`): @@ -325,7 +325,7 @@ pool.getConnection(function (err, conn) { conn.release(); ``` ---- +
### Usando o _Promise Wrapper_ @@ -417,7 +417,7 @@ conn .then(() => conn.end()); ``` ---- +
### Resultados em _Array_ @@ -494,7 +494,7 @@ conn.query( ---- +
:::tip Obtendo Ajuda Precisa de ajuda? Faça sua pergunta no [Stack Overflow](https://stackoverflow.com/questions/tagged/mysql2) ou [GitHub](https://github.com/sidorares/node-mysql2/discussions). diff --git a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.mdx b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.mdx index 96826539e0..dd0f0a2336 100644 --- a/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.mdx +++ b/website/i18n/zh-CN/docusaurus-plugin-content-docs/current/index.mdx @@ -46,7 +46,7 @@ npm install --save-dev @types/node ---- +
### 查询数据 @@ -127,7 +127,7 @@ connection.query( ---- +
### SQL预处理的使用 @@ -197,7 +197,7 @@ connection.execute( 如果再次执行相同的语句,他将从缓存中选取,这能有效的节省准备查询时间获得更好的性能。 ::: ---- +
### 连接池的使用 {#using-connection-pools} @@ -256,7 +256,7 @@ const pool = mysql.createPool({ 该池不会预先创建所有连接,而是根据需要创建它们,直到达到连接限制。 ::: ---- +
您可以像直接连接一样使用池(使用 `pool.query()` 和 `pool.execute()`): @@ -325,7 +325,7 @@ pool.getConnection(function (err, conn) { conn.release(); ``` ---- +
### Promise封装 @@ -417,7 +417,7 @@ conn .then(() => conn.end()); ``` ---- +
### 结果返回 @@ -494,7 +494,7 @@ conn.query( ---- +
:::tip Getting Help Need help? Ask your question on [Stack Overflow](https://stackoverflow.com/questions/tagged/mysql2) or [GitHub](https://github.com/sidorares/node-mysql2/discussions). diff --git a/website/src/pages/index.tsx b/website/src/pages/index.tsx index af1ace5997..99b3449158 100644 --- a/website/src/pages/index.tsx +++ b/website/src/pages/index.tsx @@ -6,7 +6,7 @@ function Home() { const { baseUrl } = siteConfig; const currentLocale = i18n.currentLocale; const setLocaleRedirectMap = () => - currentLocale === 'en' + currentLocale === 'en' || baseUrl.includes(currentLocale) ? `${baseUrl}docs` : `${baseUrl}${currentLocale}/docs`; const redirectUrl = setLocaleRedirectMap();