Bun 1.2.21 expands bun.SQL to support MySQL and MariaDB and integrates the existing bun:sqlite client into a unified cross-database API. Benchmarking claims indicate bun.SQL executes 100,000 simple queries far faster than comparable Node.js clients. Bun.secrets provides a native secrets manager that uses platform credential stores to avoid plaintext secret files. A YAML parser has been added following JSON and TOML parser behavior. Additional features include a security scanner API, a finer-grained audit command, an API for building standalone executables, and a codesigned Windows binary to remove security warnings.
The new database drivers are part of the bun.SQL API, introduced in January, which initially supported only PostgreSQL. Now Bun also supports MySQL and MariaDB. In addition, a SQLite client, which has long been part of Bun as bun:sqlite, has been added to Bun.SQL, described in the docs as "a unified API for multiple database systems."
According to Bun creator Jarred Sumner, Bun.SQL is nine times faster than using the mysql2 package with Node.js, and over four times faster than using the MariaDB client with Node, based on the time taken to run 100,000 simple queries. The MySQL driver, like Bun itself, is written in Zig.
Bun.secrets, also new in this release, is a native secrets manager for CLI (command-line interface) tools and local development. On macOS, it uses the Keychain, on Linux it uses libsecret, and on Windows, the Credential Manager. The advantage is that it avoids storing data such as passwords and tokens in plain text files. The latest release also adds a YAML parser to the Bun API, which works in the same way as existing parsers for JSON and TOML.
Collection
[
|
...
]