mirror of
https://github.com/oven-sh/bun
synced 2026-02-10 10:58:56 +00:00
* Fix crash with latin1 supplemental characters in bun:sqlite queries * Make it run from any dir * Fix comment * [autofix.ci] apply automated fixes --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
29 lines
566 B
JavaScript
29 lines
566 B
JavaScript
import { run, bench } from "mitata";
|
|
import { Database } from "bun:sqlite";
|
|
import { join } from "path";
|
|
|
|
const db = Database.open(join(import.meta.dir, "src", "northwind.sqlite"));
|
|
|
|
{
|
|
const sql = db.prepare(`SELECT * FROM "Order"`);
|
|
bench('SELECT * FROM "Order"', () => {
|
|
sql.all();
|
|
});
|
|
}
|
|
|
|
{
|
|
const sql = db.prepare(`SELECT * FROM "Product"`);
|
|
bench('SELECT * FROM "Product"', () => {
|
|
sql.all();
|
|
});
|
|
}
|
|
|
|
{
|
|
const sql = db.prepare(`SELECT * FROM "OrderDetail"`);
|
|
bench('SELECT * FROM "OrderDetail"', () => {
|
|
sql.all();
|
|
});
|
|
}
|
|
|
|
await run();
|