Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
3d2850f
sql: consolidate the open Bun.sql, bun:sqlite and node:sqlite pull re…
Jarred-Sumner Oct 15, 2026
77a2de8
[autofix.ci] apply automated fixes
autofix-ci[bot] Oct 15, 2026
64597bf
sql: read each property once where the linter asks for it
Jarred-Sumner Oct 15, 2026
d943e48
sql: drop SASLprep (no ICU in the SCRAM login)
Jarred-Sumner Oct 15, 2026
504e083
sql: SASLprep in JS with String.prototype.normalize
Jarred-Sumner Oct 15, 2026
a896f87
sql: a character class the linter accepts
Jarred-Sumner Oct 15, 2026
668e2cd
sql: dedupe step 1, CI test fixes, SASLprep falls back for right-to-l…
Jarred-Sumner Oct 15, 2026
235efa3
sql: dedupe step 2, MySQL keeps the TLS error of a failed session, CI…
Jarred-Sumner Oct 15, 2026
a72b0e3
sql: dedupe step 3 (one SSLMode, one STARTTLS, no throwing constructo…
Jarred-Sumner Oct 15, 2026
419712a
sql: delete what nothing can observe (states, aliases, forwarders, po…
Jarred-Sumner Oct 15, 2026
4ae35b5
sql(sqlite): what onconnect and onclose throw is reported
Jarred-Sumner Oct 15, 2026
b2383f4
sql: review fixes (WAL default, BigInt binding, every statement of a …
Jarred-Sumner Oct 15, 2026
68af84c
sql: a refused dial no longer rejects a query while another connectio…
Jarred-Sumner Oct 15, 2026
00335cf
sql(postgres): a result message for a request that was not executed f…
Jarred-Sumner Oct 15, 2026
613d398
sql: DATABASE_URL is read before POSTGRES_URL, MYSQL_URL, MARIADB_URL…
Jarred-Sumner Oct 15, 2026
0ea0a72
sql(postgres): a query that got an ErrorResponse rejects at its Ready…
Jarred-Sumner Oct 15, 2026
bea2dde
sql(postgres): the second login with the SASLprep form of a password …
Jarred-Sumner Oct 15, 2026
a108500
sql(postgres): a query whose prepared statement is lost again before …
Jarred-Sumner Oct 15, 2026
d7e2000
sql: one verifies_certificate for both drivers, next to start_tls
Jarred-Sumner Oct 15, 2026
7c49344
sql: a result that a begin() or savepoint() callback returns keeps it…
Jarred-Sumner Oct 15, 2026
2b32960
test(sqlite): the database of the prepare() descriptor test is releas…
Jarred-Sumner Oct 15, 2026
c9c3b39
sql: a result is told from an array of queries by its private field, …
Jarred-Sumner Oct 15, 2026
bddd66b
sql(postgres): SCRAM-SHA-256-PLUS in the list of a connection without…
Jarred-Sumner Oct 15, 2026
a69f6dc
sql(postgres): a connection that asked for TLS and fell back to plain…
Jarred-Sumner Oct 15, 2026
b3843e8
test(sql): both drivers log in once to a TLS 1.2 server that renegoti…
Jarred-Sumner Oct 15, 2026
4479f4d
test(sql): the renegotiation test says so when its node server exits
Jarred-Sumner Oct 15, 2026
6cf6807
sql(postgres): int2[], int4[], float4[] and float8[] columns are read…
Jarred-Sumner Oct 15, 2026
08d1c00
sql(postgres): a COPY that comes with values is a simple query too, s…
Jarred-Sumner Oct 15, 2026
840c863
sql(postgres): a COPY behind an empty statement is a COPY
Jarred-Sumner Oct 15, 2026
dba5edf
sql: without adapter, a filename that is the URL of a server, or that…
Jarred-Sumner Oct 16, 2026
01d1956
sql(postgres): a query that another one's CancelRequest stopped is no…
Jarred-Sumner Oct 16, 2026
98cc583
sql(postgres): nothing is written behind a cancelled query that waits…
Jarred-Sumner Oct 16, 2026
9676fd8
sql(mysql): nothing is written behind a text that can hold several st…
Jarred-Sumner Oct 16, 2026
51d1b6c
test(mysql): the scripted server numbers the packets of a further res…
Jarred-Sumner Oct 16, 2026
59ca5b2
sql(postgres): a query whose prepared statement was lost is sent agai…
Jarred-Sumner Oct 16, 2026
9d3b3aa
test(postgres): the rows for a lost statement with something written …
Jarred-Sumner Oct 16, 2026
58a4653
Merge branch 'main' into claude/sql-consolidated
Jarred-Sumner Oct 16, 2026
11fc12f
[autofix.ci] apply automated fixes
autofix-ci[bot] Oct 16, 2026
7f6a65f
sql: where main works, behave as main does again
Jarred-Sumner Oct 16, 2026
1036afd
sql: raw() after execute() counts for a simple query on PostgreSQL, a…
Jarred-Sumner Oct 16, 2026
f9f8609
sql: until it is decided, three option rules stay as strict as they w…
Jarred-Sumner Oct 16, 2026
4b4618c
sql: options that the options object inherits count where they counte…
Jarred-Sumner Oct 16, 2026
6250dc9
test(sqlite): a Windows path is no sqlite:// URL object, so those two…
Jarred-Sumner Oct 16, 2026
43ad527
sql: five more behaviours are main's again, until somebody decides ot…
Jarred-Sumner Oct 16, 2026
974cc4c
docs(sql): on SQLite a failing execute() outside a transaction is rep…
Jarred-Sumner Oct 16, 2026
e5356a3
sql(postgres): one login finds out which form of a password the serve…
Jarred-Sumner Oct 16, 2026
1f73cdd
Merge branch 'main' into claude/sql-consolidated
Jarred-Sumner Oct 16, 2026
12c510b
sql(mysql): the statement outlives the packet that is being read
Jarred-Sumner Oct 16, 2026
e257586
sql(mysql): get_statement() keeps its attributes
Jarred-Sumner Oct 16, 2026
1200d2b
Revert "sql: until it is decided, three option rules stay as strict a…
Jarred-Sumner Oct 17, 2026
16a8688
sql: four option rules are decided, as they were before this branch
Jarred-Sumner Oct 17, 2026
9e70da1
Merge branch 'main' into claude/sql-consolidated
Jarred-Sumner Oct 17, 2026
6ab7f25
docs(sql): what is still read of a DATABASE_URL that names another ad…
Jarred-Sumner Oct 17, 2026
290a563
sql: the first row's keys are the columns of a bulk insert again
Jarred-Sumner Oct 17, 2026
75c8095
sql(postgres): int4[] and float4[] are typed arrays and `real` is the…
Jarred-Sumner Oct 17, 2026
be57236
sql(postgres): a connection keeps the 1,024 statements it used last, …
Jarred-Sumner Oct 17, 2026
486aa3e
docs(sql): typed arrays and real; the statement cache keeps 1,024
Jarred-Sumner Oct 17, 2026
dad581d
sql(postgres): channelBinding is "disable" unless it is asked for
Jarred-Sumner Oct 17, 2026
d5a5ba6
sql: console.log(rows) shows count, command, lastInsertRowid and affe…
Jarred-Sumner Oct 17, 2026
78e0830
sql(mysql): the default database is `mysql` again
Jarred-Sumner Oct 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions bench/sqlite/bun.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,15 @@ const db = Database.open(join(import.meta.dir, "src", "northwind.sqlite"));
});
}

{
const memory = new Database(":memory:");

for (const statements of [1000, 2000, 4000, 8000]) {
const sql = Buffer.alloc(statements * 9, "select 1;").toString();
bench(`db.exec(sql): ${statements} statements`, () => {
memory.exec(sql);
});
}
}

await run();
11 changes: 11 additions & 0 deletions bench/sqlite/node.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,15 @@ const db = new Database("./src/northwind.sqlite");
});
}

{
const memory = new Database(":memory:");

for (const statements of [1000, 2000, 4000, 8000]) {
const sql = Buffer.alloc(statements * 9, "select 1;").toString();
bench(`db.exec(sql): ${statements} statements`, () => {
memory.exec(sql);
});
}
}

await run();
2 changes: 1 addition & 1 deletion docs/bundler/fullstack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ import dashboard from "./public/dashboard.html";

// Initialize database
const db = new Database("app.db");
db.exec(`
db.run(`
CREATE TABLE IF NOT EXISTS users (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
Expand Down
3 changes: 2 additions & 1 deletion docs/runtime/environment-variables.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ Bun reads these environment variables to configure aspects of its behavior.

| Name | Description |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `NODE_TLS_REJECT_UNAUTHORIZED` | `NODE_TLS_REJECT_UNAUTHORIZED=0` disables SSL certificate validation. Useful for testing and debugging, but be very hesitant to use it in production. Node.js introduced this variable; Bun keeps the name for compatibility. |
| `NODE_TLS_REJECT_UNAUTHORIZED` | `NODE_TLS_REJECT_UNAUTHORIZED=0` disables SSL certificate validation. Useful for testing and debugging, but be very hesitant to use it in production. Node.js introduced this variable; Bun keeps the name for compatibility. [`Bun.sql`](/runtime/sql#ssl-modes-overview) still verifies the certificate with `sslmode=verify-ca` and `verify-full`. |
| `SSL_CERT_FILE` | Path to a PEM file of CA certificates that Bun trusts in addition to its bundled root certificates. If unset, Bun reads `/etc/ssl/cert.pem`. If set to an empty string, Bun reads no file. |
| `SSL_CERT_DIR` | Directories of CA certificates that Bun trusts in addition to its bundled root certificates, each file named by its subject hash (`<hash>.0`, as `openssl rehash` creates). Separate directories with `:` (`;` on Windows). If unset, Bun reads `/etc/ssl/certs`. |
| `BUN_CONFIG_VERBOSE_FETCH` | If `BUN_CONFIG_VERBOSE_FETCH=curl`, then fetch requests log the URL, method, request headers and response headers to the console. This also works with `node:http`. `BUN_CONFIG_VERBOSE_FETCH=1` is equivalent to `BUN_CONFIG_VERBOSE_FETCH=curl` except without the `curl` output. |
Expand All @@ -227,6 +227,7 @@ Bun reads these environment variables to configure aspects of its behavior.
| `BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD` | If `BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD=true`, then `bun --watch` does not clear the console on reload |
| `DO_NOT_TRACK` | Disable uploading crash reports to `bun.report` on crash. On macOS & Windows, crash report uploads are enabled by default. Bun sends no other telemetry, though we plan to add some. If `DO_NOT_TRACK=1`, then auto-uploading crash reports and telemetry are both [disabled](https://do-not-track.dev/). |
| `BUN_OPTIONS` | Prepends command-line arguments to any Bun execution. For example, `BUN_OPTIONS="--hot"` makes `bun run dev` behave like `bun --hot run dev`. |
| `DATABASE_URL` | Connection URL of the default [`Bun.sql`](/runtime/sql) client. `Bun.sql` also reads `POSTGRES_URL`, `MYSQL_URL`, `PGHOST` and others: see [Database Environment Variables](/runtime/sql#database-environment-variables). |

## Runtime transpiler caching

Expand Down
2 changes: 1 addition & 1 deletion docs/runtime/http/server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ import type { Post } from "./types.ts";
import { Database } from "bun:sqlite";

const db = new Database("posts.db");
db.exec(`
db.run(`
CREATE TABLE IF NOT EXISTS posts (
id TEXT PRIMARY KEY,
title TEXT NOT NULL,
Expand Down
Loading
Loading