Files
bun.sh/bench/sqlite/query.better-sqlite3.mjs
Jarred Sumner a37f86e89d bun:sqlite (#167)
* ✂️

* Add the slow version

* draw the rest of the owl

* Fix crash when allocating lots of memory

* [Bun.Transipiler] Support passing objects

* [JS Parser] Support passing objects to macros via Bun.Transpiler

* Update JSSQLStatement.cpp

* Embed SQLite

* Add SQLite to Dockerfile

* [sqlite] Add quick one-off queries without creating a whole object

* [sqlite] Add `columnsCount`, rename raw() to `values()`, remove `rebind`

* Implement `bun:sqlite`

* return null

* Fix updating query

* Update bun.d.ts

* more tests

* Support variadic arguments, write tests and add types

* Update sqlite.d.ts

* Update sqlite.d.ts

* latest

* Implement `Database.loadExtension` and `Database.setCustomSQLite`

* Support `require.resolve`

* [napi] Improve string performance

* [bun.js] Support some of `node:module`

* another test

* [sqlite] Support serialize & deserialize

* [`bun:ffi`] Implement `CFunction` and `linkSymbols`

* [bun.js] Fix crash in `Buffer.from`

* Update sqlite.test.js

* Document linkSymbols

* docs

* Update README.md
2022-05-16 15:46:20 -07:00

32 lines
593 B
JavaScript

import { bench, run } from "mitata";
import { createRequire } from "module";
const db = createRequire(import.meta.url)("better-sqlite3")(
"/tmp/northwind.sqlite"
);
{
const sql = db.prepare(`SELECT * FROM "Order"`);
bench('SELECT * FROM "Order" (objects)', () => {
sql.all();
});
}
{
const sql = db.prepare(`SELECT * FROM "Product"`);
bench('SELECT * FROM "Product" (objects)', () => {
sql.all();
});
}
{
const sql = db.prepare(`SELECT * FROM "OrderDetail"`);
bench('SELECT * FROM "OrderDetail" (objects)', () => {
sql.all();
});
}
run({ json: false });