Skip to content

Commit 922ffa6

Browse files
committed
feat: US-189 - Add mysql2 project-matrix fixture
1 parent afa5915 commit 922ffa6

4 files changed

Lines changed: 44 additions & 0 deletions

File tree

docs/nodejs-compatibility.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ The [project-matrix test suite](https://github.com/rivet-dev/secure-exec/tree/ma
7777
| [ssh2](https://npmjs.com/package/ssh2) | Networking | SSH client/server, crypto, streams, events |
7878
| [ssh2-sftp-client](https://npmjs.com/package/ssh2-sftp-client) | Networking | SFTP client, file transfer APIs over SSH |
7979
| [pg](https://npmjs.com/package/pg) | Database | PostgreSQL client, Pool/Client classes, type parsers |
80+
| [mysql2](https://npmjs.com/package/mysql2) | Database | MySQL client, connection/pool classes, escape/format utilities |
8081
| [drizzle-orm](https://npmjs.com/package/drizzle-orm) | Database | ORM schema definition, query building, ESM module graph |
8182
| [ws](https://npmjs.com/package/ws) | Networking | WebSocket client/server, HTTP upgrade, events |
8283
| [jsonwebtoken](https://npmjs.com/package/jsonwebtoken) | Crypto | JWT signing (HS256), verification, decode |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"entry": "src/index.js",
3+
"expectation": "pass"
4+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "project-matrix-mysql2-pass",
3+
"private": true,
4+
"type": "commonjs",
5+
"dependencies": {
6+
"mysql2": "3.12.0"
7+
}
8+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"use strict";
2+
3+
var mysql = require("mysql2");
4+
5+
var result = {
6+
createConnectionExists: typeof mysql.createConnection === "function",
7+
createPoolExists: typeof mysql.createPool === "function",
8+
createPoolClusterExists: typeof mysql.createPoolCluster === "function",
9+
};
10+
11+
// Verify mysql2 internal protocol classes loaded (via public re-exports)
12+
var Types = mysql.Types;
13+
result.typesExists = typeof Types === "object" && Types !== null;
14+
15+
// Verify charset constants
16+
result.hasCharsets = typeof mysql.Charsets === "object" && mysql.Charsets !== null;
17+
18+
// Verify escape/format utilities
19+
result.escapeString = mysql.escape("hello 'world'");
20+
result.escapeId = mysql.escapeId("table name");
21+
result.formatSql = mysql.format("SELECT ? FROM ??", ["value", "table"]);
22+
23+
// Verify raw() for prepared statements
24+
result.hasRaw = typeof mysql.raw === "function";
25+
26+
// Verify promise wrapper is available
27+
var mysqlPromise = require("mysql2/promise");
28+
result.promiseCreateConnection = typeof mysqlPromise.createConnection === "function";
29+
result.promiseCreatePool = typeof mysqlPromise.createPool === "function";
30+
31+
console.log(JSON.stringify(result));

0 commit comments

Comments
 (0)