mirror of
https://github.com/oven-sh/bun
synced 2026-02-12 20:09:04 +00:00
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>
20 lines
732 B
TypeScript
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);
|
|
});
|