Skip to content

Releases: PerryTS/mysql

v0.1.7 — Perry-native Linux password auth (#2)

22 Jun 06:07

Choose a tag to compare

Fixes #2connect() password auth timing out under a Perry-native Linux binary.

Two driver-side bugs, both fixed:

  1. Perry runtime detection. deferWrites never activated because isNodeLike() keyed off process.versions.node, which Perry pins to "22.0.0". The driver now detects Perry positively via process.versions.perry (isPerry()), so the deferred-write path (and the TLS-upgrade / socket-open branches) take the correct Perry path.

  2. Flush mechanism. The queued HandshakeResponse41 was flushed by a zero-delay setTimeout scheduled from inside a 'data' handler, which never fires on a Perry-native binary. Replaced with a single shared, self-stopping, unref'd setInterval pump.

Empty-password connections already worked; this restores non-empty mysql_native_password (and other) auth on Perry-native Linux. No behavior change on Node.js / Bun.

v0.1.6

21 Jun 15:02

Choose a tag to compare

Fixes #1BIGINT read via the prepared (binary) protocol came back as a JS bigint under the Perry-native binary (but number under Node) even for small in-range values like 1, breaking JSON.stringify and turning auto-increment ids into null in HTTP responses.

The binary LONGLONG decoder now combines the two 32-bit words with pure number arithmetic and number-literal comparisons instead of Number(bigint) / bigint comparisons (both miscompiled by older Perry builds). Exact for |value| ≤ 2^53 and identical to Node; out-of-range values still return bigint. Robust regardless of Perry compiler version. Verified end-to-end on native Perry against a live MySQL server.

See CHANGELOG.md for details.

v0.1.5

12 Jun 04:29

Choose a tag to compare

Fixed

  • Perry-native Linux: password auth hung until connectTimeoutMs (#2). Perry-compiled Linux binaries silently drop socket.write() calls issued from inside a 'data' callback (upstream: PerryTS/perry#5021), which swallowed the driver's HandshakeResponse41 — along with auth-switch responses, COM_STMT_EXECUTE after PrepareOK, and the LOCAL_INFILE terminator. All socket writes now go through a per-connection queue flushed from a zero-delay timer under Perry (outside the data dispatch), preserving frame order; Node/Bun keep the synchronous write path. The TLS upgrade is held back until the queued SSLRequest has flushed so the ClientHello can't precede it.

No API changes.

v0.1.4 — Node strict-ESM compat

21 May 17:01

Choose a tag to compare

Published 0.1.3 wouldn't load under Node's strict ESM loader. import { createPool } from '@perryts/mysql' would throw does not provide an export named 'createPool' because the package was missing "type": "module" (so Node parsed dist/*.js as CommonJS) and the compiled dist/*.{js,d.ts} carried extensionless relative imports (from './connection') that Node strict ESM refuses to resolve.

This release adds "type": "module" to package.json and a small post-build pass (scripts/fix-esm-imports.mjs) that walks dist/ and rewrites every relative import to include an explicit .js extension. Source files are untouched — only the compiled artifacts are patched.

Verified locally: node --input-type=module -e "import { createPool, connect, Pool, sql } from './dist/index.js'" resolves every named export. Bun + Perry paths are unaffected — the failure was Node-strict-ESM only.

Full changelog: https://github.com/PerryTS/mysql/blob/main/CHANGELOG.md

v0.1.3

07 May 17:34

Choose a tag to compare

Patch release: fix transport/net-socket.ts::openSocket to call net.createConnection(port, host) on Perry, matching Node's documented positional signature.

  • Pre-fix the file's header comment incorrectly asserted Perry took (host, port) and the call followed suit. Perry has always matched Node's (port, host) (see crates/perry-codegen/src/lower_call.rs in the perry tree). Under the wrong order Perry coerced the host string to a port (NaN-coerced) and the port number to a host pointer, returning an invalid socket handle that silently no-op'd through every sock.on(...) registration. await connect(...) then never resolved against any MySQL server, surfacing as the immediate-exit / (number).next is not a function symptom from PerryTS/perry#536.
  • Header comment rewritten to reflect Perry's actual (port, host) contract. The Node.js / Bun code path is unchanged — it uses the object form ({ host, port }) and works as before.
  • Requires perry >= v0.5.652 for the matching runtime-side fixes ([].pop() / [].shift() returning undefined instead of NaN, perry-ext-net active-handles wiring under the well-known flip). With both halves in place, the issue's repro returns the SELECT row end-to-end.

See CHANGELOG.md for full history.

v0.1.2

07 May 04:15

Choose a tag to compare

Patch release: fix binary decoders for DATE, DATETIME/TIMESTAMP, and TIME columns.

  • The upstream resultset framing already consumes the length-encoded prefix, so the binary decoders must discriminate on buf.length instead of reading a leading length byte. Previously this caused off-by-one parsing of the year and other fields on binary-protocol rows.
  • .gitignore: minor housekeeping.

See CHANGELOG.md for full history.

v0.1.1

06 May 07:39

Choose a tag to compare

First test of the automated release workflow.

  • Add .github/workflows/publish.yml for OIDC trusted-publisher npm releases.
  • Restore canonical PerryTS casing in package.json repo URL (provenance verification is case-sensitive).
  • README: add headline benchmarks vs mysql2 and Perry AOT.
  • Scrub leftover hard-coded benchmark connection details (repo-only; not in the published tarball).

See CHANGELOG.md for full history.