#4327·sqlx

SQLite Connect Options for Memory DB Panics when Building URL

Author: nlordellCreated Jun 30, 2026Updated Sep 11, 2026
Labelsbug

I have found these related issues/pull requests

I did not find any related issues or pull requests (searched by the panic message).

Description

The ConnectOptions::to_url_lossy implementation for :memory: SQLite connect options panics with BUG: generated un-parseable URL: InvalidPort.

Reproduction steps

rust
use sqlx::ConnectOptions as _;
use std::str::FromStr as _;

let _ = sqlx::sqlite::SqliteConnectOptions::from_str("sqlite::memory:")
    .unwrap()
    .to_url_lossy();

SQLx version

v0.9.0

Enabled SQLx features

sqlite, runtime-tokio

Database server and version

SQLite (bundled)

Operating system

Debian 13

Rust version

1.96.0