maintainer-feedback requested: [Bug 299796] databases/py-sqlite3: Allow loadable extensions controlled by the EXTENSIONS port option

From: <bugzilla-noreply_at_freebsd.org>
Date: Fri, 23 Oct 2026 03:13:12 UTC
Bugzilla Automation <bugzilla@FreeBSD.org> has asked freebsd-python (Nobody)
<python@FreeBSD.org> for maintainer-feedback:
Bug 299796: databases/py-sqlite3: Allow loadable extensions controlled by the
EXTENSIONS port option
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299796



--- Description ---
The EXTENSIONS option allows the sqlite3 Python module to load extensions.

Rationale:
Users should be able to load extensions.

Extension examples:
* databases/py-sqlite-vec

References:
* The upstream disables this option by default
* Virtually all port systems (Debian, Redhat, Fedora, Arch, etc) extensions by
default in their sqlite3 ports.

Code example:

import sqlite3
import sqlite_vec

# Create your standard SQLite connection
conn = sqlite3.connect(":memory:")

# Enable extension loading on the underlying connection
conn.enable_load_extension(True)

# Automatically locate and load the vec0 library
sqlite_vec.load(conn)

# Optional: Disable extension loading for security
conn.enable_load_extension(False)

# Verify the extension works by checking its version
cursor = conn.cursor()
cursor.execute("select vec_version();")
print(f"sqlite-vec version: {cursor.fetchone()[0]}")