Skip to content

Accept journal_mode, synchronous, and busy_timeout in SQLite URLs - #401

Merged
taylorotwell merged 2 commits into
laravel:0.xfrom
cole-robertson:sqlite-url-pragmas
Dec 1, 2026
Merged

taylorotwell merged 2 commits into
laravel:0.xfrom
cole-robertson:sqlite-url-pragmas

Conversation

@cole-robertson

@cole-robertson cole-robertson commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #400.

Laravel PHP's SQLite connections accept journal_mode, synchronous, and busy_timeout (including in DB_URL), but SQLx rejects them on the URL, so DATABASE_URL couldn't enable WAL. Sqlite::options now takes these three out of the query string, passes the rest to SQLx's parser unchanged, and applies them through SqliteConnectOptions. URLs without them are parsed exactly as before. Every SQLite source (pools, read/write endpoints, test databases, schema:dump) goes through Sqlite::options, so they all accept the new options. Options you leave out keep SQLite's defaults. busy_timeout is in milliseconds, as in PHP.

Tests: sqlite_urls_accept_journal_mode_synchronous_and_busy_timeout checks that the pragmas are applied, that mode=memory&cache=shared survive, and that invalid values are reported. It fails without the change.

Verified with cargo test --features database-sqlite --test database (359 passed; schema_dump::schema_dump_writes_the_sqlite_schema_with_the_migrations_rows fails the same way on 0.x with my local sqlite3 3.53.4), the laravel-rust-database doctests, cargo clippy -p laravel-rust-database --all-targets --all-features -- -D warnings, and cargo fmt --all -- --check.

A natural follow-up would be journal_mode, synchronous, and busy_timeout setters on ConnectionConfig, matching the keys in PHP's config/database.php, so they can be set in src/config/database.rs as well. Happy to send that if you'd like it.

🤖 Generated with Claude Code

cole-robertson and others added 2 commits December 1, 2026 16:01
Laravel PHP's SQLite connections accept these options, including in
DB_URL. SQLx rejects them on the URL, so DATABASE_URL couldn't enable
WAL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@taylorotwell
taylorotwell merged commit 3693a2d into laravel:0.x Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SQLite URLs reject journal_mode, synchronous, and busy_timeout

3 participants