Files
bun.sh/test/regression/issue/26629.test.ts
Claude Bot ec0f811cc1 fix(sqlite): use correct library name on Linux
On Linux, dlopen("sqlite3", ...) fails because the library is installed
as "libsqlite3.so" not "sqlite3". This made bun:sqlite unusable on
Linux systems with system-installed SQLite.

Fixes #26629

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 14:31:38 +00:00

20 lines
732 B
TypeScript

import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
// Regression test for https://github.com/oven-sh/bun/issues/26629
// bun:sqlite fails to locate the system SQLite library on Linux because
// it searched for "sqlite3" instead of "libsqlite3.so".
test("bun:sqlite should load the system SQLite library", async () => {
await using proc = Bun.spawn({
cmd: [bunExe(), "-e", "import Database from 'bun:sqlite'; new Database(':memory:'); console.log('ok')"],
env: bunEnv,
stdout: "pipe",
stderr: "pipe",
});
const [stdout, , exitCode] = await Promise.all([proc.stdout.text(), proc.stderr.text(), proc.exited]);
expect(stdout.trim()).toBe("ok");
expect(exitCode).toBe(0);
});