Skip to content

Commit 058f685

Browse files
committed
Merge branch 'develop'
# Conflicts: # .github/workflows/ci.yml # README.md
2 parents bd94739 + 94dcb11 commit 058f685

26 files changed

+1889
-5055
lines changed

.github/workflows/ci.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ name: Run CI Tests
33

44
on:
55
push:
6-
branches: ['master', 'develop', 'feature/**', 'maintenance/**']
76
pull_request:
87
workflow_dispatch:
98
schedule:
@@ -20,10 +19,15 @@ env:
2019
TEST_DB_USER: root
2120
TEST_DB_PASSWORD: "heyPassw-!*20oRd"
2221
TEST_DB_DATABASE: testn
23-
2422
jobs:
2523
setup:
2624
runs-on: ubuntu-latest
25+
if: |
26+
github.event_name != 'schedule' ||
27+
github.ref == 'refs/heads/main' ||
28+
github.ref == 'refs/heads/develop' ||
29+
github.ref == 'refs/heads/maintenance/3.2' ||
30+
github.ref == 'refs/heads/maintenance/3.3'
2731
outputs:
2832
matrix: ${{ steps.set-matrix.outputs.final-matrix }}
2933
steps:
@@ -57,8 +61,8 @@ jobs:
5761
test-db-database: ${{ env.TEST_DB_DATABASE }}
5862
test-db-port: ${{ env.TEST_DB_PORT }}
5963
additional-conf: ${{ matrix.additional-conf || '' }}
60-
registry-user: ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_USER || '' }}
61-
registry-password: ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_TOKEN || '' }}
64+
registry-user: ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_USER || (secrets.DOCKER_PWD != '' && 'mariadbtest' || '') }}
65+
registry-password: ${{ matrix.db-type == 'enterprise' && secrets.ENTERPRISE_TOKEN || secrets.DOCKER_PWD }}
6266
os: ${{ matrix.os }}
6367

6468
- uses: actions/setup-node@v4

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ MariaDB and MySQL client, 100% JavaScript, with TypeScript definition, with the
1818

1919
## Documentation
2020

21-
See [promise documentation](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/promise-api.md) for detailed API.
21+
See [promise documentation](https://mariadb.com/docs/connectors/mariadb-connector-nodejs/connector-nodejs-promise-api) for detailed API.
2222

23-
[Callback documentation](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/callback-api.md) describe the callback wrapper for compatibility with existing drivers.
23+
[Callback documentation](https://mariadb.com/docs/connectors/mariadb-connector-nodejs/connector-nodejs-callback-api) describes the callback wrapper for compatibility with existing drivers.
2424

25-
See [dedicated part](https://github.com/mariadb-corporation/mariadb-connector-nodejs/blob/master/documentation/promise-api.md#migrating-from-2x-or-mysqlmysql2-to-3x) for migration from mysql/mysql2 or from 2.x version.
25+
See [dedicated part](https://mariadb.com/docs/connectors/mariadb-connector-nodejs/connector-nodejs-promise-api#migrating-from-2.x-or-mysql-mysql2-to-3.x) for migration from mysql/mysql2 or from 2.x version.
2626

2727

28-
## Why a New Client?
28+
## Why a specific MariaDB Client?
2929

3030
While there are existing MySQL clients that work with MariaDB, (such as the [`mysql`](https://www.npmjs.com/package/mysql) and [`mysql2`](https://www.npmjs.com/package/mysql2) clients), the MariaDB Node.js Connector offers new functionality, like [Insert Streaming](#insert-streaming), [Pipelining](#pipelining), [ed25519 plugin authentication](https://mariadb.org/history-of-mysql-mariadb-authentication-protocols/) while making no compromises on performance.
3131

32-
Connector is production grade quality, with multiple features:
32+
The Connector is production grade quality, with multiple features:
33+
* [zero configuration ssl](https://mariadb.org/mission-impossible-zero-configuration-ssl/)
3334
* superfast batching
3435
* fast pool
3536
* easy debugging, trace pointing to code line on error
@@ -63,13 +64,13 @@ With Pipelining, the Connector sends commands without waiting for server results
6364

6465
The Connector doesn't wait for query results before sending the next `INSERT` statement. Instead, it sends queries one after the other, avoiding much of the network latency.
6566

66-
For more information, see the [Pipelining](/documentation/pipelining.md) documentation.
67+
For more information, see the [Pipelining](https://mariadb.com/docs/connectors/mariadb-connector-nodejs/connector-nodejs-pipelining) documentation.
6768

6869
### Bulk insert
6970

7071
Some use cases require a large amount of data to be inserted into a database table. By using batch processing, these queries can be sent to the database in one call, thus improving performance.
7172

72-
For more information, see the [Batch](/documentation/batch.md) documentation.
73+
For more information, see the [Batch](https://mariadb.com/docs/connectors/mariadb-connector-nodejs/connector-nodejs-batch-api) documentation.
7374

7475

7576
## Benchmarks

documentation/batch.md

Lines changed: 7 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,11 @@
1-
# Batching
1+
# Connector/Node.js Batch API
22

3-
Batch processing groups multiple queries into one unit and passes it in a single network trip to a database.
4-
There is different implementation according to server type and version.
3+
**📍 This documentation has moved!**
54

6-
## Using Batching
5+
The Batch API documentation is now maintained at:
6+
**https://mariadb.com/docs/connectors/mariadb-connector-nodejs/connector-nodejs-batch-api**
77

8-
Some use cases require a large amount of data to be inserted into a database table. By using batch processing, these queries can be sent to the database in one call, thus improving performance.
8+
Please update your bookmarks and visit the new location for the most up-to-date documentation.
99

10-
For instance, say you want to create a basket with five items.
11-
12-
```javascript
13-
connection.beginTransaction();
14-
connection.query("INSERT INTO BASKET(customerId) values (?)", [1], (err, res) => {
15-
//must handle error if any
16-
const basketId = res.insertId;
17-
try {
18-
connection.batch("INSERT INTO basket_item(basketId, itemId) VALUES (?, ?)",[
19-
[basketId, 100],
20-
[basketId, 101],
21-
[basketId, 103],
22-
[basketId, 104],
23-
[basketId, 105]
24-
]);
25-
//must handle error if any
26-
connection.commit();
27-
} catch (err) {
28-
connection.rollback();
29-
//handle error
30-
}
31-
});
32-
```
33-
34-
### Performance comparison
35-
36-
Some benchmark to do some 100 inserts with one parameter of 100 characters :
37-
(benchmark source - see [standard insert](benchmarks/benchs/insert_pipelining.js) and [batch insert](benchmarks/benchs/insert_batch.js) )
38-
<p align="center">
39-
<img src="./misc/batch-bench.png">
40-
</p>
41-
42-
### Configuration
43-
44-
There is one thing to pay attention : MySQL / MariaDB servers have a global option [max_allowed_packet](https://mariadb.com/kb/en/library/server-system-variables/#max_allowed_packet) that limit the maximum packet exchange size.
45-
If connector send more data than these limit, socket will be immediately dropped.
46-
47-
default server values :
48-
- since MariaDB 10.2.4 : 16M
49-
- since MariaDB 10.1.7 : 4M
50-
- before MariaDB 10.1.7 : 1M
51-
52-
You can check servers value using query `select @@max_allowed_packet`.
53-
54-
Connection option "maxAllowedPacket" permit to connector to behave accordingly : if maxAllowedPacket is set to 1048576 (=1M),
55-
packet send to server will be split in packet less than 1M to avoid any issue.
10+
---
11+
*This file is kept for backward compatibility. Last updated: 27/06/2025*

0 commit comments

Comments
 (0)